In reply to VerifEx:
How can you allow an SVA occur only once before checking again?
If I have assertion A and it takes 5 clocks to check, how can I make sure that during those 5 clocks assertion A will not get trigged?
The following code is a slight variation from my “dictionary” of assertions chapter in my SVA Handbook 4th Edition, 2016 ISBN 978-1518681448
The idea is to set a flag in the antecedent when the property is triggered. At the end of the assertion, with a pass or a fail, the flag is reset. You can decide if you want to reset that flag if the assertion fails; that depends upon your requirements. In this example, I have 2 assertions: ! to check that if sof, then within 5 clocks you get eof. The other detects that during that time no other sof is initiated. BTW, that 1st assertion wil not retrigger because of that flag (the busy_sof).
module thruout2;// /ch10/10.27/thruout2.sv
bit clk, sof, eof;
bit busy_sof;
default clocking @(posedge clk); endclocking
function void setval4busy(bit d);
busy_sof=d;
endfunction
// This is not catching multiple sof's and one eof within valid.
// It should check that for one sof, there should be only one eof.
ap_sof_eof: assert property(
// Once antecedent fires, no other one will fire again
(sof && busy_sof==1'b0, setval4busy(1'b1)) |->
##[1:5] (eof)) setval4busy(1'b0); // reset flag if property is true
else setval4busy(1'b0); // reset flag if property is false
ap_neversof_when_busy: assert property(not(sof && busy_sof));
endmodule
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
- 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