3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-27 02:45:52 +00:00

Fix constants bound to single bit arguments (fixes #2383)

This commit is contained in:
Zachary Snow 2020-12-05 18:56:18 -07:00
parent 95c6086681
commit 8206546c45
2 changed files with 18 additions and 0 deletions

View file

@ -3337,6 +3337,14 @@ skip_dynamic_range_lvalue_expansion:;
wire->type = AST_LOCALPARAM;
wire->attributes.erase(ID::nosync);
wire->children.insert(wire->children.begin(), arg->clone());
// args without a range implicitly have width 1
if (wire->children.back()->type != AST_RANGE) {
AstNode* range = new AstNode();
range->type = AST_RANGE;
wire->children.push_back(range);
range->children.push_back(mkconst_int(0, true));
range->children.push_back(mkconst_int(0, true));
}
continue;
}
AstNode *wire_id = new AstNode(AST_IDENTIFIER);