Skip to content

Commit

Permalink
liberty: fix clear and preset latches
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Feb 17, 2025
1 parent 38f8583 commit 2b33937
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontends/liberty/liberty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static bool create_latch(RTLIL::Module *module, const LibertyAst *node, bool fla
RTLIL::Cell *enable_gate = module->addCell(NEW_ID, enable_polarity ? ID($_OR_) : ID($_AND_));
enable_gate->setPort(ID::A, enable_sig);
enable_gate->setPort(ID::B, clear_enable);
enable_gate->setPort(ID::Y, data_sig = module->addWire(NEW_ID));
enable_gate->setPort(ID::Y, enable_sig = module->addWire(NEW_ID));
}

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

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

0 comments on commit 2b33937

Please sign in to comment.