Subject: Assertion message proposal
From: Tom Fitzpatrick (fitz@co-design.com)
Date: Tue Apr 02 2002 - 08:08:35 PST
Hi Gang,
Proposal: Assuming passage of Vote1a-c, and Vote 3, and failure of Vote2,
Change:
"If the else is omitted a default error message is written if the assertion
fails. The contents of the message may be tool-specific. For simulation
tools, it is recommended that the message include basic information about
the assertion statement and when it failed to facilitate debug, such as
Run-time WarningError: myfile.slg:7 Assertion assert_foo failed at
time 105
"If the else is present, the default message is still printed when the
assertion fails. Additional information may be displayed after the default
message by including a system task to do so, such as $fatal, $error,
$warning, $info. These system tasks indicate the severity, and can contain
additional information in the format of $display.
assert (foo); else $fatal("finish simulation because foo is false");
TO:
"If an assertion fails and no else clause is specified, the tool shall, by
default, issue a message indicating the failure. There may be a
tool-specific command-line option to suppress this message. The contents and
format of this message can be tool-specific, but must include the following
information:
- The file name and line number of the assertion statement,
- The hierarchical name of the assertion, if it is labelled, or
the scope of the assertion if it is not labelled,
Simulation tools must also include the simulation run time at which the
assertion failed. The default severity of an assertion failure shall be
"error."
"If an assertion fails and an else clause is specified, the else clause may
include a system task to set the severity of the failure. These severity
system tasks, defined below, may also specify user-defined information, in
addition to the default failure information, to be displayed in the format
of $display. If the severity system task is executed at a time other than
when the assertion fails, such as having a delay in the else clause, the
default failure information in a simulation tool shall include the time at
which the system task is called. If the user wishes to print the actual
failure time, this information may be recorded and displayed
programmatically, as in:
time t;
always @(posedge clk)
if(state == REQ)
assert(req1 || req2)
else begin
t = $time;
#5 $error("assert failed at time %0t",t);
end
If the assertion fails at time 10, the error message will be printed at time
15, but the user-defined string printed will be "assert failed at time 10"."
thanks,
-Fitz
------------------------------------------------------
Tom Fitzpatrick
Director of Technical Marketing
Co-Design Automation, Inc.
------------------------------------------------------
Email: fitz@co-design.com Mobile: (978)337-7641
Tel: (978)448-8797 Fax: (561)594-3946
Web: www.co-design.com
www.superlog.org
------------------------------------------------------
SUPERLOG = Faster, Smarter Verilog
------------------------------------------------------
This archive was generated by hypermail 2b28 : Tue Apr 02 2002 - 08:07:26 PST