RTL shift register code in VCS 
Author Message
 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



Mon, 15 Nov 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. RTL shift register code in VCS

2. 4-bit parallel shift register code

3. need vhdl code for 16 bit serial-in, serial-out shift register

4. vhdl code for shift registers

5. verilog different behavior code and RTL code?

6. Must wire shift register through event structure

7. Resetting the shift register

8. problems about shift register

9. Empty picture vs a shift register?

10. Shift Register Initialisation

11. Clearing chart buffer using shift registers

12. while loops and shift registers

 

 
Powered by phpBB® Forum Software