mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 09:35:32 +00:00
simplify: Skip AST_PRIMITIVE in AST_CELLARRAY
Otherwise the `AST_PRIMITIVE` simplifies to the corresponding function and is no longer caught by the check for `AST_PRIMITIVE`s, raising an assertion error instead of an input error. Add bug4785.ys to tests/verilog to demonstrate.
This commit is contained in:
parent
cce7aaedf7
commit
0a1c664f02
2 changed files with 11 additions and 1 deletions
|
@ -1758,7 +1758,7 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
|
|||
break;
|
||||
if (type == AST_GENBLOCK)
|
||||
break;
|
||||
if (type == AST_CELLARRAY && children[i]->type == AST_CELL)
|
||||
if (type == AST_CELLARRAY && (children[i]->type == AST_CELL || children[i]->type == AST_PRIMITIVE))
|
||||
continue;
|
||||
if (type == AST_BLOCK && !str.empty())
|
||||
break;
|
||||
|
@ -2741,6 +2741,7 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
|
|||
if (new_cell->type == AST_PRIMITIVE) {
|
||||
input_error("Cell arrays of primitives are currently not supported.\n");
|
||||
} else {
|
||||
this->dumpAst(NULL, " ");
|
||||
log_assert(new_cell->children.at(0)->type == AST_CELLTYPE);
|
||||
new_cell->children.at(0)->str = stringf("$array:%d:%d:%s", i, num, new_cell->children.at(0)->str.c_str());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue