Subject: Re: [sv-ac] $display in assertions
From: Surrendra Dudani (Surrendra.Dudani@synopsys.com)
Date: Fri Sep 12 2003 - 06:33:47 PDT
I think this can be accomplished by making a function call and hiding all
the actions in the function such as $display. All the needed values for
display can be passed to the function. Function calls are already allowed
in the syntax. Will this work?
Surrendra
At 08:30 PM 9/11/2003 -0500, you wrote:
>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
**********************************************
Surrendra A. Dudani
Synopsys, Inc.
377 Simarano Drive, Suite 300
Marlboro, MA 01752
Tel: 508-263-8072
Fax: 508-263-8123
email: Surrendra.Dudani@synopsys.com
**********************************************
This archive was generated by hypermail 2b28 : Fri Sep 12 2003 - 06:34:21 PDT