mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-29 23:43:16 +00:00
further improved early width and sign detection in ast simplifier
This commit is contained in:
parent
cd0fe7d786
commit
472117d532
2 changed files with 117 additions and 11 deletions
|
@ -665,9 +665,12 @@ void AstNode::detectSignWidthWorker(int &width_hint, bool &sign_hint)
|
|||
break;
|
||||
|
||||
case AST_MEMRD:
|
||||
if (!is_signed)
|
||||
if (!id2ast->is_signed)
|
||||
sign_hint = false;
|
||||
width_hint = std::max(width_hint, current_module->memories.at(str)->width);
|
||||
if (!id2ast->children[0]->range_valid)
|
||||
log_error("Failed to detect with of memory access `%s' at %s:%d!\n", str.c_str(), filename.c_str(), linenum);
|
||||
this_width = id2ast->children[0]->range_left - id2ast->children[0]->range_right + 1;
|
||||
width_hint = std::max(width_hint, this_width);
|
||||
break;
|
||||
|
||||
// everything should have been handled above -> print error if not.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue