From ecc19c2c083f7e3ed7da95557731ded803d2cb1d Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 2 Jun 2021 10:01:36 +0100 Subject: Using hashlib in arches Signed-off-by: gatecat --- ecp5/pack.cc | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'ecp5/pack.cc') diff --git a/ecp5/pack.cc b/ecp5/pack.cc index db5d22a1..19eda9e2 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -21,7 +21,6 @@ #include #include #include -#include #include "cells.h" #include "chain_utils.h" #include "design_utils.h" @@ -261,7 +260,7 @@ class Ecp5Packer void pair_luts() { log_info("Finding LUT-LUT pairs...\n"); - std::unordered_set procdLuts; + pool procdLuts; for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (is_lut(ctx, ci) && procdLuts.find(cell.first) == procdLuts.end()) { @@ -1134,7 +1133,7 @@ class Ecp5Packer // Used for packing an FF into a nearby SLICE template CellInfo *find_nearby_cell(CellInfo *origin, TFunc Func) { - std::unordered_set visited_cells; + pool visited_cells; std::queue to_visit; visited_cells.insert(origin); to_visit.push(origin); @@ -1971,7 +1970,7 @@ class Ecp5Packer IdString global_name = ctx->id("G_BANK" + std::to_string(bank) + "ECLK" + std::to_string(found_eclk)); std::queue upstream; - std::unordered_map backtrace; + dict backtrace; upstream.push(userWire); WireId next; while (true) { @@ -2026,7 +2025,7 @@ class Ecp5Packer new_cells.push_back(std::move(zero_cell)); } - std::unordered_map> dqsbuf_dqsg; + dict> dqsbuf_dqsg; // Pack DQSBUFs void pack_dqsbuf() { @@ -2119,7 +2118,7 @@ class Ecp5Packer // Pack IOLOGIC void pack_iologic() { - std::unordered_map pio_iologic; + dict pio_iologic; auto set_iologic_sclk = [&](CellInfo *iol, CellInfo *prim, IdString port, bool input, bool disconnect = true) { NetInfo *sclk = nullptr; @@ -2779,7 +2778,7 @@ class Ecp5Packer } } flush_cells(); - std::unordered_set used_eclksyncb; + pool used_eclksyncb; for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (ci->type == id_CLKDIVF) { @@ -2967,7 +2966,7 @@ class Ecp5Packer auto equals_epsilon = [](delay_t a, delay_t b) { return (std::abs(a - b) / std::max(double(b), 1.0)) < 1e-3; }; - std::unordered_set user_constrained, changed_nets; + pool user_constrained, changed_nets; for (auto &net : ctx->nets) { if (net.second->clkconstr != nullptr) user_constrained.insert(net.first); @@ -3041,7 +3040,7 @@ class Ecp5Packer const int itermax = 5000; while (!changed_nets.empty() && iter < itermax) { ++iter; - std::unordered_set changed_cells; + pool changed_cells; for (auto net : changed_nets) { for (auto &user : ctx->nets.at(net)->users) if (user.port == id_CLKI || user.port == id_ECLKI || user.port == id_CLK0 || user.port == id_CLK1) @@ -3051,7 +3050,7 @@ class Ecp5Packer changed_cells.insert(drv.cell->name); } changed_nets.clear(); - for (auto cell : sorted(changed_cells)) { + for (auto cell : changed_cells) { CellInfo *ci = ctx->cells.at(cell).get(); if (ci->type == id_CLKDIVF) { std::string div = str_or_default(ci->params, ctx->id("DIV"), "2.0"); @@ -3152,7 +3151,7 @@ class Ecp5Packer private: Context *ctx; - std::unordered_set packed_cells; + pool packed_cells; std::vector> new_cells; struct SliceUsage @@ -3163,10 +3162,10 @@ class Ecp5Packer bool mux5_used = false, muxx_used = false; }; - std::unordered_map sliceUsage; - std::unordered_map lutffPairs; - std::unordered_map fflutPairs; - std::unordered_map lutPairs; + dict sliceUsage; + dict lutffPairs; + dict fflutPairs; + dict lutPairs; }; // Main pack function bool Arch::pack() -- cgit v1.2.3