If a function called in an always_comb reads a global variable, that variable is on the implicit sensitivity list of the always_comb.
http://bradpierce.wordpress.com/2009/12/04/sv-always_comb-safer-than-verilog-assign/
-- Brad
From: owner-sv-ac@eda.org [mailto:owner-sv-ac@eda.org] On Behalf Of ben cohen
Sent: Wednesday, November 02, 2011 4:11 PM
To: Prabhakar, Anupam
Cc: Kulshrestha, Manisha; sv-ac@eda-stds.org
Subject: Re: [sv-ac] updated proposal for 3564
3564 states "always_comb is sensitive to expressions in immediate assertions within the procedure and within the contents of a function called in the procedure"
The content of the function gas a "d", thus from this, am I wrong in concluding that the always_comb is also sensitive to "d"?
Am I missing something here, or am I reading it wrong?
always_comb begin
m= w || f(q, g);
ap_m: assert (m);
// m and ap_m are sensitive to q, g, w, d
end
On Wed, Nov 2, 2011 at 2:42 PM, Prabhakar, Anupam <anupam_prabhakar@mentor.com<mailto:anupam_prabhakar@mentor.com>> wrote:
Hi Ben,
It is the always_comb or always @* block which wakes up based on the sensitivity (and not individual statements separately) so your always @* will be sensitive to only q, g, and w. Both the statements below will be executed when always @* wakes up.
always @* begin
m2= w || f(q, g);
ap_me: assert(m2);
end
Anupam
From: owner-sv-ac@eda.org<mailto:owner-sv-ac@eda.org> [mailto:owner-sv-ac@eda.org<mailto:owner-sv-ac@eda.org>] On Behalf Of ben cohen
Sent: Wednesday, November 02, 2011 2:15 PM
To: Kulshrestha, Manisha; sv-ac@eda-stds.org<mailto:sv-ac@eda-stds.org>
Subject: Re: [sv-ac] updated proposal for 3564
Manisha,
A quick question: Are my comments about sensitivity correct?
module m;
// always_comb is sensitive to expressions in
// immediate assertions within the procedure and within the contents
// of a function called in the procedure,
// whereas always @* is sensitive to expressions in immediate assertions
// within the procedure only.
//
logic m, m2, d, q, g, w;
function logic f(logic a, b);
logic c;
c = d && a;
return (c || b);
endfunction : f
always_comb begin
m= w || f(q, g);
ap_m: assert (m);
// m and ap_m are sensitive to q, g, w, d
end
always @* begin
m2= w || f(q, g);
ap_me: assert(m2);
// m2 is sensitive to q, g, w,
// NOT sensitive to d
// ap_m2 sensitive to q, g, w, d
end
endmodule :m
On Wed, Nov 2, 2011 at 5:33 AM, Kulshrestha, Manisha <Manisha_Kulshrestha@mentor.com<mailto:Manisha_Kulshrestha@mentor.com>> wrote:
Hi Dimitry,
I have uploaded the updated proposal. Please call a vote for it.
Thanks.
Manisha
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner<http://www.mailscanner.info/>, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner<http://www.mailscanner.info/>, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner<http://www.mailscanner.info/>, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Nov 2 16:19:20 2011
This archive was generated by hypermail 2.1.8 : Wed Nov 02 2011 - 16:19:24 PDT