Interface CPUContext
- All Superinterfaces:
Context
- All Known Implementing Classes:
AbstractCPUContext
CPU context can be used by plugins which are connected to CPU.
Custom CPU contexts can extend the runtime functionality accessible to plugins. Plugins which need the specific CPU contexts, should declare a dependency on the CPU plugin.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCallbacks must not wait for machine commands.static interfaceListener for passed CPU cycles -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCPUListener(CPUContext.CPUListener listener) Registers execution notifications.voidaddPassedCyclesListener(CPUContext.PassedCyclesListener passedCyclesListener) Adds passed cycles listenerdefault intGet CPU frequency in kHzfloatMeasured execution frequency in kHz, or NaN when unavailable.intCurrent instruction address, or -1 when unavailable.Current CPU run state.default booleanDetermine whether this CPU supports interrupts.booleanDetermines if this CPU context supports providing passed cyclesvoidremoveCPUListener(CPUContext.CPUListener listener) Removes a listener when its view or plugin is disposed.voidremovePassedCyclesListener(CPUContext.PassedCyclesListener passedCyclesListener) Removes given passed cycles listenerdefault voidsignalInterrupt(byte[] data) Send interrupt signal to the CPU.
-
Method Details
-
getRunState
CPU.RunState getRunState()Current CPU run state. -
getInstructionLocation
int getInstructionLocation()Current instruction address, or -1 when unavailable. -
getCpuFrequencyKhz
float getCpuFrequencyKhz()Measured execution frequency in kHz, or NaN when unavailable. -
addCPUListener
Registers execution notifications. Callbacks may run outside Swing. -
removeCPUListener
Removes a listener when its view or plugin is disposed. -
isInterruptSupported
default boolean isInterruptSupported()Determine whether this CPU supports interrupts.- Returns:
- true, if interrupts are supported, false otherwise
-
signalInterrupt
default void signalInterrupt(byte[] data) Send interrupt signal to the CPU.- Parameters:
data- data bus
-
getCPUFrequency
default int getCPUFrequency()Get CPU frequency in kHz- Returns:
- CPU frequency in kHz or 0 if it is not supported
-
isPassedCyclesSupported
boolean isPassedCyclesSupported()Determines if this CPU context supports providing passed cycles- Returns:
- true if passed cycles is supported by this CPU; false otherwise
-
addPassedCyclesListener
Adds passed cycles listener- Parameters:
passedCyclesListener- passed cycles listener
-
removePassedCyclesListener
Removes given passed cycles listener- Parameters:
passedCyclesListener- passed cycles listener
-