I would like to know how I can change a value of an internal signal and propagate this modification. I have a counter and in the third cycle of simulation, where cnt(internal signal) takes 3 I have forced it to 0 for two cycles. the problem I found is after these two cycles, the cnt takes 5 and not 1
add_force cnt_o 0 -after 400us [two cycles] .
do you have a solution how I can fix this problem? note: it is for fault attack simulation
always_ff @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
cnt_q <= 0;
end else begin
cnt_q = cnt_q + 1;
end
end
assign cnt_o = cnt_q
test_bench :
logic [32 : 0] cnt;
logic clk;
logic rst_n;
counter test (.clk, .rst_n, .cnt_o(cnt) )
initial begin
clk = 0;
rst_n = 1;
end
always begin
clk = ~clk ;
end