mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 09:55:20 +00:00
opt_merge: fix trivial binary regression
This commit is contained in:
parent
8903740147
commit
176faae7c9
|
@ -95,7 +95,6 @@ struct OptMergeWorker
|
||||||
};
|
};
|
||||||
std::sort(inputs.begin(), inputs.end());
|
std::sort(inputs.begin(), inputs.end());
|
||||||
h = hash_ops<std::array<RTLIL::SigSpec, 2>>::hash_into(inputs, h);
|
h = hash_ops<std::array<RTLIL::SigSpec, 2>>::hash_into(inputs, h);
|
||||||
h = assign_map(cell->getPort(ID::Y)).hash_into(h);
|
|
||||||
} else if (cell->type.in(ID($reduce_xor), ID($reduce_xnor))) {
|
} else if (cell->type.in(ID($reduce_xor), ID($reduce_xnor))) {
|
||||||
SigSpec a = assign_map(cell->getPort(ID::A));
|
SigSpec a = assign_map(cell->getPort(ID::A));
|
||||||
a.sort();
|
a.sort();
|
||||||
|
|
13
tests/opt/opt_merge_basic.ys
Normal file
13
tests/opt/opt_merge_basic.ys
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
read_verilog -icells <<EOT
|
||||||
|
module top(A, B, X, Y);
|
||||||
|
input [8:0] A, B;
|
||||||
|
output [8:0] X, Y;
|
||||||
|
assign X = A + B;
|
||||||
|
assign Y = A + B;
|
||||||
|
endmodule
|
||||||
|
EOT
|
||||||
|
|
||||||
|
select -assert-count 2 t:$add
|
||||||
|
equiv_opt -assert opt_merge
|
||||||
|
design -load postopt
|
||||||
|
select -assert-count 1 t:$add
|
Loading…
Reference in a new issue