OpenASIP
2.0
|
#include <SmartHWOperation.hh>
Public Member Functions | |
SmartHWOperation (const Operation &operation, UniversalFunctionUnit &parent) | |
virtual | ~SmartHWOperation () |
virtual void | setName (const std::string &name) |
TTAMachine::FUPort * | port (int operand) const |
UniversalFunctionUnit * | parentUnit () const |
virtual void | bindPort (int operand, const TTAMachine::FUPort &port) |
virtual void | unbindPort (const TTAMachine::FUPort &port) |
virtual void | loadState (const ObjectState *state) |
Public Member Functions inherited from TTAMachine::HWOperation | |
HWOperation (const std::string &name, FunctionUnit &parent) | |
HWOperation (const ObjectState *state, FunctionUnit &parent) | |
~HWOperation () | |
const std::string & | name () const |
FunctionUnit * | parentUnit () const |
ExecutionPipeline * | pipeline () const |
int | latency () const |
int | latency (int output) const |
int | slack (int input) const |
int | operandCount () const |
bool | isBound (const FUPort &port) const |
bool | isBound (int operand) const |
int | io (const FUPort &port) const |
int | numberOfInputs () const |
int | numberOfOutputs () const |
virtual ObjectState * | saveState () const |
Public Member Functions inherited from Serializable | |
virtual | ~Serializable () |
Private Member Functions | |
bool | otherMandatoryInputsBound (int operand) const |
Private Attributes | |
const Operation & | operation_ |
The operation represented by this SmartHWOperation instance. More... | |
bool | is32BitOperation_ |
Tells whether this operation has 32 bits wide operands. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from TTAMachine::HWOperation | |
static const std::string | OSNAME_OPERATION = "operation" |
ObjectState name for HWOperation. More... | |
static const std::string | OSKEY_NAME = "name" |
ObjectState attribute key for name of the operation. More... | |
static const std::string | OSNAME_OPERAND_BINDING = "binding" |
ObjectState name for an operand binding. More... | |
static const std::string | OSKEY_OPERAND = "operand" |
ObjectState attribute key for operand index. More... | |
static const std::string | OSKEY_PORT = "port" |
ObjectState attribute key for port name. More... | |
Protected Member Functions inherited from TTAMachine::SubComponent | |
SubComponent () | |
virtual | ~SubComponent () |
Protected Member Functions inherited from TTAMachine::MachinePart | |
MachinePart () | |
virtual | ~MachinePart () |
Represents an operation in a function unit. The smart operation automatically creates operand bindings on demand. This kind of operations are used in UniversalFunctionUnit. The last operand requested is bound to the operation code setting port.
Definition at line 47 of file SmartHWOperation.hh.
SmartHWOperation::SmartHWOperation | ( | const Operation & | operation, |
UniversalFunctionUnit & | parent | ||
) |
The constructor.
Creates the pipeline automatically.
operation | The operation to be constructed. |
parent | The parent unit of the operation. |
ComponentAlreadyExists | If there is already an operation by the same name in the given function unit. |
InvalidName | If the given operation does not have a valid name. |
Definition at line 54 of file SmartHWOperation.cc.
References TTAMachine::ExecutionPipeline::addPortRead(), TTAMachine::ExecutionPipeline::addPortWrite(), UniversalFunctionUnit::is32BitOperation(), is32BitOperation_, Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), and TTAMachine::HWOperation::pipeline().
|
virtual |
|
virtual |
Aborts the program. It is not allowed to bind ports manually. DO NOT CALL THIS METHOD!
operand | Never used. |
port | Never used. |
IllegalRegistration | Never thrown. |
ComponentAlreadyExists | Never thrown. |
OutOfRange | Never thrown. |
Reimplemented from TTAMachine::HWOperation.
Definition at line 205 of file SmartHWOperation.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
virtual |
Aborts the program. It is not allowed to load state of SmartHWOperation from an ObjectState tree. DO NOT CALL THIS METHOD!
state | Never used. |
ObjectStateLoadingException | Never thrown. |
Reimplemented from TTAMachine::HWOperation.
Definition at line 237 of file SmartHWOperation.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
private |
Tells whether other input operands except the given one are bound to some port.
operand | The operand. |
Definition at line 253 of file SmartHWOperation.cc.
References assert, Operation::numberOfInputs(), and operation_.
Referenced by port().
UniversalFunctionUnit * SmartHWOperation::parentUnit | ( | ) | const |
Returns the parent unit of the operation.
Definition at line 185 of file SmartHWOperation.cc.
References assert.
Referenced by port().
|
virtual |
Returns the port bound to the given operand. If the given operand is not bound yet, it is automatically bound to a port.
The port to which the operand will be bound depends on the bindings of other operands. Input operands are bound to input ports and output operands to output ports, of course. If all the input operands are bound already except the given one, the given operand will be bound to the operation code setting port.
operand | The operand. |
Reimplemented from TTAMachine::HWOperation.
Definition at line 110 of file SmartHWOperation.cc.
References assert, TTAMachine::Port::inputSocket(), is32BitOperation_, TTAMachine::HWOperation::isBound(), TTAMachine::FUPort::isOpcodeSetting(), Operation::numberOfInputs(), Operation::numberOfOutputs(), UniversalFunctionUnit::OC_SETTING_PORT_32, UniversalFunctionUnit::OC_SETTING_PORT_64, operation_, otherMandatoryInputsBound(), TTAMachine::Port::outputSocket(), parentUnit(), UniversalFunctionUnit::portCountWithWidth(), and UniversalFunctionUnit::portWithWidth().
|
virtual |
Aborts the program. It is not allowed to set the name of SmartHWOperation. DO NOT CALL THIS METHOD!
name | Never used. |
ComponentAlreadyExists | Never thrown. |
InvalidName | Never thrown. |
Reimplemented from TTAMachine::HWOperation.
Definition at line 89 of file SmartHWOperation.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
virtual |
Aborts the program. It is not allowed to unbind ports manually. DO NOT CALL THIS METHOD!
port | Never used. |
Reimplemented from TTAMachine::HWOperation.
Definition at line 220 of file SmartHWOperation.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
private |
Tells whether this operation has 32 bits wide operands.
Definition at line 68 of file SmartHWOperation.hh.
Referenced by port(), and SmartHWOperation().
|
private |
The operation represented by this SmartHWOperation instance.
Definition at line 66 of file SmartHWOperation.hh.
Referenced by otherMandatoryInputsBound(), and port().