2007 SNUG Verilog Gotchas
2007 SNUG Verilog Gotchas
Chris Spear
Synopsys
What is a “gotcha”?
Why do standards have gotchas?
Summary
2 of 18
Stu Sutherland
Sutherland HDL
Chris Spear
Synopsys
Chris Spear
Synopsys
Chris Spear
Synopsys
5 of 18
Stu Sutherland
Chris Spear
Synopsys
Chris Spear
Synopsys
Chris Spear
Synopsys
Statements in Classes
LCDM Engineering
Chris Spear
Synopsys
in Classes (continued)
LCDM Engineering
Chris Spear
Synopsys
Chris Spear
Synopsys
Sample
Sample of
of values
values generated:
generated: Why is med greater than hi?
lo
lo == 20,
20, med
med == 224,
224, hi
hi == 164
164
lo == 114, Why is lo greater than med?
lo 114, med
med == 39,
39, hi
hi == 189
189
lo
lo == 186,
186, med
med == 148,
148, hi
hi == 161
161 Constrains hi to
Constrains hi to be
be greater
greater than
than result
result
of
of true/false
true/false test
test of
of "lo
"lo << med"
med"
•• lo
lo and med are
and med are not
not constrained
constrained
To avoid this Gotcha… •• Result
Result of
of true/false
true/false test
test is
is 00 or
or 11
Constraints involving multiple constraint increasing {
Boolean operations should be lo < med;
broken into multiple statements med < hi; }
13 of 18
Stu Sutherland
Gotcha: Assertion Pass Statements Sutherland HDL
Don Mills
Chris Spear
Synopsys
Gotcha! Counts
Counts how
how many
many times req is
times req is followed
followed by
by ack
ack
and
and how
how many
many times
times there
there was
was no
no req
req
Chris Spear
Synopsys
The else is
The else is paired
paired with
with the if,, instead
the if instead of
of the
the assert
assert
Assignments in Expressions
LCDM Engineering
Chris Spear
Synopsys
Chris Spear
Synopsys
Chris Spear
Synopsys
[email protected] [email protected]
18 of 18