mirror of
https://github.com/YosysHQ/yosys
synced 2026-02-09 02:25:43 +00:00
Merge pull request #5610 from nataliakokoromyti/upstream-debugon
Add debugon pass for persistent debug logging
This commit is contained in:
commit
317a4d77c7
2 changed files with 44 additions and 1 deletions
|
|
@ -115,16 +115,45 @@ struct DebugPass : public Pass {
|
|||
log("\n");
|
||||
log("Execute the specified command with debug log messages enabled\n");
|
||||
log("\n");
|
||||
log(" debug -on\n");
|
||||
log(" debug -off\n");
|
||||
log("\n");
|
||||
log("Enable or disable debug log messages globally\n");
|
||||
log("\n");
|
||||
}
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) override
|
||||
{
|
||||
size_t argidx;
|
||||
bool mode_on = false;
|
||||
bool mode_off = false;
|
||||
|
||||
for (argidx = 1; argidx < args.size(); argidx++)
|
||||
{
|
||||
// .. parse options ..
|
||||
if (args[argidx] == "-on") {
|
||||
mode_on = true;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-off") {
|
||||
mode_off = true;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (mode_on && mode_off)
|
||||
log_cmd_error("Cannot specify both -on and -off\n");
|
||||
|
||||
if (mode_on) {
|
||||
log_force_debug++;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode_off) {
|
||||
if (log_force_debug > 0)
|
||||
log_force_debug--;
|
||||
return;
|
||||
}
|
||||
|
||||
log_force_debug++;
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue