Skip to content

Commit 39aacc9

Browse files
authored
Merge pull request #4907 from YosysHQ/emil/fix-clear-preset-latch
liberty: fix clear and preset latches
2 parents 0dfd9e9 + 2b33937 commit 39aacc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontends/liberty/liberty.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static bool create_latch(RTLIL::Module *module, const LibertyAst *node, bool fla
348348
RTLIL::Cell *enable_gate = module->addCell(NEW_ID, enable_polarity ? ID($_OR_) : ID($_AND_));
349349
enable_gate->setPort(ID::A, enable_sig);
350350
enable_gate->setPort(ID::B, clear_enable);
351-
enable_gate->setPort(ID::Y, data_sig = module->addWire(NEW_ID));
351+
enable_gate->setPort(ID::Y, enable_sig = module->addWire(NEW_ID));
352352
}
353353

354354
if (preset_sig.size() == 1)
@@ -376,7 +376,7 @@ static bool create_latch(RTLIL::Module *module, const LibertyAst *node, bool fla
376376
RTLIL::Cell *enable_gate = module->addCell(NEW_ID, enable_polarity ? ID($_OR_) : ID($_AND_));
377377
enable_gate->setPort(ID::A, enable_sig);
378378
enable_gate->setPort(ID::B, preset_enable);
379-
enable_gate->setPort(ID::Y, data_sig = module->addWire(NEW_ID));
379+
enable_gate->setPort(ID::Y, enable_sig = module->addWire(NEW_ID));
380380
}
381381

382382
cell = module->addCell(NEW_ID, stringf("$_DLATCH_%c_", enable_polarity ? 'P' : 'N'));

0 commit comments

Comments
 (0)