wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
PrioritiesInternal Namespace Reference

Functions

template<typename T>
void legacyCalculatePriorities (const QVector< T * > &elements, const QHash< T *, QVector< T * > > &successors, QHash< T *, int > &outPriorities)
 Legacy iterative DFS priority calculation, used for cyclic graphs only.

Function Documentation

◆ legacyCalculatePriorities()

template<typename T>
void PrioritiesInternal::legacyCalculatePriorities ( const QVector< T * > & elements,
const QHash< T *, QVector< T * > > & successors,
QHash< T *, int > & outPriorities )

Legacy iterative DFS priority calculation, used for cyclic graphs only.

Treats any successor that is pending on the explicit stack as a feedback edge and assigns the current node early, from already-computed successors only. On cycle-free graphs this mis-classifies pending siblings as feedback and produces iteration-order-dependent priorities (see calculatePriorities below for the correct DAG path). On cyclic graphs the resulting order is what the simulation's iterative settling and the gate-built latch circuits (SR/JK/D master-slave ICs) were built around: zero-delay latch races have no graph-derivable "correct" evaluation order, and changing the order flips which stable state a latch settles into from an undetermined start. Keep this path byte-for-byte stable unless the settling semantics are redesigned.

Definition at line 131 of file Priorities.h.

Referenced by calculatePriorities().