diff options
Diffstat (limited to 'common/router2.cc')
-rw-r--r-- | common/router2.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/common/router2.cc b/common/router2.cc index 2156ce28..e1d3e75b 100644 --- a/common/router2.cc +++ b/common/router2.cc @@ -35,7 +35,6 @@ #include <fstream> #include <queue> -#include "hash_table.h" #include "log.h" #include "nextpnr.h" #include "router1.h" @@ -131,8 +130,8 @@ struct Router2 nets.resize(ctx->nets.size()); nets_by_udata.resize(ctx->nets.size()); size_t i = 0; - for (auto net : sorted(ctx->nets)) { - NetInfo *ni = net.second; + for (auto &net : ctx->nets) { + NetInfo *ni = net.second.get(); ni->udata = i; nets_by_udata.at(i) = ni; nets.at(i).arcs.resize(ni->users.size()); @@ -198,7 +197,7 @@ struct Router2 } } - HashTables::HashMap<WireId, int> wire_to_idx; + dict<WireId, int> wire_to_idx; std::vector<PerWireData> flat_wires; PerWireData &wire_data(WireId w) { return flat_wires[wire_to_idx.at(w)]; } @@ -231,8 +230,8 @@ struct Router2 flat_wires.push_back(pwd); } - for (auto net_pair : sorted(ctx->nets)) { - auto *net = net_pair.second; + for (auto &net_pair : ctx->nets) { + auto *net = net_pair.second.get(); auto &nd = nets.at(net->udata); for (size_t usr = 0; usr < net->users.size(); usr++) { auto &ad = nd.arcs.at(usr); @@ -284,7 +283,7 @@ struct Router2 std::priority_queue<QueuedWire, std::vector<QueuedWire>, QueuedWire::Greater> queue; // Special case where one net has multiple logical arcs to the same physical sink - std::unordered_set<WireId> processed_sinks; + pool<WireId> processed_sinks; // Backwards routing std::queue<int> backwards_queue; @@ -465,7 +464,7 @@ struct Router2 bool did_something = false; WireId src = ctx->getNetinfoSourceWire(net); for (auto sink : ctx->getNetinfoSinkWires(net, net->users.at(i))) { - std::unordered_set<WireId> rsv; + pool<WireId> rsv; WireId cursor = sink; bool done = false; if (ctx->debug) @@ -1083,7 +1082,7 @@ struct Router2 void write_wiretype_heatmap(std::ostream &out) { - std::unordered_map<IdString, std::vector<int>> cong_by_type; + dict<IdString, std::vector<int>> cong_by_type; size_t max_cong = 0; // Build histogram for (auto &wd : flat_wires) { @@ -1099,7 +1098,7 @@ struct Router2 for (size_t i = 0; i <= max_cong; i++) out << "bound=" << i << ","; out << std::endl; - for (auto &ty : sorted_ref(cong_by_type)) { + for (auto &ty : cong_by_type) { out << ctx->nameOf(ty.first) << ","; for (int count : ty.second) out << count << ","; |