mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 17:15:33 +00:00
More idstring sort_by_* helpers and fixed tpl ordering in techmap
This commit is contained in:
parent
8ff71b5ae5
commit
ca87116449
4 changed files with 22 additions and 10 deletions
|
@ -30,12 +30,12 @@ struct FsmExpand
|
|||
RTLIL::Module *module;
|
||||
RTLIL::Cell *fsm_cell;
|
||||
SigMap assign_map;
|
||||
SigSet<RTLIL::Cell*, RTLIL::sort_by_name<RTLIL::Cell>> sig2driver, sig2user;
|
||||
SigSet<RTLIL::Cell*, RTLIL::sort_by_name_id<RTLIL::Cell>> sig2driver, sig2user;
|
||||
CellTypes ct;
|
||||
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name<RTLIL::Cell>> merged_set;
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name<RTLIL::Cell>> current_set;
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name<RTLIL::Cell>> no_candidate_set;
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name_id<RTLIL::Cell>> merged_set;
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name_id<RTLIL::Cell>> current_set;
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name_id<RTLIL::Cell>> no_candidate_set;
|
||||
|
||||
bool already_optimized;
|
||||
int limit_transitions;
|
||||
|
|
|
@ -34,7 +34,7 @@ static int count_rm_cells, count_rm_wires;
|
|||
static void rmunused_module_cells(RTLIL::Module *module, bool verbose)
|
||||
{
|
||||
SigMap assign_map(module);
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name<RTLIL::Cell>> queue, unused;
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name_id<RTLIL::Cell>> queue, unused;
|
||||
|
||||
SigSet<RTLIL::Cell*> wire2driver;
|
||||
for (auto &it : module->cells_) {
|
||||
|
@ -65,7 +65,7 @@ static void rmunused_module_cells(RTLIL::Module *module, bool verbose)
|
|||
|
||||
while (queue.size() > 0)
|
||||
{
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name<RTLIL::Cell>> new_queue;
|
||||
std::set<RTLIL::Cell*, RTLIL::sort_by_name_id<RTLIL::Cell>> new_queue;
|
||||
for (auto cell : queue)
|
||||
unused.erase(cell);
|
||||
for (auto cell : queue) {
|
||||
|
|
|
@ -251,7 +251,7 @@ struct TechmapWorker
|
|||
}
|
||||
|
||||
bool techmap_module(RTLIL::Design *design, RTLIL::Module *module, RTLIL::Design *map, std::set<RTLIL::Cell*> &handled_cells,
|
||||
const std::map<RTLIL::IdString, std::set<RTLIL::IdString>> &celltypeMap, bool in_recursion)
|
||||
const std::map<RTLIL::IdString, std::set<RTLIL::IdString, RTLIL::sort_by_id_str>> &celltypeMap, bool in_recursion)
|
||||
{
|
||||
std::string mapmsg_prefix = in_recursion ? "Recursively mapping" : "Mapping";
|
||||
|
||||
|
@ -898,7 +898,7 @@ struct TechmapPass : public Pass {
|
|||
}
|
||||
map->modules_.swap(modules_new);
|
||||
|
||||
std::map<RTLIL::IdString, std::set<RTLIL::IdString>> celltypeMap;
|
||||
std::map<RTLIL::IdString, std::set<RTLIL::IdString, RTLIL::sort_by_id_str>> celltypeMap;
|
||||
for (auto &it : map->modules_) {
|
||||
if (it.second->attributes.count("\\techmap_celltype") && !it.second->attributes.at("\\techmap_celltype").bits.empty()) {
|
||||
char *p = strdup(it.second->attributes.at("\\techmap_celltype").decode_string().c_str());
|
||||
|
@ -960,7 +960,7 @@ struct FlattenPass : public Pass {
|
|||
TechmapWorker worker;
|
||||
worker.flatten_mode = true;
|
||||
|
||||
std::map<RTLIL::IdString, std::set<RTLIL::IdString>> celltypeMap;
|
||||
std::map<RTLIL::IdString, std::set<RTLIL::IdString, RTLIL::sort_by_id_str>> celltypeMap;
|
||||
for (auto &it : design->modules_)
|
||||
celltypeMap[it.first].insert(it.first);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue