aboutsummaryrefslogtreecommitdiffstats
path: root/common/timing_opt.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-06-02 11:36:56 +0100
committergatecat <gatecat@ds0.me>2021-06-02 15:05:20 +0100
commiteca1a4cee4f310c7e2c1216bd678143c1967edd4 (patch)
tree2106f7895e22f60f6d200cca6d9244bcc81a1ab9 /common/timing_opt.cc
parentb8a68f5f35af49c36d6f4e86a3a1c5afa1b3215f (diff)
downloadnextpnr-eca1a4cee4f310c7e2c1216bd678143c1967edd4.tar.gz
nextpnr-eca1a4cee4f310c7e2c1216bd678143c1967edd4.tar.bz2
nextpnr-eca1a4cee4f310c7e2c1216bd678143c1967edd4.zip
Use hashlib in most remaining code
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/timing_opt.cc')
-rw-r--r--common/timing_opt.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/common/timing_opt.cc b/common/timing_opt.cc
index 2659f04e..da4907b6 100644
--- a/common/timing_opt.cc
+++ b/common/timing_opt.cc
@@ -35,8 +35,6 @@
#include "timing.h"
#include "util.h"
-#include "hash_table.h"
-
NEXTPNR_NAMESPACE_BEGIN
class TimingOptimiser
@@ -167,7 +165,7 @@ class TimingOptimiser
BelId curr = cell->bel;
Loc curr_loc = ctx->getBelLocation(curr);
int found_count = 0;
- cell_neighbour_bels[cell->name] = std::unordered_set<BelId>{};
+ cell_neighbour_bels[cell->name] = pool<BelId>{};
for (int dy = -d; dy <= d; dy++) {
for (int dx = -d; dx <= d; dx++) {
// Go through all the Bels at this location
@@ -267,7 +265,7 @@ class TimingOptimiser
}
NPNR_ASSERT_FALSE("port user not found on net");
};
- std::unordered_set<PortRef *> used_ports;
+ pool<PortRef *, hash_ptr_ops> used_ports;
for (auto crit_net : crit_nets) {
@@ -439,10 +437,10 @@ class TimingOptimiser
}
// Actual BFS path optimisation algorithm
- std::unordered_map<IdString, std::unordered_map<BelId, delay_t>> cumul_costs;
- std::unordered_map<std::pair<IdString, BelId>, std::pair<IdString, BelId>, PairHash> backtrace;
+ dict<IdString, dict<BelId, delay_t>> cumul_costs;
+ dict<std::pair<IdString, BelId>, std::pair<IdString, BelId>> backtrace;
std::queue<std::pair<int, BelId>> visit;
- std::unordered_set<std::pair<int, BelId>, PairHash> to_visit;
+ pool<std::pair<int, BelId>> to_visit;
for (auto startbel : cell_neighbour_bels[path_cells.front()]) {
// Swap for legality check
@@ -568,10 +566,10 @@ class TimingOptimiser
// Current candidate Bels for cells (linked in both direction>
std::vector<IdString> path_cells;
- std::unordered_map<IdString, std::unordered_set<BelId>> cell_neighbour_bels;
- std::unordered_map<BelId, std::unordered_set<IdString>> bel_candidate_cells;
+ dict<IdString, pool<BelId>> cell_neighbour_bels;
+ dict<BelId, pool<IdString>> bel_candidate_cells;
// Map cell ports to net delay limit
- std::unordered_map<std::pair<IdString, IdString>, delay_t, PairHash> max_net_delay;
+ dict<std::pair<IdString, IdString>, delay_t> max_net_delay;
Context *ctx;
TimingOptCfg cfg;
TimingAnalyser tmg;