Hi Bob,
(Bob Jenkins) writes:
> One possible advantage of an LFSR over incrementing a counter is that
> if there is a bug affecting a m out of n states, but those states are
> clumped together, an LFSR is likely to hit one of those in the first
> n/m states that it tries, but a counter is likely to go through n/2 of
> the states before it hits any bad ones. A PRNG shares this advantage.
> This only matters if it takes a long time to try all states.
But until after you actually tried all vectors, there is no way to
tell you are done. How about these error cases happened to be clumped
together so that they'd be caught by the incrementer -- or by a
different LFSR polynomial? Equal chances, I'd say.
The sequence generated by an LFSR shares some important
characteristics with a counter:
1. The sequence is deterministic
2. It has a period of 2^n cycles
3. Each generated value is unique
You could probably say that the sequence generated by a counter is a
special case of an LFSR sequence.
> One possible advantage of an LFSR over a PRNG is that an LFSR won't
> repeat any states. If you want to cover all n states, an LFSR will do
> it in n tries, but a PRNG has to try nlog(n) times before it probably
> hit every state, and even then it's only "probably". A counter shares
> this advantage.
Good point! That is my standard argument if certain vendors (the usual
suspects) try telling me that there is nothing but random simulation
(plus coverage).
AFAIK, Testbuilder (and likely SystemC) provide a PRNG that guarantees
that each generated number is unique. Other HVLs could be prevented
from running forever, e.g. by using functional coverage data as
feedback for the stimulus. In Specman/e you could also generate a list
containing all numbers from 0 to 2^20-1 (after you changed the
max. list size). Then you would use the PRNG to generate a second list
with the constraint that both lists must have the same set of values
(there is always more than one way to do things). Which brings us back
to the argument whether this complexity is really necessary for our
ALU case.
2^20 input vectors generated by either a counter or an LFSR would have
long finished while we are still babbling
Best regards,
Marcus
--
Marcus Harnisch | Mint Technology, a division of LSI Logic
| 200 West Street, Waltham, MA 02431
Tel: +1-781-768-0772 |
http://www.lsilogic.com