torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::VerilogExporter Class Reference

Exporter from a generic netlist into structural verilog. More...

#include <VerilogExporter.hpp>

Public Member Functions

 VerilogExporter (RootSharedPtr inRootPtr)
 Public constructor. More...
 
bool operator() (const boost::filesystem::path &inFilename)
 Export Verilog to a file. More...
 
bool operator() (std::ostream &inOutputStream=std::cout)
 Export Verilog to an output stream. More...
 

Protected Types

typedef std::string string
 Imported type name. More...
 

Protected Attributes

RootSharedPtr mRootPtr
 Root of the generic netlist. More...
 

Friends

class torc::generic::generic::VerilogExporterUnitTest
 The unit test class has access to our internals. More...
 

Detailed Description

Exporter from a generic netlist into structural verilog.

Definition at line 33 of file VerilogExporter.hpp.

Member Typedef Documentation

typedef std::string torc::generic::VerilogExporter::string
protected

Imported type name.

Definition at line 40 of file VerilogExporter.hpp.

Constructor & Destructor Documentation

torc::generic::VerilogExporter::VerilogExporter ( RootSharedPtr  inRootPtr)

Public constructor.

Definition at line 31 of file VerilogExporter.cpp.

31 : mRootPtr(inRootPtr) {}
RootSharedPtr mRootPtr
Root of the generic netlist.

Member Function Documentation

bool torc::generic::VerilogExporter::operator() ( const boost::filesystem::path &  inFilename)

Export Verilog to a file.

Parameters
inFilenameOutput file name.
Returns
true if successfully exported.

Definition at line 33 of file VerilogExporter.cpp.

33  {
34 
35  // prepare the output stream
36  string outFileName = path.string();
37  fstream verilogExport(outFileName.c_str(), ios_base::out);
38  return (*this)(verilogExport);
39  }
boost::filesystem::path path
bool torc::generic::VerilogExporter::operator() ( std::ostream &  inOutputStream = std::cout)

Export Verilog to an output stream.

Parameters
inOutputStream.
Returns
true if successfully exported.

Definition at line 41 of file VerilogExporter.cpp.

41  {
42 
43  // export the Verilog code
44  torc::generic::VerilogExporterVisitor verilogExporterVisitor(mRootPtr, inOutputStream);
45  try {
46  mRootPtr->accept(verilogExporterVisitor);
47  } catch(Error& e) {
48  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
49  throw;
50  }
51 
52  return true; //mSuccess;
53  }
RootSharedPtr mRootPtr
Root of the generic netlist.
Generic netlist object visitor for output as structural Verilog.

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend class torc::generic::generic::VerilogExporterUnitTest
friend

The unit test class has access to our internals.

Definition at line 37 of file VerilogExporter.hpp.

Field Documentation

RootSharedPtr torc::generic::VerilogExporter::mRootPtr
protected

Root of the generic netlist.

Definition at line 43 of file VerilogExporter.hpp.


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