* Remove unused SVA properties file * Makefile optimizations * Use prep auto-top option to prevent error with not founded top-level module when using generics * Add some simple PSL assertionsmaster
@ -1,7 +1,11 @@ | |||
.PHONY: counter | |||
counter: counter.vhd counter_t.sv counter_f.sby | |||
sby -f -d work counter_f.sby | |||
DUT := counter | |||
.PHONY: cover bmc prove all clean | |||
all: cover bmc prove | |||
cover bmc prove: ${DUT}.vhd symbiyosys.sby | |||
sby --yosys "yosys -m ghdl" -f -d work/${DUT}-$@ symbiyosys.sby $@ | |||
.PHONY: clean | |||
clean: | |||
rm -rf work |
@ -1,17 +0,0 @@ | |||
[options] | |||
mode prove | |||
depth 30 | |||
wait on | |||
[engines] | |||
smtbmc | |||
abc pdr | |||
[script] | |||
verific -vhdl counter.vhd | |||
verific -formal counter_t.sv | |||
prep -top counter_t | |||
[files] | |||
counter.vhd | |||
counter_t.sv |
@ -1,61 +0,0 @@ | |||
module counter_t ( | |||
input Reset_n_i, | |||
input Clk_i, | |||
output [31:0] Data_o | |||
); | |||
`define INITVAL 8 | |||
`define ENDVAL 64 | |||
counter #( | |||
.InitVal(`INITVAL), | |||
.EndVal(`ENDVAL) | |||
) counter_i ( | |||
.Reset_n_i(Reset_n_i), | |||
.Clk_i(Clk_i), | |||
.Data_o(Data_o) | |||
); | |||
reg init_state = 1; | |||
(* gclk *) wire gbl_clk; | |||
// Initial reset | |||
always @(*) begin | |||
if (init_state) assume (!Reset_n_i); | |||
if (!init_state) assume (Reset_n_i); | |||
end | |||
always @(posedge Clk_i) | |||
init_state = 0; | |||
// Generate global clock | |||
global clocking | |||
@(posedge gbl_clk); | |||
endclocking | |||
// Use global clock to constrain the DUT clock | |||
always @($global_clock) begin | |||
assume (Clk_i != $past(Clk_i)); | |||
end | |||
default clocking | |||
@(posedge Clk_i); | |||
endclocking | |||
default disable iff (!Reset_n_i); | |||
// Immediate assertions | |||
always @(*) | |||
if (!Reset_n_i) assert (Data_o == `INITVAL); | |||
// Concurrent assertions | |||
assert property (Data_o < `ENDVAL |=> Data_o == $past(Data_o) + 1); | |||
assert property (Data_o == `ENDVAL |=> $stable(Data_o)); | |||
assert property (Data_o >= `INITVAL && Data_o <= `ENDVAL); | |||
endmodule | |||
@ -0,0 +1,22 @@ | |||
[tasks] | |||
cover | |||
bmc | |||
prove | |||
[options] | |||
depth 25 | |||
cover: mode cover | |||
bmc: mode bmc | |||
prove: mode prove | |||
[engines] | |||
cover: smtbmc z3 | |||
bmc: smtbmc z3 | |||
prove: smtbmc z3 | |||
[script] | |||
ghdl --std=08 -fpsl counter.vhd -e counter | |||
prep -auto-top | |||
[files] | |||
counter.vhd |