In reply to Rohi_417:
Multiple smaller assertions is a preferred approach here.
// Requirements:
// 1.After REQ assert, ACK has to be asserted in 1~10 clk cycle
ap_req2ack: assert property(
@(posedge clk) $rose(req) |-> ##[1:10] $rose(ack) );
// 2.REQ should stay high for 5~7 clk cycles before goes low
ap_reqHi: assert property(
@(posedge clk) $rose(req) |-> req[*5:7]);
//3.After ACK assert, REQ has to be de-asserted in 1~10 clk cycle
ap_ack2req: assert property(
@(posedge clk) $rose(req) |-> $rose(ack) [->1]
##[1:10] $fell(req) );
There are some bugs in the task solution (it was not tested).
Will post an update, as the task approach showed errors when compared to the SVA solution.
And that proves that SVA is preferred, with few exceptions as explained in my paper.
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
- Real Chip Design and Verification Using Verilog and VHDL, 2002 isbn 978-1539769712
- 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
- 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