torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BitAssemblerExample.cpp File Reference

Example to show usage of bitassembler classes. More...

+ Include dependency graph for BitAssemblerExample.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example to show usage of bitassembler classes.

Author
Ritesh Kumar Soni

Definition in file BitAssemblerExample.cpp.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 25 of file BitAssemblerExample.cpp.

25  {
26 
27  if(argc != 2) {
28  std::cerr << "Usage: " << argv[0] << " <XDL file path>" << std::endl;
29  return -1;
30  }
31 
32  // Open the XDL file and check if it opens successfully
33  std::string xdlFilePath(argv[1]);
34  std::fstream xdlFileStream(xdlFilePath.c_str());
35  if(!xdlFileStream.good()) {
36  std::cout << "Could not open file " << xdlFilePath << std::endl;
37  return -1;
38  }
39 
40  // Initialize the DirectoryTree class
41  torc::common::DirectoryTree directoryTree(argv[0]);
42 
43  // Import the XDL file
45  importer(xdlFileStream, "XdlDesignExample");
46  // Get the design pointer
47  torc::physical::DesignSharedPtr designPtr = importer.getDesignPtr();
48 
49  torc::architecture::DDB ddb(designPtr->getDevice());
50 
51  boost::filesystem::path customBitFile = xdlFilePath;
52  customBitFile.replace_extension(".custombit");
53 
54  boost::filesystem::path baseBitstreamPath = xdlFilePath;
55  baseBitstreamPath.replace_extension(".bit");
56  // Create bitstream assembler object
59  assemblerPtr->generateBitstream(designPtr, customBitFile);
60 }
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
DesignSharedPtr getDesignPtr(void)
Returns a shared pointer for the design.
static AssemblerSharedPtr newAssemblerPtr(torc::physical::DesignSharedPtr xdlDesignPtr, torc::architecture::DDB &inDB)
std::string string
Encapsulation of filesystem paths that are used by the library.
boost::filesystem::path path
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
Importer from XDL format into a physical design.
boost::shared_ptr< Assembler > AssemblerSharedPtr
Typedef for shared pointer of Assembler class.
Definition: Assembler.hpp:345

+ Here is the call graph for this function: