3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-08-04 21:33:35 +00:00
yosys/tests/alumacc/cmp_merge.ys
2026-07-31 16:59:57 +12:00

43 lines
694 B
Text

read_verilog <<EOT
module top(...);
input [7:0] ra;
input [7:0] rb;
output gt;
output sgt;
output lt;
output slt;
output ge;
output eq;
output seq;
output ne;
assign gt = ra > rb;
assign sgt = $signed(ra) > $signed(rb);
assign lt = ra < rb;
assign slt = $signed(ra) < $signed(rb);
assign ge = ra >= rb;
assign eq = ra == rb;
assign seq = $signed(ra) == $signed(rb);
assign ne = ra != rb;
endmodule
EOT
equiv_opt -assert alumacc
design -load postopt
select -assert-count 1 t:$alu
design -reset
read_verilog << EOT
module top(input signed a, b, output x, output [1:0] y);
assign y = $unsigned(a) - $unsigned(b);
assign x = a > b;
endmodule
EOT
hierarchy
wreduce
equiv_opt -assert alumacc