19 #ifndef TORC_GENERIC_VERILOG_VERILOGIMPORTERVISITOR_HPP
20 #define TORC_GENERIC_VERILOG_VERILOGIMPORTERVISITOR_HPP
26 #include "torc/externals/verilator/src/V3Global.h"
27 #include "torc/externals/verilator/src/V3Ast.h"
28 #include <boost/smart_ptr.hpp>
29 #include <boost/filesystem.hpp>
36 namespace generic {
class VerilogImporterUnitTest; }
110 virtual void visit(AstNetlist* nodePtr, AstNUser* userPtr);
111 virtual void visit(AstModule* nodePtr, AstNUser* userPtr);
112 virtual void visit(AstCell* nodePtr, AstNUser* userPtr);
113 virtual void visit(AstPin* nodePtr, AstNUser* userPtr);
114 virtual void visit(AstPort* nodePtr, AstNUser* userPtr);
115 virtual void visit(AstSelBit* nodePtr, AstNUser* userPtr);
116 virtual void visit(AstSelExtract* nodePtr, AstNUser* userPtr);
117 virtual void visit(AstRange* nodePtr, AstNUser* userPtr);
118 virtual void visit(AstDefParam* nodePtr, AstNUser* userPtr);
119 virtual void visit(AstVar* nodePtr, AstNUser* userPtr);
120 virtual void visit(AstAssignW* nodePtr, AstNUser* userPtr);
121 virtual void visit(AstParseRef* nodePtr, AstNUser* userPtr);
122 virtual void visit(AstText* nodePtr, AstNUser* userPtr);
123 virtual void visit(AstConst* nodePtr, AstNUser* userPtr);
124 virtual void visit(AstNot* nodePtr, AstNUser* userPtr);
125 virtual void visit(AstNotFoundModule* nodePtr, AstNUser* userPtr);
126 virtual void visit(AstBasicDType* nodePtr, AstNUser* userPtr);
127 virtual void visit(AstConcat* nodePtr, AstNUser* userPtr);
128 virtual void visit(AstNode* nodePtr, AstNUser* userPtr);
137 if(p != e) masterViewPtr = p->second;
139 if(!masterViewPtr && inCreate) {
143 if(inMasterName != inOriginalName && !inOriginalName.empty())
144 cellPtr->setOriginalName(inOriginalName);
152 return masterViewPtr;
184 #endif // TORC_GENERIC_VERILOG_VERILOGIMPORTERVISITOR_HPP
V3Number mCurrentConstNum
The current constant number object.
NetSharedPtr mCurrentNetPtr
The current net shared pointer;.
static string getImportedVerilogLibraryName(void)
Returns the imported Verilog library name.
boost::shared_ptr< Instance > InstanceSharedPtr
static string getImportedCellLibraryName(void)
Returns the imported cell library name.
InstanceSharedPtr mCurrentInstancePtr
The current instance shared pointer.
ViewSharedPtr findMasterView(std::string inMasterName, std::string inOriginalName, bool inCreate)
Find the specified view, or optionally create it.
VerilogImporterVisitor(ObjectFactorySharedPtr inObjectFactoryPtr, RootSharedPtr inRootPtr)
Public constructor.
map< string, NetSharedPtr > StringToNetMap
A map from string to net shared pointer.
bool mCurrentNotFlag
The current inversion flag.
LibrarySharedPtr mCurrentLibraryPtr
The current library shared pointer.
ViewSharedPtr mCurrentViewPtr
The current view shared pointer.
std::string string
Imported type name.
void createDesigns(void)
Create top-level designs for all Verilog modules that are never instantiated.
static const int32_t cUndefined
Undefined index constant.
boost::shared_ptr< ObjectFactory > ObjectFactorySharedPtr
NetSharedPtrVector mCurrentNetPtrVector
The current net vector.
static FileLine sNullFileLine
Initial file line information.
string mCurrentConstStr
The current constant string.
bool mImportLibraryCells
A flag to indicate whether we should currently allow library cells.
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< Library > LibrarySharedPtr
bool mCurrentConcatFlag
The current concatenation flag.
int32_t mCurrentRange[2]
The current range.
CellToBoolMap mCellInstantiationFlag
A map of cell shared pointers to instantiation settings.
friend class torc::generic::generic::VerilogImporterUnitTest
The unit test class has access to our internals.
LibrarySharedPtr mInferredBlackBoxesLibraryPtr
The inferred black-box library shared pointer.
RootSharedPtr mRootPtr
The root shared pointer.
StringToNetMap mVectorBitNameToNet
A map of net bit names to net shared pointers.
IndexVector mCurrentIndices
The current array indices.
string mCurrentText
The current text string.
map< string, ViewSharedPtr > StringToViewMap
A map from string to view shared pointer.
int32_t mCurrentConstInt
The current constant signed integer.
map< CellSharedPtr, bool > CellToBoolMap
A map of cell shared pointers to booleans.
AST visitor to convert structural Verilog into a generic design.
virtual void visit(AstNetlist *nodePtr, AstNUser *userPtr)
Visit the top-level netlist.
uint32_t mCurrentIndex
A unique index to avoid name collisions.
vector< size_t > IndexVector
A vector of element indices.
LibrarySharedPtr mImportedCellLibraryPtr
The cell library shared pointer.
boost::shared_ptr< View > ViewSharedPtr
boost::shared_ptr< Cell > CellSharedPtr
Header for the VerilogNames class.
ObjectFactorySharedPtr mObjectFactoryPtr
The object factory shared pointer.
StringToViewMap mMasterNameToView
A map from module name to master view pointer.
static string getImportedVerilogViewName(void)
Returns the imported Verilog view name.
vector< NetSharedPtr > NetSharedPtrVector
A vector of net shared pointers.
CellSharedPtr mCurrentCellPtr
The current cell shared pointer.
boost::shared_ptr< Root > RootSharedPtr
static string getInferredBlackBoxesLibraryName(void)
Returns the inferred black box library name.