In reply to rachel.greenlee:
You could use supporting logic to add a “ready” signal, and use that in the antecedent.
Thus:
bit ready;
initial begin
repeat(10) @(posedge clk);
ready <= 1'b1;
end
a_incr_cntrs_enabled_check: assert property (ready |-> incr_cntrs_enabled_check) else $error($time, "Counters incremented when disabled. Cnt: %h", counter[i]);
On you assertion, I have several comments:
- the way I read it, you basically state (ignoring the reset disable):
There should never be the case when counter[i] is not 0 and it is not enabled. - If this is really what you want to say, you should be using the “not” instead of the “!”
- Your assertion, the way you wrote DOES NOT fulfill your requirements of
Assertion - counters should only be incremented when enabled
Instead of:
// Assertion - counters should only be incremented when enabled
property incr_cntrs_enabled_check;
@ (posedge clk)
disable iff(reset) (!(counter[i] != 12'b0 && i_enable_cntrs == 1'b0));
endproperty
USE
// Assertion - counters should only be incremented when enabled
property incr_cntrs_enabled_check;
@ (posedge clk)
disable iff(reset) ready && i_enable_cntrs == 1'b0 |=> $stable(counter[i]);
endproperty
property incr_cntrs_enabled_check2;
@ (posedge clk)
disable iff(reset) ready && i_enable_cntrs == 1'b1 |=> counter[i]== counter[i] + 1'b1;
endproperty
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr
- SVA Handbook 4th Edition, 2016 ISBN 978-1518681448
- A Pragmatic Approach to VMM Adoption 2006 ISBN 0-9705394-9-5
- Using PSL/SUGAR for Formal and Dynamic Verification 2nd Edition, 2004, ISBN 0-9705394-6-0
- Real Chip Design and Verification Using Verilog and VHDL, 2002 isbn 978-1539769712
- Component Design by Example ", 2001 ISBN 0-9705394-0-1
- VHDL Coding Styles and Methodologies, 2nd Edition, 1999 ISBN 0-7923-8474-1
- VHDL Answers to Frequently Asked Questions, 2nd Edition ISBN 0-7923-8115