[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA: Icarus Verilog: vcd dumper has a bug ?



On Fri, 25 Apr 2003, Hirokatsu SUNAKAWA wrote:

> File size became small.
>
>    632732 dumpfile.vcd.new
>  18155605 dumpfile.vcd.org

I managed slightly better at 13000:1  =)

-rw-rw-r--    1 bybell   bybell    3890339 Apr 25 17:11 dumpfile_old.lxt
-rw-rw-r--    1 bybell   bybell        299 Apr 25 17:37 dumpfile.lxt

For Hirokatsu Sunakawa's example, LXT's temporal compression feature gets
to flex its muscles big time with RoSync active.  If the attached patch is
correct (based on HS's VCD one), it'd probably be best to make it the
default for LXT.  The gains won't be as great of course, but there should
be a measurable impact for some sim runs.

Regards,
-t

*** sys_lxt_old.c	Thu Feb 20 20:36:25 2003
--- sys_lxt.c	Fri Apr 25 17:38:43 2003
***************
*** 146,151 ****
--- 146,152 ----
        struct t_vpi_time time;
        struct lt_symbol *sym;
        struct vcd_info*next;
+       int scheduled;
  };
  
  
***************
*** 238,243 ****
--- 239,286 ----
        return 0;
  }
  
+ static int variable_cb_2(p_cb_data cause)
+ {
+       struct vcd_info*info = (struct vcd_info*)cause->user_data;
+       unsigned long now = cause->time->low;
+  
+       if (dump_is_off)
+ 	    return 0;
+ 
+       if (dump_header_pending())
+ 	    return 0;
+ 
+       if (now != vcd_cur_time) {  
+             lt_set_time(dump_file, now);
+ 	    vcd_cur_time = now;
+       }
+ 
+       show_this_item(info);
+    
+       info->scheduled = 0;  
+       return 0;
+ }
+ 
+ static int variable_cb_1(p_cb_data cause)
+ {
+       struct t_cb_data cb;
+       struct vcd_info*info = (struct vcd_info*)cause->user_data;
+ 
+       if (dump_is_off)           return 0;
+       if (dump_header_pending()) return 0;
+       if (info->scheduled)       return 0;
+ 
+       info->scheduled++;
+  
+       cb = *cause;
+       cb.reason = cbReadOnlySynch;
+       cb.cb_rtn = variable_cb_2;
+       vpi_register_cb(&cb);
+       
+       return 0;
+ }
+ 
+ 
  static int dumpvars_cb(p_cb_data cause)
  {
        if (dumpvars_status != 1)
***************
*** 498,510 ****
  		  info->time.type = vpiSimTime;
  		  info->item  = item;
  		  info->sym   = lt_symbol_add(dump_file, ident, 0 /* array rows */, vpi_get(vpiSize, item)-1, 0, LT_SYM_F_BITS);
  
  		  cb.time      = &info->time;
  		  cb.user_data = (char*)info;
  		  cb.value     = NULL;
  		  cb.obj       = item;
  		  cb.reason    = cbValueChange;
! 		  cb.cb_rtn    = variable_cb;
  
  		  info->next  = vcd_list;
  		  vcd_list    = info;
--- 541,554 ----
  		  info->time.type = vpiSimTime;
  		  info->item  = item;
  		  info->sym   = lt_symbol_add(dump_file, ident, 0 /* array rows */, vpi_get(vpiSize, item)-1, 0, LT_SYM_F_BITS);
+ 		  info->scheduled = 0;
  
  		  cb.time      = &info->time;
  		  cb.user_data = (char*)info;
  		  cb.value     = NULL;
  		  cb.obj       = item;
  		  cb.reason    = cbValueChange;
! 		  cb.cb_rtn    = variable_cb_1;
  
  		  info->next  = vcd_list;
  		  vcd_list    = info;
***************
*** 535,547 ****
  	    info->time.type = vpiSimTime;
  	    info->item  = item;
  	    info->sym   = lt_symbol_add(dump_file, ident, 0 /* array rows */, vpi_get(vpiSize, item)-1, 0, LT_SYM_F_DOUBLE);
  
  	    cb.time      = &info->time;
  	    cb.user_data = (char*)info;
  	    cb.value     = NULL;
  	    cb.obj       = item;
  	    cb.reason    = cbValueChange;
! 	    cb.cb_rtn    = variable_cb;
  
  	    info->next  = vcd_list;
  	    vcd_list    = info;
--- 579,592 ----
  	    info->time.type = vpiSimTime;
  	    info->item  = item;
  	    info->sym   = lt_symbol_add(dump_file, ident, 0 /* array rows */, vpi_get(vpiSize, item)-1, 0, LT_SYM_F_DOUBLE);
+ 	    info->scheduled = 0;
  
  	    cb.time      = &info->time;
  	    cb.user_data = (char*)info;
  	    cb.value     = NULL;
  	    cb.obj       = item;
  	    cb.reason    = cbValueChange;
! 	    cb.cb_rtn    = variable_cb_1;
  
  	    info->next  = vcd_list;
  	    vcd_list    = info;