diff options
author | gatecat <gatecat@ds0.me> | 2021-07-01 13:12:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-01 13:12:19 +0100 |
commit | 8b4e8808271a1a6cd853ee214f138b79b19d6f8f (patch) | |
tree | 042eb6c61e328f56ee1757203a4d0442c07b9955 /fpga_interchange/fpga_interchange.cpp | |
parent | 2124da44d87353dd0c7b0d2bf57ddf7789d9c39c (diff) | |
parent | dd7cfccbae42b0f746676582eb6187d16d2bd557 (diff) | |
download | nextpnr-8b4e8808271a1a6cd853ee214f138b79b19d6f8f.tar.gz nextpnr-8b4e8808271a1a6cd853ee214f138b79b19d6f8f.tar.bz2 nextpnr-8b4e8808271a1a6cd853ee214f138b79b19d6f8f.zip |
Merge pull request #742 from acomodi/interchange-do-not-output-zero-user-nets
interchange: phys: do not output nets which have no users
Diffstat (limited to 'fpga_interchange/fpga_interchange.cpp')
-rw-r--r-- | fpga_interchange/fpga_interchange.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fpga_interchange/fpga_interchange.cpp b/fpga_interchange/fpga_interchange.cpp index 8d54335d..89f1f958 100644 --- a/fpga_interchange/fpga_interchange.cpp +++ b/fpga_interchange/fpga_interchange.cpp @@ -535,11 +535,22 @@ void FpgaInterchange::write_physical_netlist(const Context * ctx, const std::str phys_cell.setPhysType(PhysicalNetlist::PhysNetlist::PhysCellType::PORT); } - auto nets = phys_netlist.initPhysNets(ctx->nets.size()); + int nets_to_remove = 0; + for(auto & net_pair : ctx->nets) { + auto &net = *net_pair.second; + + if (net.users.empty()) + nets_to_remove++; + } + + auto nets = phys_netlist.initPhysNets(ctx->nets.size() - nets_to_remove); auto net_iter = nets.begin(); for(auto & net_pair : ctx->nets) { auto &net = *net_pair.second; + if (net.users.empty()) + continue; + const CellInfo *driver_cell = net.driver.cell; auto net_out = *net_iter++; |