mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-07 14:45:18 +00:00
add test for yosys's $divfloor and $modfloor cells
Depends on: https://github.com/YosysHQ/yosys/pull/3335
This commit is contained in:
parent
ad2c33dd37
commit
3f32deb8c9
44
tests/unsorted/floor_divmod.sby
Normal file
44
tests/unsorted/floor_divmod.sby
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
[options]
|
||||||
|
mode bmc
|
||||||
|
|
||||||
|
[engines]
|
||||||
|
smtbmc
|
||||||
|
|
||||||
|
[script]
|
||||||
|
read_verilog -icells -formal test.v
|
||||||
|
prep -top top
|
||||||
|
|
||||||
|
[file test.v]
|
||||||
|
module top;
|
||||||
|
wire [7:0] a = $anyconst, b = $anyconst, fdiv, fmod, a2;
|
||||||
|
assign a2 = b * fdiv + fmod;
|
||||||
|
|
||||||
|
\$divfloor #(
|
||||||
|
.A_WIDTH(8),
|
||||||
|
.B_WIDTH(8),
|
||||||
|
.A_SIGNED(1),
|
||||||
|
.B_SIGNED(1),
|
||||||
|
.Y_WIDTH(8),
|
||||||
|
) fdiv_m (
|
||||||
|
.A(a),
|
||||||
|
.B(b),
|
||||||
|
.Y(fdiv)
|
||||||
|
);
|
||||||
|
|
||||||
|
\$modfloor #(
|
||||||
|
.A_WIDTH(8),
|
||||||
|
.B_WIDTH(8),
|
||||||
|
.A_SIGNED(1),
|
||||||
|
.B_SIGNED(1),
|
||||||
|
.Y_WIDTH(8),
|
||||||
|
) fmod_m (
|
||||||
|
.A(a),
|
||||||
|
.B(b),
|
||||||
|
.Y(fmod)
|
||||||
|
);
|
||||||
|
|
||||||
|
always @* begin
|
||||||
|
assume(b != 0);
|
||||||
|
assert(a == a2);
|
||||||
|
end
|
||||||
|
endmodule
|
Loading…
Reference in a new issue