RE: [sv-bc] @* vs. always_comb

From: Mark Hartoog <Mark.Hartoog_at_.....>
Date: Thu Dec 08 2005 - 08:17:11 PST
Shalom,
 
Your original point was that always_comb could not be used for this kind
of modeling because only one
always comb can drive a given variable. That means that you are trying
to model not only the driver
but the whole bus that connects the multiple drivers with a variable.
While it is possible to use variables
to model three-state buses, it is difficult to detect multi-driver error
conditions when you are using 
variables, and the simulation will give mis-leading results in a
multi-drive situation. Nets are the 
appropriate way of modeling three-state buses. 
 
It is certainly ok to model the individual driver using variables, as
long as the multiple driver are connected 
up using nets. In this case always_comb is as good as always @*, since
each variable is only driven
by a single always block. 


________________________________

	From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com] 
	Sent: Thursday, December 08, 2005 12:55 AM
	To: Mark Hartoog; sv-bc@eda.org
	Subject: RE: [sv-bc] @* vs. always_comb
	
	
	  

	Mark,

	That is an inappropriate way of looking at it.

	The variable is not used to model a three-state ("tri-state" is
a trademark, I believe) bus, but rather a three-state driver. There is a
difference if the bus has more than one driver.

	It is really no different from combinational logic description
using a variable, which sometimes drives 0 and sometimes 1. Here it also
sometimes drives high-impedance, i.e., does not drive.

	Typically, it is used in one of two ways. In one way, there is a
three-stated wire which is a common output of several modules. From the
point of view of each module, it is an output only, which is sometimes
driven and sometimes not. Since it is output only, a variable can be
used.

	The second way is by continuous assignments from the variable
drivers to a common wire. 

	Since port connections from a variable to a wire are also
equivalent to a continuous assignment, the two ways are essentially the
same.

	This is a very common way to describe three-state drivers.

	We may use a variable in an always block because the logic may
be complex and easier to describe using behavioral statements like if
and case, which we cannot use in continuous assignments.

	In fact, your own company's manual on Verilog for synthesis
shows several examples using reg's, including an example of a registered
three-state driver, where both the three-state enable and the data are
outputs of flip-flops.

	Shalom

	
________________________________


	From: Mark Hartoog [mailto:Mark.Hartoog@synopsys.com] 
	Sent: Monday, December 05, 2005 7:01 PM
	To: Bresticker, Shalom; sv-bc@eda.org
	Subject: RE: [sv-bc] @* vs. always_comb

	 

	I really don't think that variables are the appropriate way of
modeling tri-state busses.

	Wires are much better for this. 

	 

	You wouldn't use a unresolved wire to model a tri-state bus, why
try to use a variable?

		 



image001.gif
Received on Thu Dec 8 08:17:19 2005

This archive was generated by hypermail 2.1.8 : Thu Dec 08 2005 - 08:18:05 PST