3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-01-17 16:06:27 +00:00
This commit is contained in:
nataliakokoromyti 2026-01-15 20:07:33 +00:00 committed by GitHub
commit d459485de8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 1 deletions

View file

@ -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 {

14
tests/various/debugon.ys Normal file
View file

@ -0,0 +1,14 @@
# Test debug -on/-off modes
design -reset
read_verilog <<EOT
module top(input a, input b, output y);
assign y = a & b;
endmodule
EOT
debug -on
hierarchy
select -assert-count 1 t:$and
debug -off