Hi,
Trying to learn assertions here. I am trying to write an assertion to check- when ‘rst’ goes low, ‘out’ too goes low.
The waveform shows this is happening correctly. But still my assertion fails. Can anyone point where I am going wrong.
Here is my DUT-
module simpleadder (simpleadder_if dif);
//import uvm_pkg::*;
always @(posedge dif.sig_clock or dif.sig_rst == 1'b0) begin // active low rst
if (dif.sig_rst==1'b0)
begin
dif.sig_out <= 0;
dif.sig_en_o <= #1 0;
end
and the assertion that I wrote-
`include “bind_assertions.sv”
module adder_assertions(input logic clk,
input logic rst,
input logic [`LENGTH:0]out
);
//always@(posedge clk or rst == 1'b0)
always @(negedge rst)
begin
assert (out == 0) $display("running assertions");
else
begin
$error(" out should be zero at reset ");
$display ("out=%0d expected 0", out);
end
end
endmodule
The Error-
UVM_INFO small_seq.sv(17) @ 0: uvm_test_top.sa_env.sa_agent.sa_seqr@@sml_seq [SMALL SEQ] body called
UVM_INFO testbench.sv(29) @ 2000: reporter [id1] Reset applied
** Error: out should be zero at reset
Time: 20 ns Scope: simpleadder_tb_top.dut.adder_assertions_inst File: F:/STUFF/Adder/assertions/assertions.sv Line: 14
out=9 expected 0
UVM_INFO testbench.sv(31) @ 4000: reporter [id1] Reset released
Thanks,
Swastika