Subject: Re: [sv-ac] example of variables accessed in error message.
From: Adam Krolnik (krolnik@lsil.com)
Date: Fri Oct 24 2003 - 13:43:05 PDT
Good afternoon;
As an example of variables in use for errors, consider these examples.
I made up the syntax of the error message with the property.
(From the summary message.)
Here I use local variables available for use in a simple expression.
property follow_req(a, b, c, address)
reg [31:0] req_addr;
@(posedge clk)
(a, (req_addr = address) => b ##1 c)
or // If property fails, report error message and local variable value.
$error("C (%0d) did not follow b after a with address %0h.\n", c, req_addr);
endproperty
assert follow_req(a, b, c, address); // Error message in side property definition.
One can construct more compex sequences where variables contain values
and don't contain values.
I would think we could extend the variable assigment section to allow
$display() for debugging, e.g.
$first_match(a ##[1:10] b), (b_val = data, $display($stime, " b_val is %0h", b_val))
=> ##[1:100] c, (b_val == c_data)
or $error("Bad data sent; started with %0h, ended with %0h.", b_val, c_data);
...
Note, I use "or" to mean the property should succeed, otherwise we should produce
the error message. One would also want a "and" ability to mean the property
should succeed and if so, should produce the message. Presuming the message
is something about a specific coverage point that one wanted to see.
THanks.
Adam Krolnik
Verification Mgr.
LSI Logic Corp.
Plano TX. 75074
Co-author "Assertion Based Design"
This archive was generated by hypermail 2b28 : Fri Oct 24 2003 - 13:43:53 PDT