mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-12 20:18:20 +00:00
bugpoint: skip ports with (* keep *) on; add header
This commit is contained in:
parent
bf021a0e1f
commit
4bfe6ebea9
|
@ -66,7 +66,8 @@ struct BugpointPass : public Pass {
|
||||||
log(" try to remove modules.\n");
|
log(" try to remove modules.\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
log(" -ports\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("\n");
|
||||||
log(" -cells\n");
|
log(" -cells\n");
|
||||||
log(" try to remove cells.\n");
|
log(" try to remove cells.\n");
|
||||||
|
@ -162,18 +163,21 @@ struct BugpointPass : public Pass {
|
||||||
|
|
||||||
for (auto wire : mod->wires())
|
for (auto wire : mod->wires())
|
||||||
{
|
{
|
||||||
|
if (!wire->port_id)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!stage2 && wire->get_bool_attribute(ID($bugpoint)))
|
if (!stage2 && wire->get_bool_attribute(ID($bugpoint)))
|
||||||
continue;
|
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;
|
||||||
log("Trying to remove module port %s.\n", log_signal(wire));
|
mod->fixup_ports();
|
||||||
wire->port_input = wire->port_output = false;
|
return design_copy;
|
||||||
mod->fixup_ports();
|
|
||||||
return design_copy;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -306,6 +310,9 @@ struct BugpointPass : public Pass {
|
||||||
bool fast = false, clean = false;
|
bool fast = false, clean = false;
|
||||||
bool modules = false, ports = false, cells = false, connections = false, assigns = false, updates = false, has_part = 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;
|
size_t argidx;
|
||||||
for (argidx = 1; argidx < args.size(); argidx++)
|
for (argidx = 1; argidx < args.size(); argidx++)
|
||||||
{
|
{
|
||||||
|
@ -449,6 +456,8 @@ struct BugpointPass : public Pass {
|
||||||
design->add(module->clone());
|
design->add(module->clone());
|
||||||
delete crashing_design;
|
delete crashing_design;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log_pop();
|
||||||
}
|
}
|
||||||
} BugpointPass;
|
} BugpointPass;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue