mirror of
https://github.com/YosysHQ/yosys
synced 2026-01-17 16:06:27 +00:00
Merge ed64df737b into 967b47d984
This commit is contained in:
commit
d459485de8
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 {
|
||||
|
|
|
|||
14
tests/various/debugon.ys
Normal file
14
tests/various/debugon.ys
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue