aboutsummaryrefslogtreecommitdiffstats
path: root/passes/cmds
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-02-27 23:59:59 +0100
committerClifford Wolf <clifford@clifford.at>2017-02-28 00:00:44 +0100
commit1a6c02a5328b3267fef69d12146f1a66eb1c5062 (patch)
tree0ca1f45be5ec971585b0b9c5d1054aaaffabcfc9 /passes/cmds
parentdb7fc0e32d905e7447b7f9f93d611d3d09ad7b24 (diff)
downloadyosys-1a6c02a5328b3267fef69d12146f1a66eb1c5062.tar.gz
yosys-1a6c02a5328b3267fef69d12146f1a66eb1c5062.tar.bz2
yosys-1a6c02a5328b3267fef69d12146f1a66eb1c5062.zip
Add "chformal -assert2assume" and friends
Diffstat (limited to 'passes/cmds')
-rw-r--r--passes/cmds/chformal.cc44
1 files changed, 44 insertions, 0 deletions
diff --git a/passes/cmds/chformal.cc b/passes/cmds/chformal.cc
index 4200a5583..daed80354 100644
--- a/passes/cmds/chformal.cc
+++ b/passes/cmds/chformal.cc
@@ -55,9 +55,20 @@ struct ChformalPass : public Pass {
log(" -skip <N>\n");
log(" ignore activation of the constraint in the first <N> clock cycles\n");
log("\n");
+ log(" -assert2assume\n");
+ log(" -assume2assert\n");
+ log(" -live2fair\n");
+ log(" -fair2live\n");
+ log(" change the roles of cells as indicated. this options can be combined\n");
+ log("\n");
}
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
{
+ bool assert2assume = false;
+ bool assume2assert = false;
+ bool live2fair = false;
+ bool fair2live = false;
+
pool<IdString> constr_types;
char mode = 0;
int mode_arg;
@@ -103,6 +114,26 @@ struct ChformalPass : public Pass {
mode_arg = atoi(args[++argidx].c_str());
continue;
}
+ if ((mode == 0 || mode == 'c') && args[argidx] == "-assert2assume") {
+ assert2assume = true;
+ mode = 'c';
+ continue;
+ }
+ if ((mode == 0 || mode == 'c') && args[argidx] == "-assume2assert") {
+ assume2assert = true;
+ mode = 'c';
+ continue;
+ }
+ if ((mode == 0 || mode == 'c') && args[argidx] == "-live2fair") {
+ live2fair = true;
+ mode = 'c';
+ continue;
+ }
+ if ((mode == 0 || mode == 'c') && args[argidx] == "-fair2live") {
+ fair2live = true;
+ mode = 'c';
+ continue;
+ }
break;
}
extra_args(args, argidx, design);
@@ -231,6 +262,19 @@ struct ChformalPass : public Pass {
for (auto cell : constr_cells)
cell->setPort("\\EN", module->LogicAnd(NEW_ID, en, cell->getPort("\\EN")));
}
+ else
+ if (mode == 'c')
+ {
+ for (auto cell : constr_cells)
+ if (assert2assume && cell->type == "$assert")
+ cell->type = "$assume";
+ else if (assume2assert && cell->type == "$assume")
+ cell->type = "$assert";
+ else if (live2fair && cell->type == "$live")
+ cell->type = "$fair";
+ else if (fair2live && cell->type == "$fair")
+ cell->type = "$live";
+ }
}
}
} ChformalPass;