aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYRabbit <rabbit@yrabbit.cyou>2021-07-03 10:09:38 +1000
committerYRabbit <rabbit@yrabbit.cyou>2021-07-03 10:09:38 +1000
commit1aae331ddc4d5efcda307588402b8457eeded5b5 (patch)
tree0d5f70316f84fd3235b4a7a84f81c9d86da65b94
parent5c5982c50a63c83dba2f68e9d5dcc2bb67cc4c67 (diff)
parent8a9fb810369aeb5eed128ef4e7d4de456ef1ec8f (diff)
downloadnextpnr-1aae331ddc4d5efcda307588402b8457eeded5b5.tar.gz
nextpnr-1aae331ddc4d5efcda307588402b8457eeded5b5.tar.bz2
nextpnr-1aae331ddc4d5efcda307588402b8457eeded5b5.zip
Merge branch 'master' into io_port
-rw-r--r--fpga_interchange/fpga_interchange.cpp15
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);
}
}