Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update submod.cc with -noclean mode #4517

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions passes/hierarchy/submod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ struct SubmodPass : public Pass {
log(" private names so that a subsequent 'flatten; clean' call will restore\n");
log(" the original module with original public names.\n");
log("\n");
log(" -noclean\n");
log(" by default opt_clean is run after. call with -noclean to skip this pass.\n");
log("\n");
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
Expand All @@ -360,6 +363,7 @@ struct SubmodPass : public Pass {
std::string opt_name;
bool copy_mode = false;
bool hidden_mode = false;
bool noclean_mode = false;

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
Expand All @@ -375,13 +379,18 @@ struct SubmodPass : public Pass {
hidden_mode = true;
continue;
}
if (args[argidx] == "-noclean") {
noclean_mode = true;
continue;
}
break;
}
extra_args(args, argidx, design);

if (opt_name.empty())
{
Pass::call(design, "opt_clean");
if (!noclean_mode)
Pass::call(design, "opt_clean");
log_header(design, "Continuing SUBMOD pass.\n");

std::set<RTLIL::IdString> handled_modules;
Expand All @@ -401,7 +410,8 @@ struct SubmodPass : public Pass {
}
}

Pass::call(design, "opt_clean");
if (!noclean_mode)
Pass::call(design, "opt_clean");
}
else
{
Expand All @@ -414,7 +424,8 @@ struct SubmodPass : public Pass {
if (module == nullptr)
log("Nothing selected -> do nothing.\n");
else {
Pass::call_on_module(design, module, "opt_clean");
if (!noclean_mode)
Pass::call_on_module(design, module, "opt_clean");
log_header(design, "Continuing SUBMOD pass.\n");
SubmodWorker worker(design, module, copy_mode, hidden_mode, opt_name);
}
Expand Down
Loading