diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2019-02-19 15:14:08 -0800 |
---|---|---|
committer | Eddie Hung <eddieh@ece.ubc.ca> | 2019-02-19 15:14:08 -0800 |
commit | d304882cba32cc9eb9be163fe6f24211bd39594a (patch) | |
tree | 1289eeea7ce071a9bcce806ae28685b3d5d57b01 /frontends/aiger/aigerparse.cc | |
parent | f9af902532bcf44ddd0c5f0f28ac70880e5f2d07 (diff) | |
download | yosys-d304882cba32cc9eb9be163fe6f24211bd39594a.tar.gz yosys-d304882cba32cc9eb9be163fe6f24211bd39594a.tar.bz2 yosys-d304882cba32cc9eb9be163fe6f24211bd39594a.zip |
read_aiger to cope with non-unique POs
Diffstat (limited to 'frontends/aiger/aigerparse.cc')
-rw-r--r-- | frontends/aiger/aigerparse.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/frontends/aiger/aigerparse.cc b/frontends/aiger/aigerparse.cc index a1bdcbfff..941899316 100644 --- a/frontends/aiger/aigerparse.cc +++ b/frontends/aiger/aigerparse.cc @@ -650,12 +650,19 @@ void AigerReader::parse_aiger_binary() } else { log_debug("%d is an output\n", l1); - wire = createWireIfNotExists(module, l1); - } - if (wire->port_input) { - RTLIL::Wire *new_wire = module->addWire(NEW_ID); - module->connect(new_wire, wire); - wire = new_wire; + 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); + else { + if ((wire->port_input || wire->port_output)) { + RTLIL::Wire *new_wire = module->addWire(stringf("\\o%zu", outputs.size())); + module->connect(new_wire, wire); + wire = new_wire; + } + } } wire->port_output = true; outputs.push_back(wire); |