RTL shift register code in VCS
Quote:
> > shifter = ( (shifter >> 1) | ( {serial-in,43'b0} ) );
> > $display ("shifter value: %h", shifter); // only for
> debugging
> Also [in addition to Mike's suggestion of a time zero race] note
> that
> by using a zero time blocking assignment to "shifter" you make it
> very
> hard to actually use the output of the shifter anywhere else in the
> design.
> i.e. elsewhere you might say:
> begin
> // try to sample the output of the shifter
> a=shifter;
> end
> there is a race between the two always blocks. It's possible for
> one
> to see the (posedge shift_clk) and execute completely (updating
> shifter) before the other block sees the clock. Thus when the
> second
> block executes it gets the wrong value (next value) of shifter.
> This hold time problem can be fixed by changing the assignment in
> the
> shift register to one of the following:
> non-blocking assignment:
> shifter <= ( (shifter >> 1) | ( {serial-in,43'b0} ) );
> blocking assignment with delay:
> shifter = #1 ( (shifter >> 1) | ( {serial-in,43'b0} ) );
It's this kind of nonsense that makes me crazy. I think I am at a
disadvantage because I learned VHDL first then Verilog. The execution
ordering of the Procedural Blocks is unknown (undefined) and thus the
little tricks you have to play to get the proper simulation seems
troublesome. It was nice of them to add the non-blocking assignment so
this works sorta like VHDL but not quite the same.
Yes, I can bad mouth VHDL also! I often have signals call
"TheStupidThingsIDoForVHDL". Verilog coders would write this as "foo."
It just seems we are still working to hard for our HDL's lets hope the
language lawyers get it right next time. It's late and I lost the point
I was trying to make don't flame me its just an observation.
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Now stupid things we do for news readers....
Tom Tessier
t2design