Skip to content

Commit 7d223eb

Browse files
committedOct 14, 2021
chformal: Add -coverprecond option
This inserts $cover cells to cover the enable signal (precondition) for the selected formal cells.
1 parent 50be8fd commit 7d223eb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

‎passes/cmds/chformal.cc

+14
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ struct ChformalPass : public Pass {
5555
log(" -skip <N>\n");
5656
log(" ignore activation of the constraint in the first <N> clock cycles\n");
5757
log("\n");
58+
log(" -coverprecond\n");
59+
log(" add a cover statement for the precondition (enable signal) of the cells\n");
60+
log("\n");
5861
log(" -assert2assume\n");
5962
log(" -assume2assert\n");
6063
log(" -live2fair\n");
@@ -114,6 +117,10 @@ struct ChformalPass : public Pass {
114117
mode_arg = atoi(args[++argidx].c_str());
115118
continue;
116119
}
120+
if (mode == 0 && args[argidx] == "-coverprecond") {
121+
mode = 'p';
122+
continue;
123+
}
117124
if ((mode == 0 || mode == 'c') && args[argidx] == "-assert2assume") {
118125
assert2assume = true;
119126
mode = 'c';
@@ -263,6 +270,13 @@ struct ChformalPass : public Pass {
263270
cell->setPort(ID::EN, module->LogicAnd(NEW_ID, en, cell->getPort(ID::EN)));
264271
}
265272
else
273+
if (mode =='p')
274+
{
275+
for (auto cell : constr_cells)
276+
module->addCover(NEW_ID, cell->getPort(ID::EN), State::S1,
277+
"$auto$coverprecond$" + cell->get_src_attribute());
278+
}
279+
else
266280
if (mode == 'c')
267281
{
268282
for (auto cell : constr_cells)

0 commit comments

Comments
 (0)