[sv-ac] function with side effect use in assertion

From: Daniel Mlynek <danielm@aldec.com.pl>
Date: Wed Jan 26 2011 - 03:21:06 PST

I have doubts about below LRM statement. I'm not sure is "shall" used
here means that non-automatic function should trigger an error or does
it only mean that this is not good idea to use such functions in assertion
Expressions are allowed to include function calls, but the following
semantic restrictions are imposed:
--- Functions that appear in expressions shall not contain output or ref
arguments (const ref is
allowed).
--- Functions shall be automatic (or preserve no state information) and
have no side effects.

Summarizing my question is - is below code legal or not:?

module top;
     int k,l;
     function int func1();
         $display(k,l);
         k++;l++;
         return k;
     endfunction

     property p1;
         @(posedge clk) func1()!=3; //func1 has side effect and is not
automatic
     endproperty

     as1:assert property(p1);

     bit clk;
     initial repeat(10) #5 clk=~clk;
endmodule

DANiel

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Jan 26 03:21:07 2011

This archive was generated by hypermail 2.1.8 : Wed Jan 26 2011 - 03:21:27 PST