Skip to content

Unexpected behaviour with asynchronous reset #255

@mpardalos

Description

@mpardalos

I am attempting to verify a module with an asynchronous reset, and sby is giving me a counterexample trace that does not seem to match with what I get when simulating with icarus verilog.

counter.sv

module counter(input clk, input rst, output reg [7:0] count);
   always @(posedge clk or posedge rst) begin
      if (rst)
        count <= 0;
      else
        count <= count + 1;
   end

   assert property (@(posedge rst) count == 0);
endmodule // counter

counter.sby

[options]
mode prove

[engines]
smtbmc

[script]
read -formal counter.sv
prep -top counter

[files]
counter.sv

The symbiyosys trace: trace.vcd.gz

I would expect the rst signal to always reset the counter, but the trace from sby shows it having no effect when an rst and clk edge arrive at the same time. Attempting to replicate this in simulation (using icarus verilog) shows rst behaving as expected (resetting the counter) rather that what sby shows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions