On Wed, 16 Feb 2005, Nikolay V. Pyatkov wrote:
> I thought, there should be some consistence in vvp behavior and vcd dump. If
> the transition on the signal can trigger wait() or always @() the vcd trace
> should show the transition.
Your vcd file actually looks like this:
329 :/tmp/q> more z.vcd
$date
Wed Feb 16 21:56:44 2005
$end
$version
Icarus Verilog
$end
$timescale
1s
$end
$scope module test_wait $end
$var reg 1 ! a $end
$upscope $end
$enddefinitions $end
#0
$dumpvars
0!
$end
#3
0!
#4
0!
#5
If you're using gtkwave, it deliberately ignores the value changes at
times 3/4/5 as they're the same as the preceeding value for that net and
as such are redundant. I did this mainly because I've seen buggy dumpers
in the past that accidentally dumped the same net multiple times which
caused bogus glitches on-screen. I didn't wish to go blind looking at VCD
files...
If you wish to actually view those glitches, do the one-line patch found
at the end of this note to src/vcd.c which doesn't ignore them. I may add
implicit glitches as a user configurable option in the future via the
.gtkwaverc file, however this might only work with icarus. I see that
CVER elides them such that the whole file is empty!
$date
Wed Feb 16 22:10:58 2005
$end
$version
GPLCVER_1.10a of 08/04/03
$end
$timescale
1 ns
$end
$enddefinitions $end
#0
$dumpvars
$end
#6
As Steve Williams said in an earlier note, what you're doing isn't really
recommended as the behavior across different simulators isn't
deterministic.
A patch to get the behavior you want is below. The same also applies to
other if() statements in that function marked "/* same region == go skip */"
if you really do want that function. Really, you might be better off
using event variables like 'event a' with a matching '->a;' construct.
Regards,
Tony
29 :/tmp/gtkwave-1.3.54/src> diff -cNB vcdold.c vcd.c
*** vcdold.c Wed Feb 16 22:01:40 2005
--- vcd.c Wed Feb 16 22:05:03 2005
***************
*** 1616,1622 ****
if((ch=='x')||(ch=='X')) heval=1; else
heval=2;
! if((n->curr->v.val!=heval)||(time==start_time)) /* same region == go
skip */
{
if(n->curr->time==time)
{
--- 1616,1622 ----
if((ch=='x')||(ch=='X')) heval=1; else
heval=2;
! if((1)||(n->curr->v.val!=heval)||(time==start_time)) /* same region ==
go skip */
{
if(n->curr->time==time)
{