mirror of https://github.com/YosysHQ/yosys.git
smt2: Fix operation width computation for boolean producing cells
The output width for the boolean value should not influence the operation width. The previous incorrect width extension would still produce correct results, but could produce invalid smt2 output for reduction operators when the output width was larger than the width of the vector to which the reduction was applied. This fixes #3654
This commit is contained in:
parent
541fdffff2
commit
5e82638408
|
@ -462,7 +462,10 @@ struct Smt2Worker
|
|||
int width = GetSize(sig_y);
|
||||
|
||||
if (type == 's' || type == 'S' || type == 'd' || type == 'b') {
|
||||
width = max(width, GetSize(cell->getPort(ID::A)));
|
||||
if (type == 'b')
|
||||
width = GetSize(cell->getPort(ID::A));
|
||||
else
|
||||
width = max(width, GetSize(cell->getPort(ID::A)));
|
||||
if (cell->hasPort(ID::B))
|
||||
width = max(width, GetSize(cell->getPort(ID::B)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue