yosys/tests/arith_tree/arith_tree_final_adder.ys

71 lines
1.3 KiB
Plaintext
Raw Normal View History

2026-05-18 13:44:40 +02:00
read_verilog <<EOT
module final_auto_wide(
input [31:0] a, b, c, d,
output [31:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -final auto
design -load postopt
2026-06-03 15:35:17 +02:00
select -assert-count 1 t:$add
2026-05-18 13:44:40 +02:00
select -assert-count 2 t:$fa
2026-06-03 15:35:17 +02:00
select -assert-none t:$_AND_
select -assert-none 1 t:$_XOR_
2026-05-18 13:44:40 +02:00
design -reset
read_verilog <<EOT
module final_auto_narrow(
input [7:0] a, b, c, d,
output [7:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -final auto
design -load postopt
select -assert-count 1 t:$add
select -assert-count 2 t:$fa
select -assert-count 0 t:$add a:adder_arch %i
2026-05-20 14:10:08 +02:00
select -assert-none t:$_AND_ t:$_OR_ %u
2026-05-18 13:44:40 +02:00
design -reset
read_verilog <<EOT
module final_ripple(
input [31:0] a, b, c, d,
output [31:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -final ripple
design -load postopt
select -assert-count 1 t:$add
select -assert-count 0 t:$add a:adder_arch %i
2026-05-20 14:10:08 +02:00
select -assert-none t:$_AND_ t:$_OR_ %u
2026-05-18 13:44:40 +02:00
design -reset
read_verilog <<EOT
module final_prefix_narrow(
input [7:0] a, b, c, d,
output [7:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt arith_tree -final prefix
design -load postopt
2026-05-20 14:10:08 +02:00
select -assert-none t:$add
select -assert-min 1 t:$_AND_
select -assert-min 1 t:$_XOR_
2026-05-18 13:44:40 +02:00
design -reset