3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

Activity clear pass

This commit is contained in:
Alain Dargelas 2024-10-17 11:02:35 -07:00
parent 6d4d6a6eff
commit 151be52500

View file

@ -126,6 +126,22 @@ struct ActivityProp {
}
};
struct ActivityClear {
Module *module;
ActivityClear(Module *module) : module(module)
{
for (Wire *wire : module->wires()) {
wire->set_string_attribute("$ACKT", "");
wire->set_string_attribute("$DUTY", "");
}
for (auto cell : module->cells()) {
cell->set_string_attribute("$ACKT:", "");
cell->set_string_attribute("$DUTY:", "");
}
}
};
struct ActivityPropPass : public Pass {
ActivityPropPass() : Pass("activity_prop", "Attaches wire activity to cell ports") {}
void help() override
@ -152,4 +168,31 @@ struct ActivityPropPass : public Pass {
}
} ActivityPropPass;
struct ActivityClearPass : public Pass {
ActivityClearPass() : Pass("activity_clear", "Clears activity attached to cells and wires") {}
void help() override
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n");
log(" activity_clear\n");
log("\n");
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
{
log_header(design, "Executing Activity clearing pass\n");
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
// No options currently. When adding in the future make sure to update docstring with [options]
break;
}
extra_args(args, argidx, design);
for (auto module : design->modules()) {
ActivityClear worker(module);
}
}
} ActivityClearPass;
PRIVATE_NAMESPACE_END