Skip to content

Commit

Permalink
Reset nodes on contention
Browse files Browse the repository at this point in the history
Since contention does a 'partial' resolution of the circuit,
the circuit resolution after contention will likely exit early
because the Input elements' output node value will be unchanged,
therefore might never re-resolve the contended nodes. So it's
necessary to force reset nodes.
  • Loading branch information
gr455 committed Apr 15, 2024
1 parent 27dffd4 commit abed9ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions simulator/src/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,15 @@ export function play(scope = globalScope, resetNodes = false) {
forceResetNodesSet(true);
}
}
// Check for TriState Contentions
// Check for Contentions
if (simulationArea.contentionPending.size() > 0) {
for (const [ourNode, theirNode] of simulationArea.contentionPending.nodes()) {
ourNode.highlighted = true;
theirNode.highlighted = true;
}

showError('Contention Error: One or more bus contentions in the circuit');
forceResetNodesSet(true);
showError('Contention Error: One or more bus contentions in the circuit (check highlighted nodes)');
}
}

Expand Down

0 comments on commit abed9ba

Please sign in to comment.