mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-25 11:26:22 +00:00
Merge 51a377be44 into 9d0cdb8551
This commit is contained in:
commit
ec42748e66
6 changed files with 84 additions and 10 deletions
|
|
@ -1434,6 +1434,8 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
|
|||
}
|
||||
|
||||
if (type == AST_CELL) {
|
||||
// when a module lookup is suggested, any port connection that is not a
|
||||
// plain identifier will be indirected through a new wire
|
||||
bool lookup_suggested = false;
|
||||
|
||||
for (auto& child : children) {
|
||||
|
|
@ -1456,7 +1458,7 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
|
|||
continue;
|
||||
}
|
||||
if (elem->type == AST_MEMORY)
|
||||
// need to determine is the is a read or wire
|
||||
// need to determine is the is a read or write
|
||||
lookup_suggested = true;
|
||||
else if (elem->type == AST_WIRE && elem->is_signed && !value->children.empty())
|
||||
// this may be a fully sliced signed wire which needs
|
||||
|
|
@ -1466,6 +1468,15 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
|
|||
else if (contains_unbased_unsized(value.get()))
|
||||
// unbased unsized literals extend to width of the context
|
||||
lookup_suggested = true;
|
||||
else if (value->type == AST_TO_UNSIGNED)
|
||||
// inner expression may be signed by default
|
||||
lookup_suggested = true;
|
||||
else if (value->type == AST_CONCAT) {
|
||||
// concat of a single expression is equivalent to $unsigned;
|
||||
// concats could also contain one or references to memories,
|
||||
// which may ambiguously be reads or writes
|
||||
lookup_suggested = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue