aboutsummaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-06-02 11:44:57 +0100
committergatecat <gatecat@ds0.me>2021-06-02 15:05:20 +0100
commit897e2c2fdc43bcf097aa8805c424c4443bcefad5 (patch)
tree65e82833ae7ee86bcb5ccccc0e7864822f4fcc48 /frontend
parenteca1a4cee4f310c7e2c1216bd678143c1967edd4 (diff)
downloadnextpnr-897e2c2fdc43bcf097aa8805c424c4443bcefad5.tar.gz
nextpnr-897e2c2fdc43bcf097aa8805c424c4443bcefad5.tar.bz2
nextpnr-897e2c2fdc43bcf097aa8805c424c4443bcefad5.zip
Use hashlib in frontend, where possible
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'frontend')
-rw-r--r--frontend/frontend_base.h12
1 files 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<IdString> instantiated_celltypes;
+ pool<IdString> instantiated_celltypes;
};
template <typename FrontendType> struct GenericFrontend
@@ -148,7 +148,7 @@ template <typename FrontendType> struct GenericFrontend
using netname_dat_t = typename FrontendType::NetnameDataType;
using bitvector_t = typename FrontendType::BitVectorDataType;
- std::unordered_map<IdString, ModuleInfo> mods;
+ dict<IdString, ModuleInfo> mods;
std::unordered_map<IdString, const mod_dat_t> mod_refs;
IdString top;
@@ -196,7 +196,7 @@ template <typename FrontendType> 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<IdString> candidate_top;
+ pool<IdString> candidate_top;
for (auto &mod : mods)
if (!mod.second.is_box())
candidate_top.insert(mod.first);
@@ -207,7 +207,7 @@ template <typename FrontendType> 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 <typename FrontendType> struct GenericFrontend
index_to_net_flatindex.resize(idx + 1, -1);
return index_to_net_flatindex.at(idx);
}
- std::unordered_map<IdString, std::vector<int>> port_to_bus;
+ dict<IdString, std::vector<int>> port_to_bus;
// All of the names given to a net
std::vector<std::vector<std::string>> net_names;
};
@@ -453,7 +453,7 @@ template <typename FrontendType> 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<IdString, PortType> port_dirs;
+ dict<IdString, PortType> 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) {