mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-25 03:16:22 +00:00
CSA add alumacc related tests.
This commit is contained in:
parent
5d90bcc792
commit
9dc408eea7
6 changed files with 896 additions and 0 deletions
116
tests/csa_tree/csa_tree_alu_macc_sim.ys
Normal file
116
tests/csa_tree/csa_tree_alu_macc_sim.ys
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
read_verilog <<EOT
|
||||
module sim_alu_add4(
|
||||
input [7:0] a, b, c, d,
|
||||
output [7:0] y
|
||||
);
|
||||
assign y = a + b + c + d;
|
||||
endmodule
|
||||
EOT
|
||||
hierarchy -auto-top
|
||||
proc
|
||||
alumacc
|
||||
opt_clean
|
||||
csa_tree
|
||||
|
||||
sat -set a 1 -set b 2 -set c 3 -set d 4 -prove y 10
|
||||
sat -set a 0 -set b 0 -set c 0 -set d 0 -prove y 0
|
||||
sat -set a 255 -set b 1 -set c 0 -set d 0 -prove y 0
|
||||
sat -set a 100 -set b 50 -set c 25 -set d 25 -prove y 200
|
||||
sat -set a 255 -set b 255 -set c 255 -set d 255 -prove y 252
|
||||
design -reset
|
||||
|
||||
read_verilog <<EOT
|
||||
module sim_alu_sub_mixed(
|
||||
input [7:0] a, b, c, d,
|
||||
output [7:0] y
|
||||
);
|
||||
assign y = a + b - c + d;
|
||||
endmodule
|
||||
EOT
|
||||
hierarchy -auto-top
|
||||
proc
|
||||
alumacc
|
||||
opt_clean
|
||||
csa_tree
|
||||
|
||||
sat -set a 10 -set b 20 -set c 5 -set d 3 -prove y 28
|
||||
sat -set a 0 -set b 0 -set c 0 -set d 0 -prove y 0
|
||||
sat -set a 100 -set b 50 -set c 30 -set d 10 -prove y 130
|
||||
design -reset
|
||||
|
||||
read_verilog <<EOT
|
||||
module sim_alu_sub_all(
|
||||
input [7:0] a, b, c, d,
|
||||
output [7:0] y
|
||||
);
|
||||
assign y = a - b - c - d;
|
||||
endmodule
|
||||
EOT
|
||||
hierarchy -auto-top
|
||||
proc
|
||||
alumacc
|
||||
opt_clean
|
||||
csa_tree
|
||||
|
||||
sat -set a 100 -set b 10 -set c 20 -set d 30 -prove y 40
|
||||
sat -set a 0 -set b 0 -set c 0 -set d 0 -prove y 0
|
||||
sat -set a 255 -set b 1 -set c 1 -set d 1 -prove y 252
|
||||
design -reset
|
||||
|
||||
read_verilog <<EOT
|
||||
module sim_macc_add4(
|
||||
input [7:0] a, b, c, d,
|
||||
output [7:0] y
|
||||
);
|
||||
assign y = a + b + c + d;
|
||||
endmodule
|
||||
EOT
|
||||
hierarchy -auto-top
|
||||
proc
|
||||
alumacc
|
||||
opt
|
||||
csa_tree
|
||||
|
||||
sat -set a 1 -set b 2 -set c 3 -set d 4 -prove y 10
|
||||
sat -set a 0 -set b 0 -set c 0 -set d 0 -prove y 0
|
||||
sat -set a 255 -set b 1 -set c 0 -set d 0 -prove y 0
|
||||
sat -set a 100 -set b 50 -set c 25 -set d 25 -prove y 200
|
||||
design -reset
|
||||
|
||||
read_verilog <<EOT
|
||||
module sim_macc_add8(
|
||||
input [7:0] a, b, c, d, e, f, g, h,
|
||||
output [7:0] y
|
||||
);
|
||||
assign y = a + b + c + d + e + f + g + h;
|
||||
endmodule
|
||||
EOT
|
||||
hierarchy -auto-top
|
||||
proc
|
||||
alumacc
|
||||
opt
|
||||
csa_tree
|
||||
|
||||
sat -set a 1 -set b 2 -set c 3 -set d 4 -set e 5 -set f 6 -set g 7 -set h 8 -prove y 36
|
||||
sat -set a 0 -set b 0 -set c 0 -set d 0 -set e 0 -set f 0 -set g 0 -set h 0 -prove y 0
|
||||
sat -set a 32 -set b 32 -set c 32 -set d 32 -set e 32 -set f 32 -set g 32 -set h 32 -prove y 0
|
||||
design -reset
|
||||
|
||||
read_verilog <<EOT
|
||||
module sim_macc_sub_mixed(
|
||||
input [7:0] a, b, c, d,
|
||||
output [7:0] y
|
||||
);
|
||||
assign y = a + b - c + d;
|
||||
endmodule
|
||||
EOT
|
||||
hierarchy -auto-top
|
||||
proc
|
||||
alumacc
|
||||
opt
|
||||
csa_tree
|
||||
|
||||
sat -set a 10 -set b 20 -set c 5 -set d 3 -prove y 28
|
||||
sat -set a 0 -set b 0 -set c 0 -set d 0 -prove y 0
|
||||
sat -set a 100 -set b 50 -set c 30 -set d 10 -prove y 130
|
||||
design -reset
|
||||
Loading…
Add table
Add a link
Reference in a new issue