3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-12 09:03:27 +00:00

read_aiger to cope with non-unique POs

This commit is contained in:
Eddie Hung 2019-02-19 15:14:08 -08:00
parent f9af902532
commit d304882cba

View file

@ -650,13 +650,20 @@ void AigerReader::parse_aiger_binary()
} }
else { else {
log_debug("%d is an output\n", l1); log_debug("%d is an output\n", l1);
const unsigned variable = l1 >> 1;
const bool invert = l1 & 1;
RTLIL::IdString wire_name(stringf("\\n%d%s", variable, invert ? "_inv" : "")); // FIXME: is "_inv" the right suffix?
wire = module->wire(wire_name);
if (!wire)
wire = createWireIfNotExists(module, l1); wire = createWireIfNotExists(module, l1);
} else {
if (wire->port_input) { if ((wire->port_input || wire->port_output)) {
RTLIL::Wire *new_wire = module->addWire(NEW_ID); RTLIL::Wire *new_wire = module->addWire(stringf("\\o%zu", outputs.size()));
module->connect(new_wire, wire); module->connect(new_wire, wire);
wire = new_wire; wire = new_wire;
} }
}
}
wire->port_output = true; wire->port_output = true;
outputs.push_back(wire); outputs.push_back(wire);
} }