Skip to content

Commit affa917

Browse files
committed
write_rtlil: add -sort to match old behavior
1 parent 44fd609 commit affa917

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

backends/rtlil/rtlil_backend.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,14 @@ struct RTLILBackend : public Backend {
416416
log(" -selected\n");
417417
log(" only write selected parts of the design.\n");
418418
log("\n");
419+
log(" -sort\n");
420+
log(" sort design in-place (used to be default).\n");
421+
log("\n");
419422
}
420423
void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) override
421424
{
422425
bool selected = false;
426+
bool do_sort = false;
423427

424428
log_header(design, "Executing RTLIL backend.\n");
425429

@@ -430,12 +434,19 @@ struct RTLILBackend : public Backend {
430434
selected = true;
431435
continue;
432436
}
437+
if (arg == "-sort") {
438+
do_sort = true;
439+
continue;
440+
}
433441
break;
434442
}
435443
extra_args(f, filename, args, argidx);
436444

437445
log("Output filename: %s\n", filename.c_str());
438446

447+
if (do_sort)
448+
design->sort();
449+
439450
*f << stringf("# Generated by %s\n", yosys_maybe_version());
440451
RTLIL_BACKEND::dump_design(*f, design, selected, true, false);
441452
}

0 commit comments

Comments
 (0)