torc-master
|
#include <AssemblerLibGen.hpp>
Public Member Functions | |
AssemblerLibGen (string inDevice, path inHarnessFolder, path inXdlGenerationFolder) | |
Constructor. More... | |
virtual | ~AssemblerLibGen () |
Destructor. More... | |
void | generateLogicXdls () |
Generrate Xdls for logic sites. More... | |
void | generateWireXdls () |
Generate Xdls for routing pips. More... | |
void | generateLogicAndWireXdl () |
Generate Xdls for both logic sites and routing pips. More... | |
void | generateBitstreams () |
Generate bitstream for all Xdls in mXdlGenerationFolder and mXdlGenerationReferenceFolder. More... | |
void | compressBitFiles () |
Compress all Xilinx bitfiles in mXdlGenerationFolder. More... | |
void | stitchMicroBitstreams () |
Stitch micro-bitstreams in mXdlGenerationFolder. More... | |
TileTypeToSiteTypeSet | getTileTypeToSiteTypeMap (void) |
Populate map of tile type to set of include site types. More... | |
void | printTileTypeToSiteTypeMapInfo (TileTypeToSiteTypeSet tileTypeToSiteType) |
Print the tile type to site type information. More... | |
Protected Member Functions | |
void | initialize () |
Initialize object of this class. More... | |
void | exportTileSinks (TileIndex inTileIndex) |
Export all pips within the specified tile. More... | |
void | exportSink (Tilewire &inSource, Tilewire &inSink) |
Export a single pip. More... | |
bool | isSlicelType (const string &inSiteType) |
Return true if site type is SLICEL. More... | |
DesignSharedPtr | getHarnessDesignForSiteType (const string &inSiteType) |
Returns harness design pointer for the given site type. More... | |
string | getReferenceConfigValue (const string &inConfigSetting) |
Return config value which results in off bit in bitstream. More... | |
DesignSharedPtr | createEmptyDesignWithSameMetadata (DesignSharedPtr inDesignPtr) |
Create an empty design with same metadata. Does not copy configurations. More... | |
bool | isRambSite (const string &inSiteType) |
Returns true if input is a RAMB site. More... | |
bool | isDspSite (const string &inSiteType) |
Returns true is input is a DSP site. More... | |
bool | isCompoundSettingHead (const string &inSetting) |
Is given setting head of compound setting group. More... | |
void | createXdlsForConfigSetting (const torc::architecture::PrimitiveElement &inElement, PrimitiveStructureSharedPtr const inPrimitiveStructurePtr, const string &inSiteType, DesignSharedPtr inHarnessDesignPtr) |
Create Xdls for each config value of the config setting More... | |
void | createXdlForGeneralConfigSetting (const string &inConfigSetting, const string &inConfigVal, const string &inXdlFileNamePartial, DesignSharedPtr inHarnessDesignPtr) |
Set config value and create Xdl. More... | |
void | createRambBaseXdl (const string &inSiteType, DesignSharedPtr inHarnessDesignPtr) |
Create Xdl with a Ramb instane and no configuration. More... | |
void | createHexConfigXdl (const string &inConfigSetting, const string &inSiteType, int numHexChars, DesignSharedPtr inHarnessDesignPtr) |
Create Xdl for configurations which hex string values. More... | |
void | createXdlForCompoundSettings (const PrimitiveElement &inElement, const string &inSiteType, PrimitiveStructureSharedPtr inPrimitiveStructurePtr, DesignSharedPtr inHarnessDesignPtr) |
Create Xdls for compound settings. More... | |
void | createXdlForOrphanElements (const torc::architecture::PrimitiveElement &inElement, const string &inXdlFileNamePartial, DesignSharedPtr inHarnessDesignPtr) |
Create Xdls for orphan elements with empty reference Xdl. More... | |
void | createXdlForLut (const torc::architecture::PrimitiveElement &inElement, const string &inXdlFileNamePartial, DesignSharedPtr inHarnessDesignPtr) |
Create Xdl for Lut. More... | |
void | createReferenceXdlForConfigSetting (const string &inConfigSetting, DesignSharedPtr outHarnessDesignPtr, const string &inXdlFileNamePartial) |
Create reference Xdl for given config setting. More... | |
void | setConfigAndGenerateXdl (const string &inConfigSetting, const string &inConfigValue, const string &inXdlFileName, DesignSharedPtr inOutDesignPtr) |
Set given config and generate Xdl. More... | |
uint32_t | getWordOffsetFromXdlFile (path inBitstreamPath, BitstreamSharedPtr inBitstreamPtr) |
Get word offset in frame for the site/pip in corresponding Xdl. More... | |
int | getElementIndexFromName (const string inElementName, PrimitiveStructureSharedPtr inPrimitiveStructurePtr) |
Get index in Element array. More... | |
void | saveLibraryMapToFile (TileTypeToSiteType &inLibrary) |
Save library map to file. More... | |
std::map< string, string > | getDeviceToPackageMap () |
Get a map from device to default package. More... | |
virtual string | getParentFamilyName () |
Returns parent family name. More... | |
virtual bool | isSiteTypeSupported (const string &inSiteType)=0 |
Returns true if site type is supported. More... | |
virtual std::vector< std::string > | getTilesSupportedForPips ()=0 |
Returns vector of supported tiles. More... | |
virtual std::string | getRambPrimaryPrimitive ()=0 |
Returns primary primitivie for RAMB site type More... | |
virtual void | compressBitFile (path primaryFile, path referenceFile)=0 |
Compress the diff of primary bitstream and reference bitstream. More... | |
virtual uint32_t | getWordOffsetFromTileLocation (TileRow tileRow, TileCol tileCol, BitstreamSharedPtr inBitstreamPtr)=0 |
Get word offset from tile location. More... | |
virtual PrimitiveStructuresSharedPtrMap | getPrimitiveNameToStructreMap ()=0 |
Populate primitive name to primitive structure map. More... | |
virtual void | generateMemoryMicroBitstream ()=0 |
Generate micro-bitstreams for memory elements like LUT in RAM mode. More... | |
Protected Attributes | |
DDB & | mDB |
Database object. More... | |
const Sites & | mSites |
Sites from the database object. More... | |
const Tiles & | mTiles |
Tiles from the database object. More... | |
path | mHarnessFolder |
Harness folder. More... | |
path | mXdlGenerationFolder |
Folder in which Xdls will be generated. More... | |
path | mXdlGenerationReferenceFolder |
Folder in which reference Xdls will be genered. More... | |
path | mLibraryFolder |
Path to library folder. More... | |
CompoundSettingMap | mCompoundSettingMap |
Map from one compound setting to vector of other related settings. More... | |
std::map< string, string > | mDeviceToPackageMap |
Map from device to pakcage. More... | |
std::map< string, string > | mReferenceConfigMap |
Map from config setting to reference config value. More... | |
string | mCurTileType |
Tile type for which Xdl are being generated currently. More... | |
Static Protected Attributes | |
static const char * | sNameSeparator = "-" |
Symbol to separate out parts of file name. More... | |
static const char * | sConfigValueOff = "#OFF" |
Config value to switch off element (#OFF) More... | |
static const char * | sXdlExtension = ".xdl" |
.xdl More... | |
static const char * | sLibExtension = ".ldb" |
.ldb More... | |
Definition at line 37 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 73 of file AssemblerLibGen.hpp.
typedef torc::bitstream::Assembler::CompoundSettingMap torc::bitstream::AssemblerLibGen::CompoundSettingMap |
Map from one setting to vector of related setings.
Definition at line 80 of file AssemblerLibGen.hpp.
typedef torc::bitstream::Assembler::ConfigSettingsToValues torc::bitstream::AssemblerLibGen::ConfigSettingsToValues |
Definition at line 76 of file AssemblerLibGen.hpp.
typedef torc::bitstream::Assembler::ConfigValuesToBits torc::bitstream::AssemblerLibGen::ConfigValuesToBits |
Definition at line 75 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 45 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 65 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 59 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 67 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 69 of file AssemblerLibGen.hpp.
typedef boost::filesystem::path torc::bitstream::AssemblerLibGen::path |
Imported type name.
Definition at line 43 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 61 of file AssemblerLibGen.hpp.
typedef torc::architecture::PrimitiveElementArray torc::bitstream::AssemblerLibGen::PrimitiveElementArray |
Imported type name.
Definition at line 63 of file AssemblerLibGen.hpp.
typedef torc::packer::PrimitiveStructureSharedPtr torc::bitstream::AssemblerLibGen::PrimitiveStructureSharedPtr |
Imported type name.
Definition at line 71 of file AssemblerLibGen.hpp.
typedef std::map<std::string, PrimitiveStructureSharedPtr> torc::bitstream::AssemblerLibGen::PrimitiveStructuresSharedPtrMap |
Typedef of map from primitive name to primitive structure shared pointer.
Definition at line 86 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 49 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 47 of file AssemblerLibGen.hpp.
typedef torc::bitstream::Assembler::SiteTypeToConfigSettings torc::bitstream::AssemblerLibGen::SiteTypeToConfigSettings |
Definition at line 77 of file AssemblerLibGen.hpp.
typedef std::string torc::bitstream::AssemblerLibGen::string |
Imported type name.
Definition at line 41 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 55 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 53 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 51 of file AssemblerLibGen.hpp.
typedef torc::bitstream::Assembler::TileTypeToSiteType torc::bitstream::AssemblerLibGen::TileTypeToSiteType |
Definition at line 78 of file AssemblerLibGen.hpp.
typedef std::map<std::string,std::set<std::string> > torc::bitstream::AssemblerLibGen::TileTypeToSiteTypeSet |
Typedef of map from tile type to set of site type.
Definition at line 84 of file AssemblerLibGen.hpp.
Imported type name.
Definition at line 57 of file AssemblerLibGen.hpp.
|
inline |
Constructor.
Definition at line 89 of file AssemblerLibGen.hpp.
|
inlinevirtual |
|
protectedpure virtual |
Compress the diff of primary bitstream and reference bitstream.
Implemented in torc::bitstream::Virtex7LibGen, and torc::bitstream::Virtex5LibGen.
void torc::bitstream::AssemblerLibGen::compressBitFiles | ( | ) |
Compress all Xilinx bitfiles in mXdlGenerationFolder.
Definition at line 736 of file AssemblerLibGen.cpp.
|
protected |
Create an empty design with same metadata. Does not copy configurations.
Return empty design with same metadata
Definition at line 383 of file AssemblerLibGen.cpp.
|
protected |
Create Xdl for configurations which hex string values.
Create Xdl for configurations with values as hex string.
Definition at line 461 of file AssemblerLibGen.cpp.
|
protected |
Create Xdl with a Ramb instane and no configuration.
Create Xdl with just Ramb site instantiated.
Definition at line 436 of file AssemblerLibGen.cpp.
|
protected |
Create reference Xdl for given config setting.
Definition at line 669 of file AssemblerLibGen.cpp.
|
protected |
Create Xdls for compound settings.
Definition at line 491 of file AssemblerLibGen.cpp.
|
protected |
Set config value and create Xdl.
Definition at line 392 of file AssemblerLibGen.cpp.
|
protected |
Create Xdl for Lut.
Definition at line 614 of file AssemblerLibGen.cpp.
|
protected |
Create Xdls for orphan elements with empty reference Xdl.
Definition at line 576 of file AssemblerLibGen.cpp.
|
protected |
Create Xdls for each config value of the config setting
Definition at line 401 of file AssemblerLibGen.cpp.
|
protected |
Export a single pip.
Definition at line 231 of file AssemblerLibGen.cpp.
|
protected |
Export all pips within the specified tile.
Definition at line 199 of file AssemblerLibGen.cpp.
void torc::bitstream::AssemblerLibGen::generateBitstreams | ( | ) |
Generate bitstream for all Xdls in mXdlGenerationFolder and mXdlGenerationReferenceFolder.
Generates bitstream for all Xdls be calling a perl script which iterates over Xdls and calls Xilinxs tools to create bitstream
Definition at line 720 of file AssemblerLibGen.cpp.
void torc::bitstream::AssemblerLibGen::generateLogicAndWireXdl | ( | ) |
Generate Xdls for both logic sites and routing pips.
void torc::bitstream::AssemblerLibGen::generateLogicXdls | ( | ) |
Generrate Xdls for logic sites.
Generate micro-Xdl for logic sites.
Definition at line 62 of file AssemblerLibGen.cpp.
|
protectedpure virtual |
Generate micro-bitstreams for memory elements like LUT in RAM mode.
Implemented in torc::bitstream::Virtex7LibGen, and torc::bitstream::Virtex5LibGen.
void torc::bitstream::AssemblerLibGen::generateWireXdls | ( | ) |
Generate Xdls for routing pips.
Generate XDL files for tiles supported for PIPs.
Definition at line 167 of file AssemblerLibGen.cpp.
|
inlineprotected |
Get a map from device to default package.
Definition at line 186 of file AssemblerLibGen.hpp.
|
protected |
Get index in Element array.
Definition at line 937 of file AssemblerLibGen.cpp.
|
protected |
Returns harness design pointer for the given site type.
Every site type has a harness design which serves as base generating Xdl for all configurations of the site type
Definition at line 347 of file AssemblerLibGen.cpp.
|
inlineprotectedvirtual |
Returns parent family name.
Virtual Functions
Reimplemented in torc::bitstream::Virtex7LibGen.
Definition at line 197 of file AssemblerLibGen.hpp.
|
protectedpure virtual |
Populate primitive name to primitive structure map.
Implemented in torc::bitstream::Virtex7LibGen, and torc::bitstream::Virtex5LibGen.
|
protectedpure virtual |
Returns primary primitivie for RAMB site type
Implemented in torc::bitstream::Virtex5LibGen, and torc::bitstream::Virtex7LibGen.
|
protected |
Return config value which results in off bit in bitstream.
Returns reference config value for give config setting.
Definition at line 370 of file AssemblerLibGen.cpp.
|
protectedpure virtual |
Returns vector of supported tiles.
Implemented in torc::bitstream::Virtex5LibGen, and torc::bitstream::Virtex7LibGen.
AssemblerLibGen::TileTypeToSiteTypeSet torc::bitstream::AssemblerLibGen::getTileTypeToSiteTypeMap | ( | void | ) |
Populate map of tile type to set of include site types.
A tile can contain more than one site. This functions returns a map from tile type to set of contained site types
Definition at line 277 of file AssemblerLibGen.cpp.
|
protectedpure virtual |
Get word offset from tile location.
Implemented in torc::bitstream::Virtex7LibGen, and torc::bitstream::Virtex5LibGen.
|
protected |
Get word offset in frame for the site/pip in corresponding Xdl.
Get word offset from Xdl.
Definition at line 883 of file AssemblerLibGen.cpp.
|
protected |
Initialize object of this class.
Initialie function called from constructor.
Definition at line 39 of file AssemblerLibGen.cpp.
|
inlineprotected |
Is given setting head of compound setting group.
Definition at line 144 of file AssemblerLibGen.hpp.
|
inlineprotected |
Returns true is input is a DSP site.
Definition at line 140 of file AssemblerLibGen.hpp.
|
inlineprotected |
Returns true if input is a RAMB site.
Definition at line 136 of file AssemblerLibGen.hpp.
|
protectedpure virtual |
Returns true if site type is supported.
Implemented in torc::bitstream::Virtex5LibGen, and torc::bitstream::Virtex7LibGen.
|
inlineprotected |
Return true if site type is SLICEL.
Definition at line 126 of file AssemblerLibGen.hpp.
void torc::bitstream::AssemblerLibGen::printTileTypeToSiteTypeMapInfo | ( | TileTypeToSiteTypeSet | tileTypeToSiteType | ) |
Print the tile type to site type information.
Prints list of tile types and the site types in each of the tile types
Definition at line 327 of file AssemblerLibGen.cpp.
|
protected |
Save library map to file.
Saves the library map structure in database format
Definition at line 955 of file AssemblerLibGen.cpp.
|
protected |
Set given config and generate Xdl.
Definition at line 703 of file AssemblerLibGen.cpp.
void torc::bitstream::AssemblerLibGen::stitchMicroBitstreams | ( | ) |
Stitch micro-bitstreams in mXdlGenerationFolder.
Stitch micro-bitstreams in folder mXdlGenerationFolder Go over all files with extension .cbit, split file name on '-' to get family, tile type, site type, config setting, and config value. The vector of address and names are stored in map data structure and then stored in a file. File format is - <<<<BITLIBDB>>>> Number of tile types Tile type name char count Tile type Number of sites Site type name char count Site type Config seting name char count Config setting Config value name char count Config value Number of 32bit words in compressed bitstream words
Definition at line 802 of file AssemblerLibGen.cpp.
|
protected |
Map from one compound setting to vector of other related settings.
Definition at line 224 of file AssemblerLibGen.hpp.
|
protected |
Tile type for which Xdl are being generated currently.
Definition at line 228 of file AssemblerLibGen.hpp.
|
protected |
Database object.
Definition at line 217 of file AssemblerLibGen.hpp.
Map from device to pakcage.
Definition at line 225 of file AssemblerLibGen.hpp.
|
protected |
Harness folder.
Definition at line 220 of file AssemblerLibGen.hpp.
|
protected |
Path to library folder.
Definition at line 223 of file AssemblerLibGen.hpp.
Map from config setting to reference config value.
Definition at line 226 of file AssemblerLibGen.hpp.
|
protected |
Sites from the database object.
Definition at line 218 of file AssemblerLibGen.hpp.
|
protected |
Tiles from the database object.
Definition at line 219 of file AssemblerLibGen.hpp.
|
protected |
Folder in which Xdls will be generated.
Definition at line 221 of file AssemblerLibGen.hpp.
|
protected |
Folder in which reference Xdls will be genered.
Definition at line 222 of file AssemblerLibGen.hpp.
|
staticprotected |
Config value to switch off element (#OFF)
Definition at line 230 of file AssemblerLibGen.hpp.
|
staticprotected |
.ldb
Definition at line 232 of file AssemblerLibGen.hpp.
|
staticprotected |
Symbol to separate out parts of file name.
static const initialization
Definition at line 229 of file AssemblerLibGen.hpp.
|
staticprotected |
.xdl
Definition at line 231 of file AssemblerLibGen.hpp.