Subject: [sv-ac] $display in assertions
From: John Havlicek (john.havlicek@motorola.com)
Date: Thu Sep 11 2003 - 18:30:01 PDT
Folks:
I have been thinking about Adam's request for reference
to local variables in the action block, and I don't see
a good solution.
In CBV we allow various things like $display to be coded right
into the assertion. In CBV you can say
if (req)
begin
local my_req_tag[3:0] = req_tag;
if +(0 to `TIME_LIMIT) : ~(resp & (resp_tag == my_req_tag))
begin
0; // fail
$display("Error(time %d): no response within time_limit %d on tag %h\n",
cbv_time, `TIME_LIMIT, my_req_tag);
end
end
Then we get the $display for every failing thread.
Why can't we do this in SVA?
If we approve the proposal on nesting and boolean connectives,
then this will be easy to achieve by simply allowing $display
as a property that is equivalent to "1'b1" in terms of assertion
pass/fail. Then the CBV above could be coded as
my_req_tag[3:0];
...
(req, my_req_tag = req_tag)
|->
(
~(resp & (resp_tag == my_req_tag))[*`TIME_LIMIT]
|->
(
1'b0 // fail
and
$display("Error(time %d): no response within time_limit %d on tag %h\n",
????, `TIME_LIMIT, my_req_tag);
)
);
I have put ???? because I don't know how SV provides simulation time
(if it does at all), but this is a minor point.
What do people think?
Being able to do a "printf" style display of local variables is
absolutely essential for debugging and failure analysis. I do not
know how to solve this problem with the action block. Why don't we
just allow $display in the assertions?
Anticipating comments,
John Havlicek
This archive was generated by hypermail 2b28 : Thu Sep 11 2003 - 18:30:33 PDT