mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-27 02:45:52 +00:00
Merge pull request #2476 from zachjs/const-arg-width
Fix constants bound to single bit arguments (fixes #2383)
This commit is contained in:
commit
8ef6b77dc3
2 changed files with 18 additions and 0 deletions
|
@ -3342,6 +3342,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue