diff options
| author | Eddie Hung <eddie@fpgeh.com> | 2019-10-08 12:38:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-08 12:38:29 -0700 |
| commit | cfc181cba9837f42d9faa8ba9dbffbcede0ca84b (patch) | |
| tree | f3c6541c857e43cc856cc925f3aeea586fc8f262 /tests/various | |
| parent | 4c89a4e642c8618a0e18270d338e48599834d923 (diff) | |
| parent | 045f34403889b69f3ac3ac08d96e5cf1fae787d1 (diff) | |
| download | yosys-cfc181cba9837f42d9faa8ba9dbffbcede0ca84b.tar.gz yosys-cfc181cba9837f42d9faa8ba9dbffbcede0ca84b.tar.bz2 yosys-cfc181cba9837f42d9faa8ba9dbffbcede0ca84b.zip | |
Merge pull request #1432 from YosysHQ/eddie/fix1427
Refactor peepopt_dffmux and be sensitive to \init when trimming
Diffstat (limited to 'tests/various')
| -rw-r--r-- | tests/various/peepopt.ys | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/tests/various/peepopt.ys b/tests/various/peepopt.ys index 6bca62e2b..ee5ad8a1a 100644 --- a/tests/various/peepopt.ys +++ b/tests/various/peepopt.ys @@ -131,8 +131,8 @@ EOT proc equiv_opt -assert peepopt design -load postopt -select -assert-count 1 t:$dff r:WIDTH=5 %i -select -assert-count 1 t:$mux r:WIDTH=5 %i +select -assert-count 1 t:$dff r:WIDTH=4 %i +select -assert-count 1 t:$mux r:WIDTH=4 %i select -assert-count 0 t:$dff t:$mux %% t:* %D #################### @@ -173,3 +173,41 @@ select -assert-count 1 t:$dff r:WIDTH=2 %i select -assert-count 2 t:$mux select -assert-count 2 t:$mux r:WIDTH=2 %i select -assert-count 0 t:$logic_not t:$dff t:$mux %% t:* %D + +#################### + +design -reset +read_verilog <<EOT +module peepopt_dffmuxext_signed_rst_init(input clk, ce, rstn, input signed [1:0] i, output reg signed [3:0] o); + initial o <= 4'b0010; + always @(posedge clk) begin + if (ce) o <= i; + if (!rstn) o <= 4'b1111; + end +endmodule +EOT + +proc +# NB: equiv_opt uses equiv_induct which covers +# only the induction half of temporal induction +# --- missing the base-case half +# This makes it akin to `sat -tempinduct-inductonly` +# instead of `sat -tempinduct-baseonly` or +# `sat -tempinduct` which is necessary for this +# testcase +#equiv_opt -assert peepopt + +design -save gold +peepopt +wreduce +design -stash gate +design -import gold -as gold +design -import gate -as gate +miter -equiv -flatten -make_assert -make_outputs gold gate miter +sat -tempinduct -verify -prove-asserts -show-ports miter + +design -load gate +select -assert-count 1 t:$dff r:WIDTH=4 %i +select -assert-count 2 t:$mux +select -assert-count 2 t:$mux r:WIDTH=4 %i +select -assert-count 0 t:$logic_not t:$dff t:$mux %% t:* %D |
