diff options
author | gatecat <gatecat@ds0.me> | 2021-06-02 09:28:53 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-06-02 15:04:53 +0100 |
commit | f4fed62c05a9595e22a8ec54add5531225911741 (patch) | |
tree | 008195f400702e7099c17fd52617c44d8c7c84d1 /common/router2.cc | |
parent | dfe0ce599a8d713eb1caabcd44626aa052390312 (diff) | |
download | nextpnr-f4fed62c05a9595e22a8ec54add5531225911741.tar.gz nextpnr-f4fed62c05a9595e22a8ec54add5531225911741.tar.bz2 nextpnr-f4fed62c05a9595e22a8ec54add5531225911741.zip |
Use hashlib in routers
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/router2.cc')
-rw-r--r-- | common/router2.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/common/router2.cc b/common/router2.cc index b0f53ce1..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" @@ -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)]; } @@ -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 << ","; |