Re: [sv-ac] Question about reference to data defined in sequence.


Subject: Re: [sv-ac] Question about reference to data defined in sequence.
From: John Havlicek (john.havlicek@motorola.com)
Date: Wed Feb 05 2003 - 14:47:40 PST


Hi All:

> This is an example about the question Erich raised in the previous meeting...
>
>
> // Define sequence to compare data out of fifo with captured data from assertion.
> // Can I do this?
> sequence check_data = (tem.ast.itsdata == fifo_out_data);
>
> // Template to check
> template tem(check_seq);
> ast: assert (fifo_push => ((int itsdata = fifo_in_data) [1:100] fifo_pop;
> [0] check_seq))
> else $error();
> endtemplate
>
> I want to reference the dynamic 'itsdata' for use in my sequence I pass into
> the template.

I do not understand clearly the parameter passing/binding mechanisms
for SVA. In 11.11, the arguments of a template_instantiation are
characterized as "list_of_port_connections". Assuming that a sequence
parameter to a template is legal, I wonder if something like the following
should work?

   sequence check_data(data) = (data == fifo_out_data);

   template tem(check_seq);
       ast: assert (fifo_push => ((int itsdata = fifo_in_data) [1:100] fifo_pop;
                                  [0] check_seq))
         else $error();
   endtemplate

   tem my_tem(check_data(itsdata));

Alternatively, if sequence parameters to templates are illegal, does the
following work?

   sequence check_data(data) = (data == fifo_out_data);

   template tem;
       ast: assert (fifo_push => ((int itsdata = fifo_in_data) [1:100] fifo_pop;
                                  [0] check_data(itsdata)))
         else $error();
   endtemplate

   tem my_tem();

Best regards,

John Havlicek



This archive was generated by hypermail 2b28 : Wed Feb 05 2003 - 14:49:37 PST