[sv-ac] 2005

From: Bustan, Doron <doron.bustan_at_.....>
Date: Sun Sep 16 2007 - 05:43:26 PDT
Hi Erik,

 

I have a question about assertions in functions:

Let's look at the example below:

 

------------------------------------------------------------------------
--

module m(input clk1, clk2, i1, i2);

bit b;

 

function automatic bit test_1(bit x, y);

   test_1  = (x == y);

  a1: assert property (@(posedge clk1) x == y);

endfunction

 

always @ (posedge clk2) b <= test_1(i1, i2);

 

endmodule

------------------------------------------------------------------------
--

 

The assertion a1 is clocked on "posedge clk1" but the function is called
on "posedge clk2".

Since there is no "ref" on the function's port list, the arguments
values are passed by value.

This means, that a1 "see" the values of "i1, i2" on "posedge clk2". It
that your intent?

It looks like the clocking event in the assertion is misleading. Maybe
we should restrict the 

Clocking event to be inferred from the context of the function call?

 

Doron

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sun Sep 16 05:43:51 2007

This archive was generated by hypermail 2.1.8 : Sun Sep 16 2007 - 05:44:16 PDT