File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -1218,4 +1218,27 @@ std::vector<simulator_id_t> Evaluator::getPinSimulatorIds(const Address& address
1218
1218
1219
1219
std::vector<logic_state_t > Evaluator::getStatesFromSimulatorIds (const std::vector<simulator_id_t >& simulatorIds) const {
1220
1220
return evalSimulator.getStatesFromSimulatorIds (simulatorIds);
1221
+ }
1222
+
1223
+ void Evaluator::connectListener (
1224
+ void * object,
1225
+ const Address& address,
1226
+ SimulatorMappingUpdateListenerFunction func
1227
+ ) {
1228
+ std::optional<eval_circuit_id_t > evalCircuitId = evalCircuitContainer.traverseToTopLevelIC (address);
1229
+ if (!evalCircuitId) {
1230
+ logError (" Failed to connect listener for address {}: No top-level IC found" , " Evaluator::connectListener" , address.toString ());
1231
+ return ;
1232
+ }
1233
+ listeners[object] = { evalCircuitId.value (), func };
1234
+ std::unordered_map<eval_circuit_id_t , std::vector<SimulatorMappingUpdate>> simulatorMappingUpdates;
1235
+ auto evalCircuit = evalCircuitContainer.getCircuit (evalCircuitId.value ());
1236
+ if (!evalCircuit) {
1237
+ logError (" Failed to get eval circuit for ID {}" , " Evaluator::connectListener" , evalCircuitId.value ());
1238
+ return ;
1239
+ }
1240
+ evalCircuit->forEachNode ([this , evalCircuitId](Position pos, const CircuitNode& node) {
1241
+ this ->dirtyBlockAt (pos, evalCircuitId.value ());
1242
+ });
1243
+ processDirtyNodes ();
1221
1244
}
Original file line number Diff line number Diff line change @@ -148,14 +148,7 @@ class Evaluator {
148
148
void * object,
149
149
const Address& address,
150
150
SimulatorMappingUpdateListenerFunction func
151
- ) {
152
- std::optional<eval_circuit_id_t > evalCircuitId = evalCircuitContainer.traverseToTopLevelIC (address);
153
- if (!evalCircuitId) {
154
- logError (" Failed to connect listener for address {}: No top-level IC found" , " Evaluator::connectListener" , address.toString ());
155
- return ;
156
- }
157
- listeners[object] = { evalCircuitId.value (), func };
158
- }
151
+ );
159
152
void disconnectListener (void * object) {
160
153
auto iter = listeners.find (object);
161
154
if (iter != listeners.end ()) {
You can’t perform that action at this time.
0 commit comments