yosys/tests/arith_tree/arith_tree_idempotent.ys

47 lines
821 B
Plaintext
Raw Permalink Normal View History

2026-03-18 12:36:31 +01:00
read_verilog <<EOT
module add8(
input [15:0] a, b, c, d, e, f, g, h,
output [15:0] y
);
assign y = a + b + c + d + e + f + g + h;
endmodule
EOT
2026-03-13 13:22:24 +01:00
hierarchy -auto-top
2026-03-18 12:36:31 +01:00
proc
2026-03-13 13:22:24 +01:00
2026-04-08 12:14:02 +02:00
arith_tree
2026-03-16 16:23:42 +01:00
select -assert-count 6 t:$fa
2026-03-13 13:22:24 +01:00
select -assert-count 1 t:$add
2026-04-08 12:14:02 +02:00
arith_tree
2026-03-16 16:23:42 +01:00
select -assert-count 6 t:$fa
2026-03-13 13:22:24 +01:00
select -assert-count 1 t:$add
select -assert-none t:$sub
2026-03-27 16:14:07 +01:00
design -reset
read_verilog <<EOT
2026-04-01 18:40:51 +02:00
module macc_idempotent(
2026-03-27 16:14:07 +01:00
input [15:0] a, b, c, d, e, f, g, h,
output [15:0] y
);
assign y = a + b + c + d + e + f + g + h;
endmodule
EOT
hierarchy -auto-top
proc
alumacc
opt_clean
2026-04-08 12:14:02 +02:00
arith_tree
2026-03-27 16:14:07 +01:00
select -assert-count 6 t:$fa
select -assert-count 1 t:$add
select -assert-none t:$sub
select -assert-none t:$alu
2026-04-08 12:14:02 +02:00
arith_tree
2026-03-27 16:14:07 +01:00
select -assert-count 6 t:$fa
select -assert-count 1 t:$add
select -assert-none t:$sub
select -assert-none t:$alu
design -reset