Subject: Re: [sv-ac] $display in assertions
From: John Havlicek (john.havlicek@motorola.com)
Date: Fri Sep 12 2003 - 13:20:07 PDT
Surrendra:
Very interesting. That would clean up the redundancy in
<bad sequence>
|->
(
1'b0
and
$display(<whatever>)
)
reducing it to
<bad sequence>
|->
$error(<whatever>)
J.H.
>
> Another possibility is to modify $info,$warning,$error,$fatal as system
> functions returning values as:
> $fatal, $error return 0
> $info, $warning return 1
>
> So, these functions can be used as predicates as well as printing
> functions. These functions have the same capability as $display.
> Surrendra
> At 10:28 AM 9/12/2003 -0500, you wrote:
> >Surrendra:
> >
> >Are you thinking of a general-purpose function?
> >It would be annoying to have to code a special function
> >for each $display I want to get.
> >
> >Can you show an example of how to code the function and
> >how to write the function call in the assertion?
> >I don't understand your idea well enough to do this
> >myself.
> >
> >Thanks,
> >
> >John H.
> >
> > > X-Sender: dudani@us04.synopsys.com
> > > Date: Fri, 12 Sep 2003 09:33:47 -0400
> > > From: Surrendra Dudani<Surrendra.Dudani@synopsys.com>
> > > Sender: owner-sv-ac@eda.org
> > > Precedence: bulk
> > >
> > > 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
> > > **********************************************
>
>
>
> **********************************************
> 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 - 13:20:41 PDT