Skip to content

Instantly share code, notes, and snippets.

@olofk
Last active October 24, 2018 12:18
Show Gist options
  • Save olofk/1850f1e9d2c0e475c4c184731b7d5b92 to your computer and use it in GitHub Desktop.
Save olofk/1850f1e9d2c0e475c4c184731b7d5b92 to your computer and use it in GitHub Desktop.
[options]
mode prove
depth 10
[engines]
smtbmc
[script]
read_verilog -formal ror.v
prep -top ror
[files]
ror.v
`default_nettype none
module ror
(
input clk,
output reg [LEN-1:0] q = 'd1);
parameter LEN = 4;
always @(posedge clk)
q <= {q[0], q[LEN-1:1]};
`ifdef FORMAL
reg [LEN-1:0] qvalid = 'd0;
always @(posedge clk) begin
qvalid <= {1'b1, qvalid[LEN-1:1]};
cover(&(qvalid));
if (&(qvalid))
assert (q == $past(q, LEN));
end
`endif
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment