OpenASIP
2.0
|
#include <OperationSimulator.hh>
Public Member Functions | |
bool | simulateTrigger (Operation &op, std::vector< DataObject > inputs, std::vector< SimValue * > &outputs, OperationContext &context, std::string &result) |
bool | lateResult (Operation &op, std::vector< DataObject > inputs, std::vector< SimValue * > &outputs, OperationContext &context, unsigned int bitWidth, std::string &result) |
void | advanceClock (OperationContext &context) |
bool | initializeSimValue (std::string value, SimValue *sim, std::string &result) |
Static Public Member Functions | |
static OperationSimulator & | instance () |
Private Member Functions | |
OperationSimulator () | |
virtual | ~OperationSimulator () |
bool | initializeOutputs (Operation &op, std::vector< DataObject > inputs, std::vector< SimValue * > &outputs, std::string &result) |
Static Private Attributes | |
static OperationSimulator * | instance_ = NULL |
Unique instance. More... | |
Contains functionality to simulate operation behavior.
Definition at line 48 of file OperationSimulator.hh.
|
private |
|
privatevirtual |
void OperationSimulator::advanceClock | ( | OperationContext & | context | ) |
|
private |
Initializes the output values of the operation.
op | Operation in which outputs are initialized. |
inputs | Input values. |
outputs | Output values to be initialized. |
result | Possible error message string. |
Definition at line 166 of file OperationSimulator.cc.
References initializeSimValue(), Operation::input(), Operation::numberOfOutputs(), Operation::output(), and Operand::width().
Referenced by simulateTrigger().
bool OperationSimulator::initializeSimValue | ( | std::string | value, |
SimValue * | sim, | ||
std::string & | result | ||
) |
Initializes one SimValue.
value | Value. |
sim | SimValue to be initialized. |
result | Possible error string. |
Definition at line 122 of file OperationSimulator.cc.
References Conversion::toDouble(), Conversion::toFloat(), and Conversion::toLong().
Referenced by initializeOutputs(), and SimulateDialog::onFormatChanged().
|
static |
Returns the unique instance of OperationSimulator.
Definition at line 65 of file OperationSimulator.cc.
References instance_, and OperationSimulator().
Referenced by CmdTrigger::execute(), SimulateDialog::onFormatChanged(), and SimulateDialog::onTrigger().
bool OperationSimulator::lateResult | ( | Operation & | op, |
std::vector< DataObject > | inputs, | ||
std::vector< SimValue * > & | outputs, | ||
OperationContext & | context, | ||
unsigned int | bitWidth, | ||
std::string & | result | ||
) |
bool OperationSimulator::simulateTrigger | ( | Operation & | op, |
std::vector< DataObject > | inputs, | ||
std::vector< SimValue * > & | outputs, | ||
OperationContext & | context, | ||
std::string & | result | ||
) |
Executes the operation trigger command.
op | Operation to be simulated. |
inputs | The inputs for the operation. |
outputs | The outputs of the operation. |
context | OperationContext used in simulation. |
result | The possible error string. |
Definition at line 83 of file OperationSimulator.cc.
References Exception::errorMessage(), initializeOutputs(), Operation::numberOfInputs(), and Operation::simulateTrigger().
Referenced by CmdTrigger::execute(), and SimulateDialog::onTrigger().
|
staticprivate |