3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-22 08:35:32 +00:00

Add equiv_opt -post

This commit is contained in:
Akash Levy 2025-02-04 20:02:55 -08:00
parent 20c358bce2
commit be77aad820

View file

@ -66,13 +66,16 @@ struct EquivOptPass:public ScriptPass
log(" -nocheck\n");
log(" disable running check before and after the command under test.\n");
log("\n");
log(" -post\n");
log(" keep post-opt design instead of pre-opt design during restore.\n");
log("\n");
log("The following commands are executed by this verification command:\n");
help_script();
log("\n");
}
std::string command, techmap_opts, make_opts;
bool assert, undef, multiclock, async2sync, nocheck;
bool assert, undef, multiclock, async2sync, nocheck, post;
void clear_flags() override
{
@ -84,6 +87,7 @@ struct EquivOptPass:public ScriptPass
multiclock = false;
async2sync = false;
nocheck = false;
post = false;
}
void execute(std::vector < std::string > args, RTLIL::Design * design) override
@ -121,6 +125,10 @@ struct EquivOptPass:public ScriptPass
nocheck = true;
continue;
}
if (args[argidx] == "-post") {
post = true;
continue;
}
if (args[argidx] == "-multiclock") {
multiclock = true;
continue;
@ -219,7 +227,10 @@ struct EquivOptPass:public ScriptPass
}
if (check_label("restore")) {
run("design -load preopt");
if (post)
run("design -load postopt");
else
run("design -load preopt");
}
}
} EquivOptPass;