In reply to Bhaskar44:
In reply to ben@SystemVerilog.us:
However, I can’t use clk in my assertions module as it is a system clock and I am just checking the functionality of a an individual module of the DUT…
The DUT runs on the system clock, and assertions are written in a separate module and is bound to the DUT using the “bind” construct.
I fail to understand why you can’t use the DUT clk in the bind. The bind is like instantiating a module (or a checker) inside the DUT; thus, the clock can be passed as an actual argument.
So, I would have to approach this issue differently and help is much appreciated.
See if you can get access to the clock with the bind.
If you still can’t, and you must use a signal as the clocking event, then in your verification module you need to generate a secondary clock based on that event. For example:
bit a, b, c, a_chk;
// a, b, c, are clocked at posedge clk.
// clk period > 5 (in this example)
always @(a) begin
#5 a_chk <= a;
end
apa_b: assert property(
@(negedge a) |-> @(negedge a_chk) b );
// b is sampled delta time before negedge a_chk,
// but b has now settled in value
The above is quirky. I strongly recommend that you gain access to the system clock with the bind.
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