forked from YosysHQ/yosys
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from alainmarcel/new_peepopts
Fix code review issue
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
log -header "Test simple positive case" | ||
log -push | ||
design -reset | ||
read_verilog <<EOF | ||
module muldiv_const_ok ( | ||
input wire [31:0] a, | ||
output wire [63:0] y | ||
); | ||
assign y = (a * 5140) / (257 * 2); | ||
endmodule | ||
EOF | ||
check -assert | ||
equiv_opt -assert peepopt ;;; | ||
design -load postopt | ||
select -assert-any t:$mul # assert mult | ||
|
||
log -pop | ||
log -header "Test negative case where div is kept" | ||
log -push | ||
design -reset | ||
read_verilog <<EOF | ||
module muldiv_const_ko ( | ||
input wire signed [31:0] a, | ||
output wire signed [63:0] y, | ||
output wire probe | ||
); | ||
wire [44:0] tmp = (a * 5140); | ||
assign probe = tmp[44]; | ||
|
||
assign y = tmp[43:0] / (257 * 2); | ||
endmodule | ||
EOF | ||
check -assert | ||
equiv_opt -assert peepopt ;;; | ||
design -load postopt | ||
select -assert-any t:$div # assert div | ||
|
||
log -pop |