Class Clock
java.lang.Object
io.zucchini.circuitsimtester.api.MockPulser
io.zucchini.circuitsimtester.api.Clock
Allows pretending to tick a Clock component placed in a subcircuit.
(In reality, this manipulates an InputPin wired to where the clock component was;
see MockPulser
)
-
Field Summary
Fields inherited from class io.zucchini.circuitsimtester.api.MockPulser
mockPin, subcircuit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
tick()
Tick the clock once.long
tickUntil
(long maxCycleCount, BooleanSupplier stopWhen) Tick the clock untilstopWhen
returns true.Methods inherited from class io.zucchini.circuitsimtester.api.MockPulser
getMockPin, getSubcircuit, pulse
-
Constructor Details
-
Clock
-
-
Method Details
-
tick
public void tick()Tick the clock once. -
tickUntil
Tick the clock untilstopWhen
returns true.- Parameters:
maxCycleCount
- the number of cycles before timeout (to avoid infinitely spinning)stopWhen
- returns true when we can stop ticking the clock (e.g., the student's processor has finished running and is sending the "done" signal)- Returns:
- the number of ticks performed until stopWhen returned true. May be zero if the condition was initially met
-