Subject: Re: system tasks
From: Adam Krolnik (krolnik@lsil.com)
Date: Fri Mar 22 2002 - 09:27:56 PST
Hi Tom;
:> delay(sig, clocks) - return signal value from N clocks ago.
:> Extremely useful and simplifying ability!
:Agreed that this is useful. How do you specify the clock? If you only
Use of this kind of function would require the specification of
the clock '@@ (posedge clk)'.
:allow this in an assertion, then you could pick up the clock from the
:assertion, but then this requires a clock even for immediate
:assertions:
: assert($delay(foo,3)); // where do you get the clock?
Yes it would, the same as if you had to write the code to do this
by hand (which is the real drawback.)
:> posedge() - detect when a signal has a positive edge.
:For how long is this valid? If it's clock-based, then you have to
:define the clock as with delay. If it's not clock-based, is it an
:event? Is it true until the end of the timestep in which the signal
:changed?
All good points. I implemented this with the delay function:
posedge(sig) ::= ~delay(sig, 1) & sig;
It's usefulness comes in to prevent retriggering for events that
occur for multiple cycles and you only want to start based on
the first event. Maybe Peter's suggestion of proving the number
of activations of an assertion would be an alternative.
:If we do this, I would recommend sticking with a known comparison
:mechanism/algorithm, such as casex. To use the '?' for don't care, we
:could choose casez
I do not understand what you mean 'sticking with a known comparison
mechanism.' Are you suggesting that if we want a don't care
comparison, we implement the casex or casez mechanism in it? If
so, that's fine. I would suggest we choose casez. You should be
able to avoid having an undriven signal (with an X) cause a don't
care match and provide a false positive. I used this trick
to ensure we avoided this problem when implementing this mechanism.
$in(sig, values) ::=
casez(~(~sig)) // Convert Z to X's so they don't match.
value1, value2, ...: 1
default 0
endcase
> I'd like to go into how useful the delay() function is, but that
> is better left for another mail...
:I agree it's useful, but there are a lot of issues to be addressed to
:make sure it means the same thing in event-based and cycle-based
:semantics.
It's inclusion will go a long way for assertions. A profile from
one projects ~3500 assertions shows that 1/3 have used the function.
It needs to be viewed as a register semantic. It then should have
similar properties in both event and cycle (immediate and strobed)
environments.
Adam Krolnik
Verification Mgr.
LSI Logic Corp.
Plano TX. 75074
This archive was generated by hypermail 2b28 : Fri Mar 22 2002 - 09:30:15 PST