diff --git a/rsyn/src/rsyn/io/reader/PopulateRsyn.cpp b/rsyn/src/rsyn/io/reader/PopulateRsyn.cpp index fcdbce8..e40274d 100644 --- a/rsyn/src/rsyn/io/reader/PopulateRsyn.cpp +++ b/rsyn/src/rsyn/io/reader/PopulateRsyn.cpp @@ -340,6 +340,72 @@ void PopulateRsyn::populateRsyn( } // end else } // end for } // end for + + // Creates special nets from DEF + for (const DefSpecialNetDscp &net : defDscp.clsSpecialNets) { + if (net.clsName == "") { + std::cout << "[ERROR] Empty net name.\n"; + for (unsigned i = 0; i < net.clsConnections.size(); i++) { + std::cout << "Connection: " << net.clsConnections[i].clsComponentName << ":" << net.clsConnections[i].clsPinName << "\n"; + } // end for + exit(1); + } // end if + + Rsyn::Net rsynNet = top.createNet(net.clsName); + + const string use = net.clsUse; + if (use == "ANALOG") { + rsynNet.setUse(Rsyn::ANALOG); + } else if (use == "CLOCK") { + rsynNet.setUse(Rsyn::CLOCK); + } else if (use == "GROUND") { + rsynNet.setUse(Rsyn::GROUND); + } else if (use == "POWER") { + rsynNet.setUse(Rsyn::POWER); + } else if (use == "RESET") { + rsynNet.setUse(Rsyn::RESET); + } else if (use == "SCAN") { + rsynNet.setUse(Rsyn::SCAN); + } else if (use == "SIGNAL") { + rsynNet.setUse(Rsyn::SIGNAL); + } else if (use == "TIEOFF") { + rsynNet.setUse(Rsyn::TIEOFF); + } // end if + + for (const DefNetConnection &connection : net.clsConnections) { + if (connection.clsComponentName == "PIN") { + Rsyn::Port rsynCell = + rsynDesign.findPortByName(connection.clsPinName); + + if (!rsynCell) { + std::cout << "[ERROR] The primary input/ouput port '" + << connection.clsPinName << "' not found.\n"; + exit(1); + } // end if + + Rsyn::Pin rsynPin = rsynCell.getInnerPin(); + rsynPin.connect(rsynNet); + } else if (connection.clsComponentName == "*") { + for (Rsyn::Instance inst: rsynDesign.getTopModule().allInstances()) { + Rsyn::Pin rsynPin = inst.getPinByName(connection.clsPinName); + if (!rsynPin) { + continue; + } // end if + rsynPin.connect(rsynNet); + } // end for + } else { + Rsyn::Cell rsynCell = rsynDesign.findCellByName(connection.clsComponentName); + if (!rsynCell) { + std::cout << "[ERROR] Cell '" + << connection.clsComponentName << "' not found.\n"; + exit(1); + } // end if + + Rsyn::Pin rsynPin = rsynCell.getPinByName(connection.clsPinName); + rsynPin.connect(rsynNet); + } // end else + } // end for + } // end for } // end method // -----------------------------------------------------------------------------