aboutsummaryrefslogtreecommitdiffstats
path: root/common/timing_opt.cc
diff options
context:
space:
mode:
Diffstat (limited to 'common/timing_opt.cc')
-rw-r--r--common/timing_opt.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/common/timing_opt.cc b/common/timing_opt.cc
index 854cbc5b..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
@@ -68,8 +66,8 @@ class TimingOptimiser
void setup_delay_limits()
{
max_net_delay.clear();
- for (auto net : sorted(ctx->nets)) {
- NetInfo *ni = net.second;
+ for (auto &net : ctx->nets) {
+ NetInfo *ni = net.second.get();
if (ni->driver.cell == nullptr)
continue;
for (auto usr : ni->users) {
@@ -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
@@ -239,7 +237,7 @@ class TimingOptimiser
std::vector<std::pair<NetInfo *, int>> crit_nets;
std::vector<IdString> netnames;
std::transform(ctx->nets.begin(), ctx->nets.end(), std::back_inserter(netnames),
- [](const std::pair<const IdString, std::unique_ptr<NetInfo>> &kv) { return kv.first; });
+ [](const std::pair<IdString, std::unique_ptr<NetInfo>> &kv) { return kv.first; });
ctx->sorted_shuffle(netnames);
for (auto net : netnames) {
if (crit_nets.size() >= max_count)
@@ -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;