mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-05 13:51:24 +00:00
alumacc: add signed-independent comparison tests
This commit is contained in:
parent
535ecf84ac
commit
062dbf2c96
1 changed files with 33 additions and 0 deletions
33
tests/opt/alumacc.ys
Normal file
33
tests/opt/alumacc.ys
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
read_verilog <<EOT
|
||||||
|
module top(...);
|
||||||
|
|
||||||
|
input [7:0] ra;
|
||||||
|
input [7:0] rb;
|
||||||
|
output gt;
|
||||||
|
output sgt;
|
||||||
|
output lt;
|
||||||
|
output slt;
|
||||||
|
|
||||||
|
output ge;
|
||||||
|
output eq;
|
||||||
|
output seq;
|
||||||
|
output ne;
|
||||||
|
|
||||||
|
assign gt = ra > rb;
|
||||||
|
assign sgt = $signed(ra) > $signed(rb);
|
||||||
|
assign lt = ra < rb;
|
||||||
|
assign slt = $signed(ra) < $signed(rb);
|
||||||
|
|
||||||
|
assign ge = ra >= rb;
|
||||||
|
assign eq = ra == rb;
|
||||||
|
assign seq = $signed(ra) == $signed(rb);
|
||||||
|
assign ne = ra != rb;
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
EOT
|
||||||
|
|
||||||
|
proc
|
||||||
|
|
||||||
|
equiv_opt -assert alumacc
|
||||||
|
alumacc
|
||||||
|
select -assert-count 1 t:$alu
|
Loading…
Add table
Add a link
Reference in a new issue