Um, there is some abuse of terminology here...
On 11/28/2011 10:20 PM, unfrostedpoptart wrote:
> On Monday, November 28, 2011 3:42:23 PM UTC-8, Dave Rich wrote:
>> On Nov 21, 1:13 pm, "
dsco...@rcn.com" <
dsco...@rcn.com> wrote:
>>> On Nov 21, 3:25 pm, Paul Marciano
>> wrote:
>> What you need is a continuous assignment and the conditional operator
>>
>> assign #70ns data_out = (!nCS && !nWE) ? ram[ADDR] : 16'hz;
>>
>> The continuous assignment is sensitive to all changes on the RHS of
>> the '=', and take 70ns to flow to the LHS.
>
> The danger with this is that it's a blocking assignment, so if any of the RHS signal change in less than #70 (whatever that means based on timescale), they won't propagate. This might be the correct modeling - or it might not. Using always @* (Verilog 2001 - hopefully works on all simulators today) or always_comb (System Verilog) with blocking ( <= ) assignments will propagate all input changes.
A continuous assignment is a continuous assignment. A "blocking
assignment" is something specific and only happens in behavioral
code.
However you are correct that continuous assignments implement
inertial delays. However, that is probably what you want in
this case anyhow. (If your memory has 70ns access times, then
changing your inputs faster then that would be bad.)
If you do go with "always @*..." then you will get transport
delays. Note that the "<=" assignment is called *NON*-blocking
assignment, and is probably not what you want if you are modeling
combinational logic in an always statement.
> Welcome to some of the confusing parts of Verilog! Search for "transport delay vs inertial delay" for more explanation.
Indeed.
--
Steve Williams "The woods are lovely, dark and deep.
steve at
icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."