Subject: Re: [sv-ac] Question about reference to data defined in sequence.
From: dudani@us04.synopsys.com
Date: Wed Feb 05 2003 - 18:27:09 PST
Hi Adam,
Your solution is similar to John's, except that you are passing a
definition of sequence rather than a sequence expression. I think we can
make it work by defining formal arguments of templates to accept a
definition as well as an expression. With templates, arguments get
substituted, so you can parameterize any entity that, when substituted,
produces a legal statement.
Surrendra
At 05:07 PM 2/5/2003 -0600, you wrote:
>Hi John;
>
>
>Or how about this version which would allow the encapsulation I desire.
>
>The template has as an argument a sequence (check_seq) that will be called
>from
>within the template. When it is called, it passes in the dynamic data
>reference.
>
>
>// A user defined sequence...
> sequence check_data(data) = (data == fifo_out_data);
>
>// A standard template for use whereever.
> template tem(check_seq);
> ast: assert (fifo_push => ((int itsdata = fifo_in_data) [1:100]
> fifo_pop;
> [0] check_seq(itsdata)))
> else $error();
> endtemplate
>
>// Instantiate the template with the specific data checking sequence.
> tem my_tem(check_data);
>
>
>Or with more arguments:
>
> template tem(clk,
> fifo_push,
> fifo_in_data,
> fifo_pop,
> check_seq);
>
> ast: assert @(posedge clk)
> (fifo_push => ((int itsdata = fifo_in_data) [1:100] fifo_pop;
> [0] check_seq(itsdata)))
> else $error();
> endtemplate
>
>
> tem my_tem(clk, fifo_push, fifo_in_data, fifo_pop, check_seq);
>
>So what else could be parameterized?
> The maximum value in the range above? [1:100] - could it be [1:latency] ?
> The width of declared dynamic data? int itsdata - could it be [W-1:0]
> itsdata?
>
>
> Adam Krolnik
> Verification Mgr.
> LSI Logic Corp.
> Plano TX. 75074
>
>
**********************************************
Surrendra A. Dudani
Synopsys, Inc.
377 Simarano Drive
Suite 300
Marlboro, MA 01752
Tel: 508-263-8072
Fax: 508-263-8123
email: dudani@synopsys.com
**********************************************
This archive was generated by hypermail 2b28 : Wed Feb 05 2003 - 18:27:55 PST