| |
- pcisim.lib.action.Action(__builtin__.object)
-
- SimuAction
class SimuAction(pcisim.lib.action.Action) |
|
Implements additional method to automate port highlight functions.
@PARAMS
(WireBoard) board : points to app main board.
On each step, a subclass *should* call 'set_subject' function to set
active object. Subject should have at least these attributes:
- config_port
- data_port
- pcibus |
|
- Method resolution order:
- SimuAction
- pcisim.lib.action.Action
- __builtin__.object
Methods defined here:
- __init__(self, *args, **kargs)
- @PARAMS
*args : parameters to pass to Action class
**kargs : keyword paramters to pass to Action class
See pcisim.lib.action for more details.
- config_in(self)
- Reads config from config_port
The following effects are triggered:
- port_config is set to READ mode
- port_config data is retrieved
- pcibus is set to WRITE mode
- pcibus is written with config
- pcibus is dumped into the DataView
@RETURN
the read word
@NOTES
only NorthBridge should call config_in
- config_out(self, data)
- Write config onto config_port.
The following effects are triggered:
- port_config is set to WRITE mode
- port_config data is written
- port_config is dumped into the DataView
@PARAMS
data : data to write on the port
- data_in(self)
- Reads data from pcisim.core.port
The following effects are triggered:
- port_data is set to READ mode
- port_data is read
- port_data is dumped into the DataView
@RETURN
the read value
- data_inbus(self)
- Reads data from pcisim.core.port and copies value to pcibus
The following effects are triggered:
- port_data is set to READ mode
- port_data is read
- port_data is dumped into the DataView
- pcibus is set to WRITE mode
- pcibus is written
@RETURN
the read value
@NOTES
only NorthBridge should call data_inbus
- data_out(self, data)
- Writes data to data_port
The following effects are triggered:
- port_data is set to WRITE mode
- port_data is written
- port_data is dumped into the DataView
@PARAMS
data : data to write on the port
- data_outbus(self, data)
- Writes data to pcibus and copies it to data_port
The following effects are triggered:
- pcibus is set to WRITE mode
- pcibus is written
- port_data is set to WRITE mode
- port_data is written
- port_data is dumped into the DataView
@PARAMS
data : data to write on the port
@NOTES
only NorthBridge should call data_outbus
- set_subject(self, subj)
- Set action subject and highlights it.
@PARAMS
subj : current action subject.
Methods inherited from pcisim.lib.action.Action:
- __str__(self)
- Shows the step name and the next step
- done(self)
- Call this when action has finished.
- get_action_by_id(self, actname)
- Get action using his 'name'.
@PARAMS
(str) actname : 'name' attribute of the action to search
@RETURN
| SUCCESS : (int) action index in self.steps
| FAILURE : (None)
- get_next_step(self)
- Get the next step.
@RETURN
(Action) next step.
@NOTES
In particular, should return a 'Step' instance.
- get_return_value(self)
- Gets return value from previous action, if any.
@RETURN
| SUCCESS : return value (it could be None as well)
| FAILURE : (None)
- is_done(self)
- Query action execution state.
@RETURN
| True : action has ended
- is_waiting(self)
- Query action state.
@RETURN
| True : sub-action is being executed so action is stalled
| False : action is being executed
- on_reset(self, oldstep=None)
- This method is invoked when 'reset' function is called.
A custom action should reset its internal variables to initial state
to be able to be executed again in the future.
This method is also called when entering a sub-action to reset
sub-action state. In this case 'oldstep' optional parameter is set;
it can be used to fetch additional data from previous step by
'get_return_value'.
@PARAMS
| (None) oldstep - manual 'reset' method call
| (Action) oldstep - previously executed step
- reset(self, oldstep=None)
- Recursively resets all the actions to be ready to new calls.
@PARAMS
| (None) oldstep : this should be None when called for resetting
the action.
| (Step) oldstep : this should be last executed Step when called
for entering the sub-action
@NOTES
This functions invokes 'on_reset' method for each action.
- seek(self, stepi)
- Set next action to perform.
This function is very usefull for implementing loops. One could
use an attribute as a test, call 'seek' as continue instruction and
'done' to stop.
@PARAMS
(int) stepi : index of the action in self.steps
- step(self)
- Performs a step in the action.
@RETURN
An optional return value can be returned by the step.
@NOTES
The same return value is saved and can be retrieved by
'get_return_value' method.
Data descriptors inherited from pcisim.lib.action.Action:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |