OpenASIP
2.0
|
#include <OperationBehavior.hh>
Public Types | |
typedef std::vector< SimValue > | InputOperandVector |
Input operand type for areValid() More... | |
Public Member Functions | |
virtual bool | simulateTrigger (SimValue **io, OperationContext &context) const =0 |
virtual bool | areValid (const InputOperandVector &inputs, const OperationContext &context) const |
virtual void | createState (OperationContext &context) const |
virtual void | deleteState (OperationContext &context) const |
virtual const char * | stateName () const |
virtual bool | canBeSimulated () const |
virtual void | writeOutput (const char *text) const |
OperationBehavior () | |
OperationBehavior (const Operation &parent) | |
virtual | ~OperationBehavior () |
Protected Attributes | |
const Operation & | parent_ |
Interface to access the behavior model of TTA operations.
This abstract class that is inherited by the custom operation behavior classes. Instances of user defined OperationBehavior derived classes are loaded run-time from dynamic library modules (plugins).
Definition at line 53 of file OperationBehavior.hh.
typedef std::vector<SimValue> OperationBehavior::InputOperandVector |
Input operand type for areValid()
Definition at line 57 of file OperationBehavior.hh.
OperationBehavior::OperationBehavior | ( | ) |
OperationBehavior::OperationBehavior | ( | const Operation & | parent | ) |
|
virtual |
|
virtual |
The default implementation of input operand validation.
This always return true. This is meant to be overridden in derived classes when necessary.
Reimplemented in OperationDAGBehavior.
Definition at line 96 of file OperationBehavior.cc.
Referenced by Operation::areValid().
|
virtual |
If behavior can be simulated.
Reimplemented in OperationDAGBehavior, and OperationBehaviorProxy.
Definition at line 162 of file OperationBehavior.cc.
Referenced by OperationPimpl::canBeSimulated().
|
virtual |
Creates the instance of operation state for this operation and adds it to its operation context.
By default this function does nothing (assumes that the operation has no state). If the operation context already contains the required operation state instance, nothing is done.
context | The operation context to add the state to. |
Reimplemented in OperationDAGBehavior, and OperationBehaviorProxy.
Definition at line 127 of file OperationBehavior.cc.
Referenced by SimulateDialog::createState(), OperationPimpl::createState(), and OsalInterpreter::operation().
|
virtual |
Deletes the instance of operation state for this operation from its operation context.
By default this function does nothing (assumes that the operation has no state). If the operation context does not contain the required operation state instance, nothing is done.
context | The operation context to delete the state from. |
Reimplemented in OperationDAGBehavior, and OperationBehaviorProxy.
Definition at line 141 of file OperationBehavior.cc.
Referenced by OperationPimpl::deleteState(), CmdReset::execute(), SimulateDialog::onReset(), and SimulateDialog::~SimulateDialog().
|
pure virtual |
Simulates the process of starting the execution of an operation.
Clients should invoke isTriggerLocking() before any attempt to call simulateTrigger() in current clock cycle. By default, an operation invocations are successful.
io | The input operands and the results of the operation. |
context | The operation context affecting the operation results. |
Exception | Depends on the implementation. |
Implemented in OperationDAGBehavior, OperationBehaviorProxy, and NullOperationBehavior.
Definition at line 83 of file OperationBehavior.cc.
Referenced by OperationPimpl::simulateTrigger().
|
virtual |
Returns the name of the state of this operation behavior.
By default returns an empty string which denotes that there is no state.
Reimplemented in OperationDAGBehavior.
Definition at line 152 of file OperationBehavior.cc.
|
virtual |
Writes text to the output stream specified
text | text to be written to the output stream |
Definition at line 110 of file OperationBehavior.cc.
References OperationGlobals::outputStream().
|
protected |
Definition at line 80 of file OperationBehavior.hh.