// Ancestry Helper Functions const uint32_t V3BvBlastBv::getParentIndex(const V3NetId& id) const { assert (id.id >= _handler->getNtk()->getNetSize()); assert (V3_FF >= _ntk->getGateType(id)); const V3NetId parentId = getParentNetId(id); assert (V3NetUD != parentId); V3BvBlastBvMap::const_iterator it = _p2cMap.find(parentId.id); assert (_p2cMap.end() != it); assert (id.id >= it->second); assert ((id.id - it->second) < _handler->getNtk()->getNetWidth(parentId)); return id.id - it->second; }
void V3NtkHandler::getNetName(V3NetId& id, string& name) const { if (V3NetUD == id) return; // Current Network if (!id.cp) { V3NetStrHash::const_iterator it = _netHash.find(id.id); if (it != _netHash.end()) { name = it->second; return; } } // Parent Networks if (_handler) _handler->getNetName(id = getParentNetId(id), name); }
// Net Ancestry Functions void V3NtkExpand::getNetName(V3NetId& id, string& name) const { if (V3NetUD == id) return; // Current Network if (!id.cp) { V3NetStrHash::const_iterator it = _netHash.find(id.id); if (it != _netHash.end()) { name = it->second; return; } } // Parent Networks if (_handler) { const V3NetId netId = id; id = getParentNetId(id); _handler->getNetName(id, name); if (!name.size()) return; for (uint32_t i = 0; i < _cycle; ++i) if (netId.id == _p2cMap[i][id.id].id) { name += (V3AuxExpansionName + v3Int2Str(i)); break; } } }
void V3BvBlastBv::getNetName(V3NetId& id, string& name) const { if (V3NetUD == id) return; // Current Network if (!id.cp) { V3NetStrHash::const_iterator it = _netHash.find(id.id); if (it != _netHash.end()) { name = it->second; return; } } // Parent Networks if (_handler) { const V3NetId netId = id; id = getParentNetId(id); _handler->getNetName(id, name); if (_handler->getNtk()->getNetSize() <= netId.id && name.size()) name += (V3AuxNameBitPrefix + v3Int2Str(getParentIndex(netId)) + V3AuxNameBitSuffix); } }
// Private Helper Functions const V3NetId V3NtkHandler::getPrimitiveNetId(const V3NetId& id) const { if (V3NetUD == id) return id; return (_handler) ? _handler->getPrimitiveNetId(getParentNetId(id)) : id; }
void V3NtkHandler::getNetName(V3NetId& id, string& name) const { if (V3NetUD == id) return; assert (_handler); id = getParentNetId(id); _handler->getNetName(id, name); }