yosys/tests/csa_tree/csa_tree_alu_macc_equiv.ys

108 lines
1.7 KiB
Plaintext
Raw Normal View History

2026-03-19 17:45:56 +01:00
read_verilog <<EOT
2026-04-01 18:40:51 +02:00
module equiv_macc_add3(
2026-03-19 17:45:56 +01:00
input [3:0] a, b, c,
output [3:0] y
);
assign y = a + b + c;
endmodule
EOT
hierarchy -auto-top
proc
alumacc
2026-04-01 18:40:51 +02:00
opt
2026-03-19 17:45:56 +01:00
equiv_opt csa_tree
design -load postopt
select -assert-count 1 t:$fa
select -assert-count 1 t:$add
design -reset
read_verilog <<EOT
2026-04-01 18:40:51 +02:00
module equiv_macc_add4(
2026-03-19 17:45:56 +01:00
input [3:0] a, b, c, d,
output [3:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
alumacc
2026-04-01 18:40:51 +02:00
opt
2026-03-19 17:45:56 +01:00
equiv_opt csa_tree
design -load postopt
select -assert-count 2 t:$fa
select -assert-count 1 t:$add
design -reset
read_verilog <<EOT
2026-04-01 18:40:51 +02:00
module equiv_macc_add8(
2026-03-19 17:45:56 +01:00
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
alumacc
2026-04-01 18:40:51 +02:00
opt
2026-03-19 17:45:56 +01:00
equiv_opt csa_tree
design -load postopt
select -assert-count 6 t:$fa
select -assert-count 1 t:$add
design -reset
read_verilog <<EOT
2026-04-01 18:40:51 +02:00
module equiv_macc_signed(
2026-03-19 17:45:56 +01:00
input signed [3:0] a, b, c, d,
output signed [5:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
alumacc
2026-04-01 18:40:51 +02:00
opt
2026-03-19 17:45:56 +01:00
equiv_opt csa_tree
design -load postopt
select -assert-count 2 t:$fa
select -assert-count 1 t:$add
design -reset
read_verilog <<EOT
2026-04-01 18:40:51 +02:00
module equiv_macc_sub_mixed(
2026-03-19 17:45:56 +01:00
input [3:0] a, b, c, d,
output [3:0] y
);
assign y = a + b - c + d;
endmodule
EOT
hierarchy -auto-top
proc
alumacc
2026-04-01 18:40:51 +02:00
opt
2026-03-19 17:45:56 +01:00
equiv_opt csa_tree
design -load postopt
select -assert-min 1 t:$fa
select -assert-count 1 t:$add
design -reset
read_verilog <<EOT
2026-04-01 18:40:51 +02:00
module equiv_macc_sub_all(
2026-03-19 17:45:56 +01:00
input [3:0] a, b, c, d,
output [3:0] y
);
assign y = a - b - c - d;
endmodule
EOT
hierarchy -auto-top
proc
alumacc
2026-03-27 16:14:07 +01:00
opt
equiv_opt csa_tree
design -load postopt
select -assert-min 1 t:$fa
select -assert-count 1 t:$add
design -reset