ilasynth  1.0
ILASynth: Template-based ILA Synthesis Engine
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ilasynth::CppSimGen Class Reference

#include <cppsimgen.hpp>

Public Types

typedef std::map< std::string, CppVar * > CppVarMap
 
typedef std::map< std::string, CppFun * > CppFunMap
 

Public Member Functions

 CppSimGen (const std::string &prefix)
 
 ~CppSimGen ()
 
CppVaraddInput (const std::string &name, nptr_t node, bool ms=false)
 
CppVaraddState (const std::string &name, nptr_t node, bool ms=false)
 
CppFunaddFun (const std::string &name, bool ms=false)
 
CppVaraddFuncVar (const std::string &name, nptr_t node, bool ms=false)
 
void operator() (const Node *n)
 
void buildFun (CppFun *f, nptr_t nptr)
 
void setFunReturn (CppFun *f, nptr_t nptr)
 
void addFunUpdate (CppFun *f, nptr_t lhs, nptr_t rhs)
 
void addFunUpdate (CppFun *f, nptr_t lhs, CppVar *rhs)
 
void endFun (CppFun *f)
 
CppVarappFun (CppFun *appFun, CppFun *envFun)
 
void exportAllToFile (const std::string &fileName) const
 
void exportAllToDir (const std::string &dirName) const
 

Private Member Functions

void defMemClass (std::ostream &out) const
 
void setMemConst (std::ostream &out) const
 
void genModel (std::ostream &out) const
 
void defUnitpFunc (std::ostream &out) const
 
void createCommon (std::ostream &out) const
 
CppVargetBoolVarCpp (const BoolVar *n)
 
CppVargetBoolConstCpp (const BoolConst *n)
 
CppVargetBoolOpCpp (const BoolOp *n)
 
CppVargetBvVarCpp (const BitvectorVar *n)
 
CppVargetBvConstCpp (const BitvectorConst *n)
 
CppVargetBvOpCpp (const BitvectorOp *n)
 
CppVargetMemVarCpp (const MemVar *n)
 
CppVargetMemConstCpp (const MemConst *n)
 
CppVargetMemOpCpp (const MemOp *n)
 
CppVargetFuncVarCpp (const FuncVar *n)
 
bool isITE (nptr_t n)
 
void depthFirstTraverse (nptr_t n)
 
std::string getSignedCppCode (CppVar *var)
 
template<class T >
void checkAndInsert (std::map< std::string, T *> &mp, const std::string &name, T *var, bool force=false)
 
CppVarfindVar (CppVarMap &mp, const std::string &name)
 

Private Attributes

std::string _modelName
 
CppVarMap _states
 
CppVarMap _inputs
 
CppFunMap _funMap
 
CppVarMap _unitpFuncVarMap
 
CppFunMap _unitpFuncMap
 
std::map< CppVar *, const MemConst * > _memConst
 
CppVarMap _masks
 
std::map< CppFun *, CppVarMap * > _varInFun
 
CppFun_curFun
 
CppVar_curVar
 
CppVarMap_curVarMap
 

Member Typedef Documentation

◆ CppFunMap

typedef std::map<std::string, CppFun*> ilasynth::CppSimGen::CppFunMap

◆ CppVarMap

typedef std::map<std::string, CppVar*> ilasynth::CppSimGen::CppVarMap

Constructor & Destructor Documentation

◆ CppSimGen()

ilasynth::CppSimGen::CppSimGen ( const std::string &  prefix)

◆ ~CppSimGen()

ilasynth::CppSimGen::~CppSimGen ( )

Member Function Documentation

◆ addFun()

CppFun* ilasynth::CppSimGen::addFun ( const std::string &  name,
bool  ms = false 
)

◆ addFuncVar()

CppVar* ilasynth::CppSimGen::addFuncVar ( const std::string &  name,
nptr_t  node,
bool  ms = false 
)

◆ addFunUpdate() [1/2]

void ilasynth::CppSimGen::addFunUpdate ( CppFun f,
nptr_t  lhs,
nptr_t  rhs 
)

◆ addFunUpdate() [2/2]

void ilasynth::CppSimGen::addFunUpdate ( CppFun f,
nptr_t  lhs,
CppVar rhs 
)

◆ addInput()

CppVar* ilasynth::CppSimGen::addInput ( const std::string &  name,
nptr_t  node,
bool  ms = false 
)

◆ addState()

CppVar* ilasynth::CppSimGen::addState ( const std::string &  name,
nptr_t  node,
bool  ms = false 
)

◆ appFun()

CppVar* ilasynth::CppSimGen::appFun ( CppFun appFun,
CppFun envFun 
)

◆ buildFun()

void ilasynth::CppSimGen::buildFun ( CppFun f,
nptr_t  nptr 
)

◆ checkAndInsert()

template<class T >
void ilasynth::CppSimGen::checkAndInsert ( std::map< std::string, T *> &  mp,
const std::string &  name,
T *  var,
bool  force = false 
)
private

◆ createCommon()

void ilasynth::CppSimGen::createCommon ( std::ostream &  out) const
private

◆ defMemClass()

void ilasynth::CppSimGen::defMemClass ( std::ostream &  out) const
private

◆ defUnitpFunc()

void ilasynth::CppSimGen::defUnitpFunc ( std::ostream &  out) const
private

◆ depthFirstTraverse()

void ilasynth::CppSimGen::depthFirstTraverse ( nptr_t  n)
private

◆ endFun()

void ilasynth::CppSimGen::endFun ( CppFun f)

◆ exportAllToDir()

void ilasynth::CppSimGen::exportAllToDir ( const std::string &  dirName) const

◆ exportAllToFile()

void ilasynth::CppSimGen::exportAllToFile ( const std::string &  fileName) const

◆ findVar()

CppVar* ilasynth::CppSimGen::findVar ( CppVarMap mp,
const std::string &  name 
)
private

◆ genModel()

void ilasynth::CppSimGen::genModel ( std::ostream &  out) const
private

◆ getBoolConstCpp()

CppVar* ilasynth::CppSimGen::getBoolConstCpp ( const BoolConst n)
private

◆ getBoolOpCpp()

CppVar* ilasynth::CppSimGen::getBoolOpCpp ( const BoolOp n)
private

◆ getBoolVarCpp()

CppVar* ilasynth::CppSimGen::getBoolVarCpp ( const BoolVar n)
private

◆ getBvConstCpp()

CppVar* ilasynth::CppSimGen::getBvConstCpp ( const BitvectorConst n)
private

◆ getBvOpCpp()

CppVar* ilasynth::CppSimGen::getBvOpCpp ( const BitvectorOp n)
private

◆ getBvVarCpp()

CppVar* ilasynth::CppSimGen::getBvVarCpp ( const BitvectorVar n)
private

◆ getFuncVarCpp()

CppVar* ilasynth::CppSimGen::getFuncVarCpp ( const FuncVar n)
private

◆ getMemConstCpp()

CppVar* ilasynth::CppSimGen::getMemConstCpp ( const MemConst n)
private

◆ getMemOpCpp()

CppVar* ilasynth::CppSimGen::getMemOpCpp ( const MemOp n)
private

◆ getMemVarCpp()

CppVar* ilasynth::CppSimGen::getMemVarCpp ( const MemVar n)
private

◆ getSignedCppCode()

std::string ilasynth::CppSimGen::getSignedCppCode ( CppVar var)
private

◆ isITE()

bool ilasynth::CppSimGen::isITE ( nptr_t  n)
private

◆ operator()()

void ilasynth::CppSimGen::operator() ( const Node n)

◆ setFunReturn()

void ilasynth::CppSimGen::setFunReturn ( CppFun f,
nptr_t  nptr 
)

◆ setMemConst()

void ilasynth::CppSimGen::setMemConst ( std::ostream &  out) const
private

Member Data Documentation

◆ _curFun

CppFun* ilasynth::CppSimGen::_curFun
private

◆ _curVar

CppVar* ilasynth::CppSimGen::_curVar
private

◆ _curVarMap

CppVarMap* ilasynth::CppSimGen::_curVarMap
private

◆ _funMap

CppFunMap ilasynth::CppSimGen::_funMap
private

◆ _inputs

CppVarMap ilasynth::CppSimGen::_inputs
private

◆ _masks

CppVarMap ilasynth::CppSimGen::_masks
private

◆ _memConst

std::map<CppVar*, const MemConst*> ilasynth::CppSimGen::_memConst
private

◆ _modelName

std::string ilasynth::CppSimGen::_modelName
private

◆ _states

CppVarMap ilasynth::CppSimGen::_states
private

◆ _unitpFuncMap

CppFunMap ilasynth::CppSimGen::_unitpFuncMap
private

◆ _unitpFuncVarMap

CppVarMap ilasynth::CppSimGen::_unitpFuncVarMap
private

◆ _varInFun

std::map<CppFun*, CppVarMap*> ilasynth::CppSimGen::_varInFun
private

The documentation for this class was generated from the following file: