diff options
author | gatecat <gatecat@ds0.me> | 2021-07-02 18:34:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-02 18:34:46 +0100 |
commit | 8a9fb810369aeb5eed128ef4e7d4de456ef1ec8f (patch) | |
tree | bc73a0505ccdd39b2c533e029ea1fa04d720b394 /fpga_interchange/fpga_interchange.cpp | |
parent | fe38e70dc1cd84a60e2fe05f7153c8deed1c16e9 (diff) | |
parent | 888a2462af22905c104216a51f2b25e49d32ebee (diff) | |
download | nextpnr-8a9fb810369aeb5eed128ef4e7d4de456ef1ec8f.tar.gz nextpnr-8a9fb810369aeb5eed128ef4e7d4de456ef1ec8f.tar.bz2 nextpnr-8a9fb810369aeb5eed128ef4e7d4de456ef1ec8f.zip |
Merge pull request #748 from acomodi/fix-phys-net-writing
interchange: phys: skip only nets writing on disconnected out ports
Diffstat (limited to 'fpga_interchange/fpga_interchange.cpp')
-rw-r--r-- | fpga_interchange/fpga_interchange.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fpga_interchange/fpga_interchange.cpp b/fpga_interchange/fpga_interchange.cpp index 92d409f9..1c6e6ce8 100644 --- a/fpga_interchange/fpga_interchange.cpp +++ b/fpga_interchange/fpga_interchange.cpp @@ -544,7 +544,9 @@ void FpgaInterchange::write_physical_netlist(const Context * ctx, const std::str for(auto & net_pair : ctx->nets) { auto &net = *net_pair.second; - if (net.users.empty()) + // Remove disconnected nets that do not have any users + auto net_name = std::string(net.name.c_str(ctx)); + if (net.users.empty() && net_name.rfind("$frontend$", 0) == 0) nets_to_remove++; } @@ -553,7 +555,8 @@ void FpgaInterchange::write_physical_netlist(const Context * ctx, const std::str for(auto & net_pair : ctx->nets) { auto &net = *net_pair.second; - if (net.users.empty()) + auto net_name = std::string(net.name.c_str(ctx)); + if (net.users.empty() && net_name.rfind("$frontend$", 0) == 0) continue; const CellInfo *driver_cell = net.driver.cell; @@ -1087,6 +1090,14 @@ ModuleReader::ModuleReader(const LogicalNetlistImpl *root, if(iter == net_indicies.end()) { PortKey port_key = port_connections.first; auto port = ports[port_key.port_idx]; + + // Disconnected outputs should be marked, so to be ignored when + // writing the physical netlist. + // Skipping these nets lets the basic frontend to assign a default + // name that starts with $frontend$. + if (port.getDir() == LogicalNetlist::Netlist::Direction::OUTPUT) + continue; + disconnected_nets[net_idx] = stringf("%s.%d", root->strings.at(port.getName()).c_str(), i); } } |