3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-19 13:45:48 +00:00
This commit is contained in:
Emil J. Tywoniak 2026-06-12 00:18:53 +02:00
parent afdae7b87e
commit c3ffbf6fae
229 changed files with 3902 additions and 3835 deletions

View file

@ -58,9 +58,9 @@ struct ExtractReducePass : public Pass
inline bool IsRightType(Cell* cell, GateType gt)
{
return (cell->type == ID($_AND_) && gt == GateType::And) ||
(cell->type == ID($_OR_) && gt == GateType::Or) ||
(cell->type == ID($_XOR_) && gt == GateType::Xor);
return (cell->type == TW($_AND_) && gt == GateType::And) ||
(cell->type == TW($_OR_) && gt == GateType::Or) ||
(cell->type == TW($_XOR_) && gt == GateType::Xor);
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
@ -124,11 +124,11 @@ struct ExtractReducePass : public Pass
GateType gt;
if (cell->type == ID($_AND_))
if (cell->type == TW($_AND_))
gt = GateType::And;
else if (cell->type == ID($_OR_))
else if (cell->type == TW($_OR_))
gt = GateType::Or;
else if (cell->type == ID($_XOR_))
else if (cell->type == TW($_XOR_))
gt = GateType::Xor;
else
continue;
@ -261,7 +261,7 @@ struct ExtractReducePass : public Pass
SigSpec input;
for (auto it : sources) {
bool cond;
if (head_cell->type == ID($_XOR_))
if (head_cell->type == TW($_XOR_))
cond = it.second & 1;
else
cond = it.second != 0;
@ -269,11 +269,11 @@ struct ExtractReducePass : public Pass
input.append(it.first);
}
if (head_cell->type == ID($_AND_)) {
if (head_cell->type == TW($_AND_)) {
module->addReduceAnd(NEW_TWINE, input, output);
} else if (head_cell->type == ID($_OR_)) {
} else if (head_cell->type == TW($_OR_)) {
module->addReduceOr(NEW_TWINE, input, output);
} else if (head_cell->type == ID($_XOR_)) {
} else if (head_cell->type == TW($_XOR_)) {
module->addReduceXor(NEW_TWINE, input, output);
} else {
log_assert(false);