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.
proc_rmdead: use explicit pattern set when there are no wildcards
If width of a case expression was large, explicit patterns could cause the existing logic to take an extremely long time, or exhaust the maximum size of the underlying set. For cases where all of the patterns are fully defined and there are no constants in the case expression, this change uses a simple set to track which patterns have been seen.
- Loading branch information
Showing
4 changed files
with
386 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module top ( | ||
input wire signed x, | ||
output reg [31:0] y | ||
); | ||
wire signed fail = ~x; | ||
|
||
always @* | ||
case (x) | ||
1'b0: y = 0; | ||
1'b1: y = 1; | ||
default: y = fail; | ||
endcase | ||
|
||
always @* | ||
case (x) | ||
2'sb00: y = 0; | ||
2'sb00: y = fail; | ||
endcase | ||
|
||
always @* | ||
case (x) | ||
2'sb00: y = 0; | ||
default: y = fail; | ||
2'sb01: y = 1; | ||
2'sb10: y = 2; | ||
2'sb11: y = 3; | ||
2'sb00: y = fail; | ||
2'sb01: y = fail; | ||
2'sb10: y = fail; | ||
2'sb11: y = fail; | ||
endcase | ||
|
||
|
||
always @* | ||
case ({x, x}) | ||
2'b00: y = 0; | ||
2'b01: y = 1; | ||
2'b10: y = 2; | ||
2'b11: y = 3; | ||
default: y = fail; | ||
2'b00: y = fail; | ||
2'b01: y = fail; | ||
2'b10: y = fail; | ||
2'b11: y = fail; | ||
endcase | ||
endmodule |
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,4 @@ | ||
read_verilog rmdead.v | ||
proc | ||
opt_clean | ||
select -assert-count 0 w:fail |
Oops, something went wrong.