if (dirtyThreads.isEmpty()) return;
// determine values of affected threads
HashSet<ThreadBundle> bundles = new HashSet<ThreadBundle>();
for (WireThread t : dirtyThreads) {
Value v = getThreadValue(circState, t);
s.thr_values.put(t, v);
bundles.addAll(t.getBundles());
}
// now propagate values through circuit
for (ThreadBundle tb : bundles) {
WireBundle b = tb.b;
Value bv = null;
if (!b.isValid() || b.threads == null) {
; // do nothing
} else if (b.threads.length == 1) {
bv = s.thr_values.get(b.threads[0]);
} else {
Value[] tvs = new Value[b.threads.length];
boolean tvs_valid = true;
for (int i = 0; i < tvs.length; i++) {
Value tv = s.thr_values.get(b.threads[i]);
if (tv == null) { tvs_valid = false; break; }
tvs[i] = tv;
}
if (tvs_valid) bv = Value.create(tvs);
}