From 18a48b133754d6390d7e3305d28fe65bbc33c77d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcelina=20Ko=C5=9Bcielnicka?= Date: Wed, 4 May 2022 20:43:59 +0200 Subject: [PATCH] abc: Use dict/pool instead of std::map/std::set --- passes/techmap/abc.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index a37b2a0f3..ff98a6e36 100644 --- a/passes/techmap/abc.cc +++ b/passes/techmap/abc.cc @@ -115,7 +115,7 @@ int map_autoidx; SigMap assign_map; RTLIL::Module *module; std::vector signal_list; -std::map signal_map; +dict signal_map; FfInitVals initvals; pool enabled_gates; bool cmos_cost; @@ -409,7 +409,7 @@ std::string remap_name(RTLIL::IdString abc_name, RTLIL::Wire **orig_wire = nullp return stringf("$abc$%d$%s", map_autoidx, abc_name.c_str()+1); } -void dump_loop_graph(FILE *f, int &nr, std::map> &edges, std::set &workpool, std::vector &in_counts) +void dump_loop_graph(FILE *f, int &nr, dict> &edges, pool &workpool, std::vector &in_counts) { if (f == nullptr) return; @@ -420,7 +420,7 @@ void dump_loop_graph(FILE *f, int &nr, std::map> &edges, std: fprintf(f, " label=\"slide%d\";\n", nr); fprintf(f, " rankdir=\"TD\";\n"); - std::set nodes; + pool nodes; for (auto &e : edges) { nodes.insert(e.first); for (auto n : e.second) @@ -443,9 +443,9 @@ void handle_loops() // http://en.wikipedia.org/wiki/Topological_sorting // (Kahn, Arthur B. (1962), "Topological sorting of large networks") - std::map> edges; + dict> edges; std::vector in_edges_count(signal_list.size()); - std::set workpool; + pool workpool; FILE *dot_f = nullptr; int dot_nr = 0; @@ -1135,7 +1135,7 @@ void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std::strin SigMap mapped_sigmap(mapped_mod); FfInitVals mapped_initvals(&mapped_sigmap, mapped_mod); - std::map cell_stats; + dict cell_stats; for (auto c : mapped_mod->cells()) { if (builtin_lib) @@ -2000,18 +2000,18 @@ struct AbcPass : public Pass { CellTypes ct(design); std::vector all_cells = mod->selected_cells(); - std::set unassigned_cells(all_cells.begin(), all_cells.end()); + pool unassigned_cells(all_cells.begin(), all_cells.end()); - std::set expand_queue, next_expand_queue; - std::set expand_queue_up, next_expand_queue_up; - std::set expand_queue_down, next_expand_queue_down; + pool expand_queue, next_expand_queue; + pool expand_queue_up, next_expand_queue_up; + pool expand_queue_down, next_expand_queue_down; typedef tuple clkdomain_t; - std::map> assigned_cells; - std::map assigned_cells_reverse; + dict> assigned_cells; + dict assigned_cells_reverse; - std::map> cell_to_bit, cell_to_bit_up, cell_to_bit_down; - std::map> bit_to_cell, bit_to_cell_up, bit_to_cell_down; + dict> cell_to_bit, cell_to_bit_up, cell_to_bit_down; + dict> bit_to_cell, bit_to_cell_up, bit_to_cell_down; for (auto cell : all_cells) { -- 2.30.2