aboutsummaryrefslogtreecommitdiffstats
path: root/passes/cmds/setattr.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-04-20 12:23:49 -0700
committerEddie Hung <eddie@fpgeh.com>2019-04-20 12:23:49 -0700
commitcaec7f9d2c87e3978c51d0a4171b24cc4b363885 (patch)
tree56dfa79f4f3bad0f38165cf55978058dd7665f4c /passes/cmds/setattr.cc
parentaf4652522fd01aaec84664e65d7fe1474c578c49 (diff)
parentf84a84e3f1a27b361c21fcd30fcf50c1a6586629 (diff)
downloadyosys-caec7f9d2c87e3978c51d0a4171b24cc4b363885.tar.gz
yosys-caec7f9d2c87e3978c51d0a4171b24cc4b363885.tar.bz2
yosys-caec7f9d2c87e3978c51d0a4171b24cc4b363885.zip
Merge remote-tracking branch 'origin/master' into xaig
Diffstat (limited to 'passes/cmds/setattr.cc')
-rw-r--r--passes/cmds/setattr.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/passes/cmds/setattr.cc b/passes/cmds/setattr.cc
index d38a6b3da..b9fcc3e7a 100644
--- a/passes/cmds/setattr.cc
+++ b/passes/cmds/setattr.cc
@@ -128,6 +128,45 @@ struct SetattrPass : public Pass {
}
} SetattrPass;
+struct WbflipPass : public Pass {
+ WbflipPass() : Pass("wbflip", "flip the whitebox attribute") { }
+ void help() YS_OVERRIDE
+ {
+ // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
+ log("\n");
+ log(" wbflip [selection]\n");
+ log("\n");
+ log("Flip the whitebox attribute on selected cells. I.e. if it's set, unset it, and\n");
+ log("vice-versa. Blackbox cells are not effected by this command.\n");
+ log("\n");
+ }
+ void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
+ {
+ size_t argidx;
+ for (argidx = 1; argidx < args.size(); argidx++)
+ {
+ std::string arg = args[argidx];
+ // if (arg == "-mod") {
+ // flag_mod = true;
+ // continue;
+ // }
+ break;
+ }
+ extra_args(args, argidx, design);
+
+ for (Module *module : design->modules())
+ {
+ if (!design->selected(module))
+ continue;
+
+ if (module->get_bool_attribute("\\blackbox"))
+ continue;
+
+ module->set_bool_attribute("\\whitebox", !module->get_bool_attribute("\\whitebox"));
+ }
+ }
+} WbflipPass;
+
struct SetparamPass : public Pass {
SetparamPass() : Pass("setparam", "set/unset parameters on objects") { }
void help() YS_OVERRIDE