aboutsummaryrefslogtreecommitdiffstats
path: root/passes/cmds/bugpoint.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-04-24 11:17:09 -0700
committerEddie Hung <eddie@fpgeh.com>2020-04-24 11:17:09 -0700
commit4bfe6ebea929fb221853f775570ec5c7ccc5fac4 (patch)
treeb126882b8bbd309ec8239ecf2019978dbf99c3eb /passes/cmds/bugpoint.cc
parentbf021a0e1f0883c017242d4a2057d2acf239330b (diff)
downloadyosys-4bfe6ebea929fb221853f775570ec5c7ccc5fac4.tar.gz
yosys-4bfe6ebea929fb221853f775570ec5c7ccc5fac4.tar.bz2
yosys-4bfe6ebea929fb221853f775570ec5c7ccc5fac4.zip
bugpoint: skip ports with (* keep *) on; add header
Diffstat (limited to 'passes/cmds/bugpoint.cc')
-rw-r--r--passes/cmds/bugpoint.cc27
1 files changed, 18 insertions, 9 deletions
diff --git a/passes/cmds/bugpoint.cc b/passes/cmds/bugpoint.cc
index 4668da4bd..2bdd551af 100644
--- a/passes/cmds/bugpoint.cc
+++ b/passes/cmds/bugpoint.cc
@@ -66,7 +66,8 @@ struct BugpointPass : public Pass {
log(" try to remove modules.\n");
log("\n");
log(" -ports\n");
- log(" try to remove module ports.\n");
+ log(" try to remove module ports. ports with a (* keep *) attribute will be\n");
+ log(" skipped (useful for clocks, resets, etc.)\n");
log("\n");
log(" -cells\n");
log(" try to remove cells.\n");
@@ -162,18 +163,21 @@ struct BugpointPass : public Pass {
for (auto wire : mod->wires())
{
+ if (!wire->port_id)
+ continue;
+
if (!stage2 && wire->get_bool_attribute(ID($bugpoint)))
continue;
- if (wire->port_input || wire->port_output)
+ if (wire->get_bool_attribute(ID::keep))
+ continue;
+
+ if (index++ == seed)
{
- if (index++ == seed)
- {
- log("Trying to remove module port %s.\n", log_signal(wire));
- wire->port_input = wire->port_output = false;
- mod->fixup_ports();
- return design_copy;
- }
+ log("Trying to remove module port %s.\n", log_signal(wire));
+ wire->port_input = wire->port_output = false;
+ mod->fixup_ports();
+ return design_copy;
}
}
}
@@ -306,6 +310,9 @@ struct BugpointPass : public Pass {
bool fast = false, clean = false;
bool modules = false, ports = false, cells = false, connections = false, assigns = false, updates = false, has_part = false;
+ log_header(design, "Executing BUGPOINT pass (minimize testcases).\n");
+ log_push();
+
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
{
@@ -449,6 +456,8 @@ struct BugpointPass : public Pass {
design->add(module->clone());
delete crashing_design;
}
+
+ log_pop();
}
} BugpointPass;