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_final_adder.ys
2026-05-18 13:44:40 +02:00

97 lines
1.8 KiB
Text

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
select -assert-count 1 t:$add
select -assert-count 2 t:$fa
select -assert-count 1 t:$add a:adder_arch=parallel_prefix %i
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
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
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
select -assert-count 1 t:$add a:adder_arch=parallel_prefix %i
design -reset
read_verilog <<EOT
module final_elarith(
input [15:0] a, b, c, d,
output [15:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
arith_tree -final elarith
select -assert-count 0 t:$add
select -assert-count 1 t:\AddCfast
select -assert-count 2 t:$fa
select -assert-count 2 t:$fa c:*emit_compressor_42* %i
design -reset
read_verilog <<EOT
module elarith_macro(
input [15:0] a, b, c, d,
output [15:0] y
);
assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
arith_tree -elarith-macro
select -assert-count 0 t:$fa
select -assert-count 0 t:$add
select -assert-count 1 t:\AddMopCsv
design -reset