OpenASIP
2.0
|
#include <OperationDAGConverter.hh>
Static Public Member Functions | |
static OperationDAG * | createDAG (const OperationPimpl &operation, std::string sourceCode) |
static std::string | createOsalCode (const OperationDAG &dag) |
static std::string | createSimulationCode (const OperationDAG &dag, std::vector< std::string > *varReplacements=NULL) |
Private Types | |
typedef std::pair< const OperationDAGNode *, int > | VariableKey |
Static Private Member Functions | |
static std::string | castedVar (std::string var, Operand::OperandType type) |
static bool | writeNode (std::string &retVal, const OperationDAG &dag, const OperationDAGNode &node, std::map< VariableKey, std::string > &varBindings, std::set< const OperationDAGNode * > &alreadyHandled, int &tempVarCount, std::set< const OperationDAGNode * > ¤tlyHandling, std::map< std::string, std::string > *opReplace=NULL, std::vector< std::string > *varReplacements=NULL) |
Parser for creating Operation DAG from Operation DAG Language and for writing Operation DAG back to language form.
Definition at line 51 of file OperationDAGConverter.hh.
|
private |
Definition at line 60 of file OperationDAGConverter.hh.
|
staticprivate |
Cast variable to be correct type.
Definition at line 479 of file OperationDAGConverter.cc.
References Operand::DOUBLE_WORD, Operand::FLOAT_WORD, Operand::HALF_FLOAT_WORD, Operand::SINT_WORD, Operand::SLONG_WORD, Operand::UINT_WORD, and Operand::ULONG_WORD.
Referenced by writeNode().
|
static |
Creates OperationDAG out of OSAL DAG language source code.
sourceCode | OSAL DAG Language source code. |
IllegalParameters | There was an error during parsing. |
Definition at line 61 of file OperationDAGConverter.cc.
References __func__, OperationDAGBuilder::parse(), skip_grammar::strippedParts, OperationDAGLanguageGrammar::tokenData_, TokenizerData::tokenTree(), and Conversion::toString().
Referenced by OperationPimpl::dag().
|
static |
Write OSAL DAG code for graph.
dag | Graph to write as OSAL code (basically C subset) |
Definition at line 509 of file OperationDAGConverter.cc.
References BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), and writeNode().
|
static |
Optimizations, when compiled simulation code is created from DAG.
OSAL implementations of operantions will not be called for calculating basic C operations.
Definition at line 534 of file OperationDAGConverter.cc.
References BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), and writeNode().
Referenced by CompiledSimCodeGenerator::generateTriggerCode().
|
staticprivate |
Definition at line 171 of file OperationDAGConverter.cc.
References __func__, abortWithError, assert, castedVar(), DEBUG_CODE, OperationDAGEdge::dstOperand(), BoostGraph< GraphNode, GraphEdge >::headNode(), BoostGraph< GraphNode, GraphEdge >::inDegree(), BoostGraph< GraphNode, GraphEdge >::inEdge(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), OperationPimpl::operand(), Operation::operand(), TerminalNode::operandIndex(), OperationDAG::operation(), BoostGraph< GraphNode, GraphEdge >::outDegree(), BoostGraph< GraphNode, GraphEdge >::outEdge(), OperationNode::referencedOperation(), OperationDAGEdge::srcOperand(), OperationDAG::stepsToRoot(), BoostGraph< GraphNode, GraphEdge >::tailNode(), GraphNode::toString(), Conversion::toString(), ConstantNode::toString(), and Operand::type().
Referenced by createOsalCode(), and createSimulationCode().