Made timer synthesizable
This commit is contained in:
@@ -17,9 +17,7 @@ module formal_wb_timer;
|
|||||||
|
|
||||||
assign i_wb_rst = 1'b0;
|
assign i_wb_rst = 1'b0;
|
||||||
|
|
||||||
wb_countdown_timer #(
|
wb_countdown_timer dut (
|
||||||
.FORMAL(1)
|
|
||||||
) dut (
|
|
||||||
.i_clk(i_clk),
|
.i_clk(i_clk),
|
||||||
.i_rst(i_rst),
|
.i_rst(i_rst),
|
||||||
.o_irq(o_irq),
|
.o_irq(o_irq),
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
`timescale 1ns/1ps
|
`timescale 1ns/1ps
|
||||||
|
|
||||||
module wb_countdown_timer #(
|
module wb_countdown_timer #(
|
||||||
parameter address = 32'h00000000, // Base address of peripheral
|
parameter address = 32'h00000000 // Base address of peripheral
|
||||||
parameter FORMAL = 0
|
|
||||||
)(
|
)(
|
||||||
input wire i_clk,
|
input wire i_clk,
|
||||||
input wire i_rst,
|
input wire i_rst,
|
||||||
@@ -98,8 +97,8 @@ module wb_countdown_timer #(
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
`ifdef FORMAL
|
||||||
// Formal verification
|
// Formal verification
|
||||||
if(FORMAL) begin
|
|
||||||
reg f_past_valid = 1'b0;
|
reg f_past_valid = 1'b0;
|
||||||
wire cnt_write = i_wb_cyc && i_wb_stb && i_wb_we && (i_wb_adr[3:0] == 4'h0);
|
wire cnt_write = i_wb_cyc && i_wb_stb && i_wb_we && (i_wb_adr[3:0] == 4'h0);
|
||||||
wire pld_write = i_wb_cyc && i_wb_stb && i_wb_we && (i_wb_adr[3:0] == 4'h4);
|
wire pld_write = i_wb_cyc && i_wb_stb && i_wb_we && (i_wb_adr[3:0] == 4'h4);
|
||||||
@@ -183,6 +182,6 @@ module wb_countdown_timer #(
|
|||||||
C6: cover(f_past_valid && $past(!i_rst) && $past(irq_fired) && !irq_fired && $past(ack_write));
|
C6: cover(f_past_valid && $past(!i_rst) && $past(irq_fired) && !irq_fired && $past(ack_write));
|
||||||
|
|
||||||
end
|
end
|
||||||
end;
|
`endif
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|||||||
@@ -45,9 +45,14 @@ targets:
|
|||||||
toplevel: formal_wb_timer
|
toplevel: formal_wb_timer
|
||||||
parameters:
|
parameters:
|
||||||
- address
|
- address
|
||||||
|
- FORMAL=true
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
address:
|
address:
|
||||||
datatype: int
|
datatype: int
|
||||||
description: Base address of register set
|
description: Base address of register set
|
||||||
paramtype: vlogparam
|
paramtype: vlogparam
|
||||||
|
FORMAL:
|
||||||
|
datatype: bool
|
||||||
|
description: Enable in-module formal-only logic
|
||||||
|
paramtype: vlogdefine
|
||||||
|
|||||||
Reference in New Issue
Block a user