From 897e2c2fdc43bcf097aa8805c424c4443bcefad5 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 2 Jun 2021 11:44:57 +0100 Subject: Use hashlib in frontend, where possible Signed-off-by: gatecat --- frontend/frontend_base.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/frontend_base.h b/frontend/frontend_base.h index d39a8304..4fb71076 100644 --- a/frontend/frontend_base.h +++ b/frontend/frontend_base.h @@ -118,7 +118,7 @@ struct ModuleInfo { bool is_top = false, is_blackbox = false, is_whitebox = false; inline bool is_box() const { return is_blackbox || is_whitebox; } - std::unordered_set instantiated_celltypes; + pool instantiated_celltypes; }; template struct GenericFrontend @@ -148,7 +148,7 @@ template struct GenericFrontend using netname_dat_t = typename FrontendType::NetnameDataType; using bitvector_t = typename FrontendType::BitVectorDataType; - std::unordered_map mods; + dict mods; std::unordered_map mod_refs; IdString top; @@ -196,7 +196,7 @@ template struct GenericFrontend } // Finally, attempt to autodetect the top module using hierarchy // (a module that is not a box and is not used as a cell by any other module) - std::unordered_set candidate_top; + pool candidate_top; for (auto &mod : mods) if (!mod.second.is_box()) candidate_top.insert(mod.first); @@ -207,7 +207,7 @@ template struct GenericFrontend if (candidate_top.size() == 0) log_info("No candidate top level modules.\n"); else - for (auto ctp : sorted(candidate_top)) + for (auto ctp : candidate_top) log_info("Candidate top module: '%s'\n", ctx->nameOf(ctp)); log_error("Failed to autodetect top module, please specify using --top.\n"); } @@ -256,7 +256,7 @@ template struct GenericFrontend index_to_net_flatindex.resize(idx + 1, -1); return index_to_net_flatindex.at(idx); } - std::unordered_map> port_to_bus; + dict> port_to_bus; // All of the names given to a net std::vector> net_names; }; @@ -453,7 +453,7 @@ template struct GenericFrontend CellInfo *ci = ctx->createCell(inst_name, ctx->id(impl.get_cell_type(cd))); ci->hierpath = m.path; // Import port directions - std::unordered_map port_dirs; + dict port_dirs; impl.foreach_port_dir(cd, [&](const std::string &port, PortType dir) { port_dirs[ctx->id(port)] = dir; }); // Import port connectivity impl.foreach_port_conn(cd, [&](const std::string &name, const bitvector_t &bits) { -- cgit v1.2.3