In reply to SriGanesh D:
The correct concepts, coding errors.
Also, use realtime.
// Code your testbench here
// or browse Examples
module tb();
bit clk;
always #5 clk++;
property clk_period;
realtime clk_time, temp;
(1,temp = $realtime) |=> (1,clk_time = ($realtime - temp)) ##0 (1,print_time(clk_time));
endproperty
function bit print_time(input time t);
$display("Clock_period:-%0t",t);
return 1;
endfunction
assert property(@(posedge clk)clk_period) $display("Assertion Passed");
else $display("Assertion Failed");
initial
#100 $finish;
initial begin
$dumpfile("dump.vcd"); $dumpvars;
end
endmodule
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact http://cvcblr.com/home
** SVA Handbook 4th Edition, 2016 ISBN 978-1518681448
…
- SVA Package: Dynamic and range delays and repeats SVA: Package for dynamic and range delays and repeats - SystemVerilog - Verification Academy
- Free books: Component Design by Example https://rb.gy/9tcbhl
Real Chip Design and Verification Using Verilog and VHDL($3) https://rb.gy/cwy7nb - Papers:
- SVA Alternative for Complex Assertions
https://verificationacademy.com/news/verification-horizons-march-2018-issue - SVA in a UVM Class-based Environment
https://verificationacademy.com/verification-horizons/february-2013-volume-9-issue-1/SVA-in-a-UVM-Class-based-Environment - Understanding the SVA Engine,
Verification Horizons