3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-25 11:26:22 +00:00
yosys/tests/arith_tree/arith_tree_42.ys
2026-05-18 13:44:40 +02:00

122 lines
2.6 KiB
Text

read_verilog <<EOT
module four_op_42(
input [3:0] a, b, c, d,
output [3:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -strategy 42
design -load postopt
select -assert-count 2 t:$fa
select -assert-count 1 t:$add
select -assert-count 2 t:$fa c:*emit_compressor_42* %i
select -assert-count 0 t:$fa c:*emit_compressor_32* %i
design -reset
read_verilog <<EOT
module four_op_fa(
input [3:0] a, b, c, d,
output [3:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -strategy fa
design -load postopt
select -assert-count 2 t:$fa
select -assert-count 1 t:$add
select -assert-count 0 t:$fa c:*emit_compressor_42* %i
select -assert-count 2 t:$fa c:*emit_compressor_32* %i
design -reset
read_verilog <<EOT
module eight_op_42(
input [3:0] a, b, c, d, e, f, g, h,
output [3:0] y
);
assign y = a + b + c + d + e + f + g + h;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -strategy 42
design -load postopt
select -assert-count 6 t:$fa
select -assert-count 1 t:$add
select -assert-min 1 t:$fa c:*emit_compressor_42* %i
design -reset
read_verilog <<EOT
module sixteen_op_42(
input [3:0] a0, a1, a2, a3, a4, a5, a6, a7,
input [3:0] a8, a9, a10, a11, a12, a13, a14, a15,
output [3:0] y
);
assign y = a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7
+ a8 + a9 + a10 + a11 + a12 + a13 + a14 + a15;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -strategy 42
design -load postopt
select -assert-count 14 t:$fa
select -assert-count 1 t:$add
select -assert-min 1 t:$fa c:*emit_compressor_42* %i
design -reset
read_verilog <<EOT
module five_op_42(
input [3:0] a, b, c, d, e,
output [3:0] y
);
assign y = a + b + c + d + e;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -strategy 42
design -load postopt
select -assert-count 3 t:$fa
select -assert-count 1 t:$add
select -assert-min 1 t:$fa c:*emit_compressor_42* %i
design -reset
read_verilog <<EOT
module six_op_42(
input [3:0] a, b, c, d, e, f,
output [3:0] y
);
assign y = a + b + c + d + e + f;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -strategy 42
design -load postopt
select -assert-count 4 t:$fa
select -assert-count 1 t:$add
select -assert-min 1 t:$fa c:*emit_compressor_42* %i
design -reset
read_verilog <<EOT
module seven_op_42(
input [3:0] a, b, c, d, e, f, g,
output [3:0] y
);
assign y = a + b + c + d + e + f + g;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -strategy 42
design -load postopt
select -assert-count 5 t:$fa
select -assert-count 1 t:$add
select -assert-min 1 t:$fa c:*emit_compressor_42* %i
design -reset