22 #include <boost/filesystem.hpp> 
   23 #include <boost/regex.hpp> 
   44         std::ofstream outputStream(outputPath.string().c_str(), std::ios::out | std::ios::binary);
 
   45         if(!outputStream.is_open()) {
 
   46             std::cerr << 
"Output static device information file could not be opened: "  
   47                 << outputPath.string() << std::endl;
 
   53             / 
"torc" / 
"bitstream" / 
"build" / inTemplateName;
 
   54         std::ifstream templateStream(templatePath.string().c_str(), 
 
   55             std::ios::in | std::ios::binary | std::ios::ate);
 
   56         if(!templateStream.is_open()) {
 
   57             std::cerr << 
"Input static device information template could not be opened: "  
   58                 << outputPath.string() << std::endl;
 
   63         std::ifstream::pos_type size = templateStream.tellg();
 
   64         templateString.resize(size);
 
   66         templateStream.seekg(0, std::ios::beg);
 
   67         templateStream.read(const_cast<char*>(templateString.data()), size);
 
   69         templateStream.close();
 
   72         std::stringstream allDeviceInfo;
 
   73         torc::common::DeviceVector::const_iterator dp = inDeviceNames.begin();
 
   74         torc::common::DeviceVector::const_iterator de = inDeviceNames.end();
 
   77             if(device.empty()) 
break;
 
   81             if(dp < de) allDeviceInfo << std::endl;
 
   85         typedef std::map<std::string, std::string> SubstitutionMap;
 
   86         SubstitutionMap substitutions;
 
   87         substitutions[
"%%ARCHITECTURE%%"] = inFamilyName;
 
   88         substitutions[
"%%DEVICES%%"] = allDeviceInfo.str();
 
   89         substitutions[
"%%GENERATED%%"] = __FILE__;
 
   92         SubstitutionMap::iterator p = substitutions.begin();
 
   93         SubstitutionMap::iterator e = substitutions.end();
 
   96             boost::regex re(p->first);
 
   97             std::stringstream stringStream;
 
   98             std::ostream_iterator<char, char> stringIterator(stringStream);
 
  100             boost::regex_replace(stringIterator, templateString.begin(), templateString.end(), re, 
 
  101                 p->second, boost::match_default);
 
  103             templateString = stringStream.str();
 
  108         outputStream << templateString;
 
  109         outputStream.close();
 
Header for the DeviceInfoHelper class. 
 
Header for the DirectoryTree class. 
 
Xilinx bitstream base class. 
 
virtual void initializeDeviceInfo(const std::string &inDeviceName)
Initialize the maps between frame indexes and frame addresses.  This is generally only useful for int...
 
boost::filesystem::path path
 
void setDevice(const std::string &inDeviceName)
Assign the device enumeration constant for the given device name. 
 
static const boost::filesystem::path & getWorkingPath(void)
Returns the absolute path to the working directory. 
 
std::vector< std::string > DeviceVector
Vector of device names. 
 
virtual void writeDeviceInfo(std::ostream &inStream, const std::string &inDeviceName)
Output static device information to a stream. 
 
static void buildFamilyDeviceInfo(const std::string &inFamilyName, const std::string &inTemplateName, const std::string &inOutputName, const torc::common::DeviceVector &inDeviceNames, Bitstream &inBitstream)
Build the static device information for the specified family. 
 
Header for the DeviceInfo class.