3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 17:15:33 +00:00

Added topological sorting to techmap

This commit is contained in:
Clifford Wolf 2014-07-27 16:19:24 +02:00
parent 0c86d6106c
commit 5da343b7de
2 changed files with 54 additions and 21 deletions

View file

@ -46,7 +46,7 @@ struct TopoSort
database[right].insert(left);
}
void sort_worker(T n, std::set<T> &marked_cells, std::set<T> &active_cells, std::vector<T> active_stack)
void sort_worker(const T &n, std::set<T> &marked_cells, std::set<T> &active_cells, std::vector<T> &active_stack)
{
if (active_cells.count(n)) {
found_loops = false;
@ -96,6 +96,7 @@ struct TopoSort
for (auto &it : database)
sort_worker(it.first, marked_cells, active_cells, active_stack);
log_assert(SIZE(sorted) == SIZE(database));
return !found_loops;
}
};