Skip to content

Commit

Permalink
Internals: Optimize clearFired (verilator#5753)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnyder committed Jan 30, 2025
1 parent a379382 commit e0e164c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/V3SenExprBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,11 @@ class SenExprBuilder final {
case VEdgeType::ET_EVENT: {
UASSERT_OBJ(v3Global.hasEvents(), senItemp, "Inconsistent");
{
// If the event is fired, set up the clearing process
AstCMethodHard* const callp = new AstCMethodHard{flp, currp(), "isFired"};
callp->dtypeSetBit();
AstIf* const ifp = new AstIf{flp, callp};
m_postUpdates.push_back(ifp);

// Clear 'fired' state when done
// No need to check if the event was fired, we need the flag clear regardless
AstCMethodHard* const clearp = new AstCMethodHard{flp, currp(), "clearFired"};
clearp->dtypeSetVoid();
ifp->addThensp(clearp->makeStmt());
m_postUpdates.push_back(clearp->makeStmt());
}

// Get 'fired' state
Expand Down

0 comments on commit e0e164c

Please sign in to comment.