uk.ac.man.cs.rainbow.simulator.rasm
Class DeclareDeviceWithState
java.lang.Object
|
+--uk.ac.man.cs.rainbow.simulator.Instruction
|
+--uk.ac.man.cs.rainbow.simulator.rasm.DeclareDeviceWithState
- All Implemented Interfaces:
- Serializable
- public class DeclareDeviceWithState
- extends Instruction
Associate a register with an integer value.
Declares the given register to the runtime system as being
that associated with the given key (an integer) provided the key
is non-zero and the system is initialising. Also, the given
register is set to be the characterisation register for the
current thread/device. This allows the runtime system to ask
questions about the state of a given device, an operation that is
needed during the characterisation of states that is performed as
part of the checking of a temporal model of the system.
This instruction is only ever to be used in the standard
library, as it is only ever really of use in conjunction with the
runtime system anyway, as there is no general mechanism for using
the information with anything other than devices
(Specifically, buffers and arbitrates. All the other
standard devices have no useful examinable state.) from the
library.
There is a lot of overlap between
declareDeviceWithState and labelDevice and the
difference between them is probably a little subtle for this
document. Try to describe the difference
properly!
regId key
-
- See Also:
LabelDevice
,
StatelessDevice
,
Scheduler.readKeyedRegister(int)
, Serialized Form
DeclareDeviceWithState
public DeclareDeviceWithState()
DeclareDeviceWithState
public DeclareDeviceWithState(RASMCode code)
toString
public String toString()
- Overrides:
toString
in class Object
execute
protected boolean execute(RASMThread thread)
throws RASMThread.Exception
- Description copied from class:
Instruction
- Make this instruction execute in the given context.
- Overrides:
execute
in class Instruction
- Following copied from class:
uk.ac.man.cs.rainbow.simulator.Instruction
- Throws:
RainbowException
- All sorts of things can go wrong during execution...