mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
verilog: impose limit on maximum expression width
Designs with unreasonably wide expressions would previously get stuck allocating memory forever.
This commit is contained in:
parent
7d2097b005
commit
c18ddbcd82
3 changed files with 39 additions and 0 deletions
17
tests/verilog/absurd_width.ys
Normal file
17
tests/verilog/absurd_width.ys
Normal file
|
@ -0,0 +1,17 @@
|
|||
logger -expect error "Expression width 1073741824 exceeds implementation limit of 16777216!" 1
|
||||
read_verilog <<EOF
|
||||
module top(
|
||||
input inp,
|
||||
output out
|
||||
);
|
||||
assign out =
|
||||
{1024 {
|
||||
{1024 {
|
||||
{1024 {
|
||||
inp
|
||||
}}
|
||||
}}
|
||||
}}
|
||||
;
|
||||
endmodule
|
||||
EOF
|
16
tests/verilog/absurd_width_const.ys
Normal file
16
tests/verilog/absurd_width_const.ys
Normal file
|
@ -0,0 +1,16 @@
|
|||
logger -expect error "Expression width 1073741824 exceeds implementation limit of 16777216!" 1
|
||||
read_verilog <<EOF
|
||||
module top(
|
||||
output out
|
||||
);
|
||||
assign out =
|
||||
{1024 {
|
||||
{1024 {
|
||||
{1024 {
|
||||
1'b1
|
||||
}}
|
||||
}}
|
||||
}}
|
||||
;
|
||||
endmodule
|
||||
EOF
|
Loading…
Add table
Add a link
Reference in a new issue