🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.verilog
Article #152

execution of always blocks

#152
From: Terry Manley
Date: Thu, 17 Dec 1992 07:15
37 lines
1249 bytes
Ok, I've got a 'newbie' question.

What's the story with this language?

More specifically why doesn't the following work:

reg a,b,c;

always @(posedge Clk) c = b;
always @(posedge Clk) b = a;

When the following does:

always @(posedge Clk)
  begin
	c = b;
	b = a;
  end

In the first case for some reason verilog may perform the "b = a"
assignment first, thereby throwing away the expected value that c was
going to get.  We've even seen cases where in a given simulation
sometimes it works correctly, sometimes it doesn't.

Ideally one would want the data transfer at the posedge of the clock
to behave like digital logic, that is it would, in this case behave
like a shift register.  Instead we get what looks like a shift
register with a bad hold time problem. 

So what is the story with multiple always blocks?
Is this something to worry about between modules?
How about between modules in different files?


--
dave
manley@optilink.com
Technical Details
Message-ID: <13665@optilink.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!optilink!manley

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!optilink!manley
From: manley@optilink.COM (Terry Manley)
Newsgroups: comp.lang.verilog
Subject: execution of always blocks
Message-ID: <13665@optilink.COM>
Date: 17 Dec 92 07:15:51 GMT
Organization: DSC/Optilink Access Products
Lines: 38