home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / verilog / 477 < prev    next >
Encoding:
Internet Message Format  |  1992-12-20  |  1.2 KB

  1. Path: sparky!uunet!optilink!manley
  2. From: manley@optilink.COM (Terry Manley)
  3. Newsgroups: comp.lang.verilog
  4. Subject: execution of always blocks
  5. Message-ID: <13665@optilink.COM>
  6. Date: 17 Dec 92 07:15:51 GMT
  7. Organization: DSC/Optilink Access Products
  8. Lines: 38
  9.  
  10. Ok, I've got a 'newbie' question.
  11.  
  12. What's the story with this language?
  13.  
  14. More specifically why doesn't the following work:
  15.  
  16. reg a,b,c;
  17.  
  18. always @(posedge Clk) c = b;
  19. always @(posedge Clk) b = a;
  20.  
  21. When the following does:
  22.  
  23. always @(posedge Clk)
  24.   begin
  25.     c = b;
  26.     b = a;
  27.   end
  28.  
  29. In the first case for some reason verilog may perform the "b = a"
  30. assignment first, thereby throwing away the expected value that c was
  31. going to get.  We've even seen cases where in a given simulation
  32. sometimes it works correctly, sometimes it doesn't.
  33.  
  34. Ideally one would want the data transfer at the posedge of the clock
  35. to behave like digital logic, that is it would, in this case behave
  36. like a shift register.  Instead we get what looks like a shift
  37. register with a bad hold time problem. 
  38.  
  39. So what is the story with multiple always blocks?
  40. Is this something to worry about between modules?
  41. How about between modules in different files?
  42.  
  43.  
  44. --
  45. dave
  46. manley@optilink.com
  47.  
  48.