3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-16 04:20:28 +00:00

sort: init

This commit is contained in:
Emil J. Tywoniak 2025-10-13 17:32:26 +02:00
parent 9570b39519
commit e5edd2acdb
2 changed files with 27 additions and 0 deletions

View file

@ -57,3 +57,4 @@ OBJS += passes/cmds/abstract.o
OBJS += passes/cmds/test_select.o
OBJS += passes/cmds/timeest.o
OBJS += passes/cmds/linecoverage.o
OBJS += passes/cmds/sort.o

26
passes/cmds/sort.cc Normal file
View file

@ -0,0 +1,26 @@
#include "kernel/yosys.h"
USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN
struct SortPass : Pass {
SortPass() : Pass("sort", "sort the design objects") {}
void help() override
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n");
log(" sort\n");
log("\n");
log("Sorts the design objects.\n");
log("\n");
}
void execute(std::vector<std::string> args, RTLIL::Design *d) override
{
log_header(d, "Executing SORT pass.\n");
if (args.size() != 1)
log_cmd_error("This pass takes no arguments.\n");
d->sort();
}
} SortPass;
PRIVATE_NAMESPACE_END