From: Michael McNamara (mac@verisity.com)
Date: Wed Feb 06 2002 - 09:21:19 PST
Precedence: bulk
Dennis Marsa writes:
> Precedence: bulk
>
> Jayaram Bhasker wrote:
> >
> > Mac:
> >
> > > > So, if any element of mem8x10 other the element 10 changes,
> > > > this statement would not be re-evaluated. Is that the
> > > > proper interpretation of @(*) in this context?
> >
> > >Yes.
> >
> > There is something not right here. Given this interpretation, there can be
> > mismatches between the implied hardware and the simulation behavior. For ex, if
> > mem8x10[7] changes, the always stmt will not execute, but the implied hardware will
> > execute and "a" will get a new value.
Q1) Why will the implied hardware execute?
Q2) If it did execute, it will get a new value that is exactly the
same as the value it had before, because mem8x10[10] has not
changed. So, how do you tell it executed?
To my read, the statement
always @(mem8x10[10]) a = mem8x10[10];
is a flipflop that is mirroring the value of that one element of
the memory, and will only change is that element changes.
Of course, a cycle based simulator will re-evaluate everything on
every cycle; which is conservative, but equivalent to a event based
simulator which only evaluates logic that is chnaging in value.
> > My interpretation would be that since a variable index is being used on a memory(mem8x10[b]),
> > the entire memory (mem8x10) needs to be part of the event list to keep the
> > semantics of the implied hardware and simulation to match. In other words, my interpretation
> > of @* would be:
> >
> > always @(mem8x10[10] or mem8x10[0] or mem8x10[1] or mem8x10[2] or mem8x10[3] or ....<list with all
> > index values>)
>
> This is the way I would prefer to interpret it as well.
>
> One could shorten it to @(mem8x10[10] or mem8x10) if one
> defines the event mem8x10 to mean exactly as you show above:
>
> mem8x10[0] or mem8x10[1] or mem8x10[2] or ...
>
> This makes the semantics of array selects in a @(*) consistent
> with vector selects; i.e. if a variable index is used, then we
> are sensitive to the entire array (or vector).
>
> Dennis Marsa
> Xilinx, Inc.
>
How could you tell that the simulator was executing incorrectly?
The example I was using was:
always @(*) begin
a = mem8x10[10];
end
and suggested that this would be effectively (and efficiently)
translated to:
always @( mem8x10[10]) begin
a = mem8x10[10];
end
--
_
// Michael McNamara, Sr VP Technology <mac@verisity.com>
_ // 650-934-6888, 408-930-6875 Cell <http://www.verisity.com>
\\ // ___ ____ _ ___ _ ___ _ _ ___ ___ __ _ _ _ _
\\// |_ |___)|(___ |' | ` \ / | \ |_ (__ | / _ |\ |
\/ |__ | \ | ___)| | | |__/ |__ __)| \_/ | \|
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:55:35 PDT
and
sponsored by Boyd Technology, Inc.