Skip to content

Commit

Permalink
cleanup: extra_args and argidx
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Apr 2, 2024
1 parent b9d3bff commit 23673a8
Show file tree
Hide file tree
Showing 39 changed files with 43 additions and 315 deletions.
10 changes: 1 addition & 9 deletions passes/cmds/autoname.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,7 @@ struct AutonamePass : public Pass {
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
// if (args[argidx] == "-foo") {
// foo = true;
// continue;
// }
break;
}
extra_args(args, 1, design);

log_header(design, "Executing AUTONAME pass.\n");

Expand Down
10 changes: 1 addition & 9 deletions passes/cmds/blackbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,7 @@ struct BlackboxPass : public Pass {
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
// if (args[argidx] == "-???") {
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

for (auto module : design->selected_whole_modules_warn(true))
{
Expand Down
7 changes: 1 addition & 6 deletions passes/cmds/clean_zerowidth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@ struct CleanZeroWidthPass : public Pass {

void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

CellTypes ct;
ct.setup();
Expand Down
10 changes: 1 addition & 9 deletions passes/cmds/edgetypes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,7 @@ struct EdgetypePass : public Pass {
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
// if (args[argidx] == "-ltr") {
// config.ltr = true;
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

pool<string> edge_cache;

Expand Down
9 changes: 1 addition & 8 deletions passes/cmds/future.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,7 @@ struct FuturePass : public Pass {
FutureOptions options;

log_header(design, "Executing FUTURE pass.\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {

break;
}

extra_args(args, argidx, design);
extra_args(args, 1, design);

for (auto module : design->selected_modules()) {
FutureWorker worker(module, options);
Expand Down
3 changes: 1 addition & 2 deletions passes/cmds/printattrs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ struct PrintAttrsPass : public Pass {

void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx = 1;
extra_args(args, argidx, design);
extra_args(args, 1, design);

unsigned int indent = 0;
for (auto mod : design->selected_modules())
Expand Down
3 changes: 1 addition & 2 deletions passes/cmds/select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1713,8 +1713,7 @@ struct LsPass : public Pass {
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx = 1;
extra_args(args, argidx, design);
extra_args(args, 1, design);

if (design->selected_active_module.empty())
{
Expand Down
12 changes: 1 addition & 11 deletions passes/cmds/setattr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,7 @@ struct WbflipPass : public Pass {
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
std::string arg = args[argidx];
// if (arg == "-mod") {
// flag_mod = true;
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

for (Module *module : design->modules())
{
Expand Down
11 changes: 1 addition & 10 deletions passes/cmds/sta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,16 +289,7 @@ struct StaPass : public Pass {
{
log_header(design, "Executing STA pass (static timing analysis).\n");

/*
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
if (args[argidx] == "-TODO") {
continue;
}
break;
}
*/

// TODO: there was a commented out -TODO argument
extra_args(args, 1, design);

for (Module *module : design->selected_modules())
Expand Down
15 changes: 2 additions & 13 deletions passes/cmds/trace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@ struct TracePass : public Pass {
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
// .. parse options ..
break;
}

size_t argidx = 1;
TraceMonitor monitor;
design->monitors.insert(&monitor);

Expand Down Expand Up @@ -107,12 +101,7 @@ struct DebugPass : public Pass {
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
// .. parse options ..
break;
}
size_t argidx = 1;

log_force_debug++;

Expand Down
10 changes: 1 addition & 9 deletions passes/equiv/equiv_mark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,7 @@ struct EquivMarkPass : public Pass {
void execute(std::vector<std::string> args, Design *design) override
{
log_header(design, "Executing EQUIV_MARK pass.\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
// if (args[argidx] == "-foobar") {
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

for (auto module : design->selected_whole_modules_warn()) {
EquivMarkWorker worker(module);
Expand Down
10 changes: 1 addition & 9 deletions passes/equiv/equiv_purge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,7 @@ struct EquivPurgePass : public Pass {
void execute(std::vector<std::string> args, Design *design) override
{
log_header(design, "Executing EQUIV_PURGE pass.\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
// if (args[argidx] == "-foobar") {
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

for (auto module : design->selected_whole_modules_warn()) {
EquivPurgeWorker worker(module);
Expand Down
12 changes: 1 addition & 11 deletions passes/hierarchy/uniquify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,7 @@ struct UniquifyPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing UNIQUIFY pass (creating unique copies of modules).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
// if (args[argidx] == "-check") {
// flag_check = true;
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

bool did_something = true;
int count = 0;
Expand Down
7 changes: 1 addition & 6 deletions passes/memory/memory_bmux2rom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ struct MemoryBmux2RomPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing MEMORY_BMUX2ROM pass (converting muxes to ROMs).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

for (auto module : design->selected_modules()) {
for (auto cell : module->selected_cells()) {
Expand Down
7 changes: 1 addition & 6 deletions passes/memory/memory_narrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ struct MemoryNarrowPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing MEMORY_NARROW pass (splitting up wide memory ports).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

for (auto module : design->selected_modules()) {
if (module->has_processes_warn())
Expand Down
8 changes: 1 addition & 7 deletions passes/opt/muxpack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,7 @@ struct MuxpackPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing MUXPACK pass ($mux cell cascades to $pmux).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

int mux_count = 0;
int pmux_count = 0;
Expand Down
4 changes: 1 addition & 3 deletions passes/opt/opt_demorgan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ struct OptDemorganPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing OPT_DEMORGAN pass (push inverters through $reduce_* cells).\n");

int argidx = 0;
extra_args(args, argidx, design);
extra_args(args, 1, design);

unsigned int cells_changed = 0;
for (auto module : design->selected_modules())
Expand Down
8 changes: 1 addition & 7 deletions passes/opt/opt_ffinv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,7 @@ struct OptFfInvPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing OPT_FFINV pass (push inverters through FFs).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

int total_count = 0;
for (auto module : design->selected_modules())
Expand Down
11 changes: 1 addition & 10 deletions passes/opt/opt_mem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,7 @@ struct OptMemPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing OPT_MEM pass (optimize memories).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
// if (args[argidx] == "-nomux") {
// mode_nomux = true;
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

int total_count = 0;
for (auto module : design->selected_modules()) {
Expand Down
11 changes: 1 addition & 10 deletions passes/opt/opt_mem_widen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ struct OptMemWidenPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing OPT_MEM_WIDEN pass (optimize memories where all ports are wide).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
// if (args[argidx] == "-nomux") {
// mode_nomux = true;
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

int total_count = 0;
for (auto module : design->selected_modules()) {
Expand Down
4 changes: 1 addition & 3 deletions passes/opt/rmports.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ struct RmportsPassPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing RMPORTS pass (remove ports with no connections).\n");

size_t argidx = 1;
extra_args(args, argidx, design);
extra_args(args, 1, design);

// The set of ports we removed
dict<IdString, pool<IdString>> removed_ports;
Expand Down
12 changes: 1 addition & 11 deletions passes/pmgen/ice40_dsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,7 @@ struct Ice40DspPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing ICE40_DSP pass (map multipliers).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
// if (args[argidx] == "-singleton") {
// singleton_mode = true;
// continue;
// }
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

for (auto module : design->selected_modules())
ice40_dsp_pm(module, module->selected_cells()).run_ice40_dsp(create_ice40_dsp);
Expand Down
8 changes: 1 addition & 7 deletions passes/pmgen/peepopt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ struct PeepoptPass : public Pass {
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing PEEPOPT pass (run peephole optimizers).\n");

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
break;
}
extra_args(args, argidx, design);
extra_args(args, 1, design);

for (auto module : design->selected_modules())
{
Expand Down
Loading

0 comments on commit 23673a8

Please sign in to comment.