18 #ifndef ASSEMBLERLIBGEN_HPP_
19 #define ASSEMBLERLIBGEN_HPP_
24 #include "../Assembler.hpp"
31 #include <boost/filesystem/path.hpp>
32 #include <boost/regex.hpp>
127 return boost::regex_search(inSiteType.begin(), inSiteType.end(), boost::regex(
"SLICEL"));
137 return boost::regex_search(inSiteType, boost::regex(
"RAMB"));
141 return boost::regex_search(inSiteType, boost::regex(
"DSP"));
158 const string &inXdlFileNamePartial,
DesignSharedPtr inHarnessDesignPtr);
162 void createHexConfigXdl(
const string &inConfigSetting,
const string &inSiteType,
int numHexChars,
169 const string &inXdlFileNamePartial,
DesignSharedPtr inHarnessDesignPtr);
175 const string &inXdlFileNamePartial);
187 std::map<string, string> deviceToPackageMap;
188 deviceToPackageMap[
"xc5vfx130t"] =
"FF1738";
189 deviceToPackageMap[
"xc5vlx110t"] =
"FF1136";
190 deviceToPackageMap[
"xc7a100t"] =
"FGG484";
191 deviceToPackageMap[
"xc7z045"] =
"FBG676";
192 return deviceToPackageMap;
void generateWireXdls()
Generate Xdls for routing pips.
std::string string
Imported type name.
Encapsulation of a tile index in an unsigned 32-bit integer.
torc::physical::InstanceSharedPtr InstanceSharedPtr
Imported type name.
Encapsulation of a tile row in an unsigned 16-bit integer.
path mXdlGenerationFolder
Folder in which Xdls will be generated.
std::map< const string, std::vector< string > > CompoundSettingMap
Element name to vector of related element names that collectively affect bits.
torc::architecture::TileInfo TileInfo
Imported type name.
torc::bitstream::Assembler::ConfigValuesToBits ConfigValuesToBits
torc::architecture::DDB DDB
Imported type name.
static const char * sLibExtension
.ldb
void createXdlForOrphanElements(const torc::architecture::PrimitiveElement &inElement, const string &inXdlFileNamePartial, DesignSharedPtr inHarnessDesignPtr)
Create Xdls for orphan elements with empty reference Xdl.
Encapsulation of a tile column in an unsigned 16-bit integer.
Main torc::architecture namespace header.
std::map< string, string > getDeviceToPackageMap()
Get a map from device to default package.
Device database, including complete wiring and logic support.
void printTileTypeToSiteTypeMapInfo(TileTypeToSiteTypeSet tileTypeToSiteType)
Print the tile type to site type information.
torc::architecture::PrimitiveElementArray PrimitiveElementArray
Imported type name.
std::map< const string, ConfigValuesToBits > ConfigSettingsToValues
Map from config setting to config values. ConfigSettingsToValues.
bool isRambSite(const string &inSiteType)
Returns true if input is a RAMB site.
const string & getFamilyName(void) const
Returns the family name.
const Sites & mSites
Sites from the database object.
Header for the Instance class.
void createXdlForGeneralConfigSetting(const string &inConfigSetting, const string &inConfigVal, const string &inXdlFileNamePartial, DesignSharedPtr inHarnessDesignPtr)
Set config value and create Xdl.
void exportTileSinks(TileIndex inTileIndex)
Export all pips within the specified tile.
path mXdlGenerationReferenceFolder
Folder in which reference Xdls will be genered.
virtual ~AssemblerLibGen()
Destructor.
bool isSlicelType(const string &inSiteType)
Return true if site type is SLICEL.
std::map< const string, SiteTypeToConfigSettings > TileTypeToSiteType
Map from tile type to site types. Includes routing as a site type.
torc::architecture::Sites Sites
Imported type name.
void generateLogicAndWireXdl()
Generate Xdls for both logic sites and routing pips.
Header for the PrimitiveStructure class.
torc::architecture::PrimitiveElement PrimitiveElement
Imported type name.
torc::architecture::Site Site
Imported type name.
static const char * sNameSeparator
Symbol to separate out parts of file name.
path mHarnessFolder
Harness folder.
void setConfigAndGenerateXdl(const string &inConfigSetting, const string &inConfigValue, const string &inXdlFileName, DesignSharedPtr inOutDesignPtr)
Set given config and generate Xdl.
virtual void generateMemoryMicroBitstream()=0
Generate micro-bitstreams for memory elements like LUT in RAM mode.
int getElementIndexFromName(const string inElementName, PrimitiveStructureSharedPtr inPrimitiveStructurePtr)
Get index in Element array.
uint32_t getWordOffsetFromXdlFile(path inBitstreamPath, BitstreamSharedPtr inBitstreamPtr)
Get word offset in frame for the site/pip in corresponding Xdl.
std::map< std::string, std::set< std::string > > TileTypeToSiteTypeSet
Typedef of map from tile type to set of site type.
void saveLibraryMapToFile(TileTypeToSiteType &inLibrary)
Save library map to file.
virtual void compressBitFile(path primaryFile, path referenceFile)=0
Compress the diff of primary bitstream and reference bitstream.
string getReferenceConfigValue(const string &inConfigSetting)
Return config value which results in off bit in bitstream.
void createRambBaseXdl(const string &inSiteType, DesignSharedPtr inHarnessDesignPtr)
Create Xdl with a Ramb instane and no configuration.
void exportSink(Tilewire &inSource, Tilewire &inSink)
Export a single pip.
virtual uint32_t getWordOffsetFromTileLocation(TileRow tileRow, TileCol tileCol, BitstreamSharedPtr inBitstreamPtr)=0
Get word offset from tile location.
Encapsulation of a device logic site.
std::map< string, string > mReferenceConfigMap
Map from config setting to reference config value.
CompoundSettingMap mCompoundSettingMap
Map from one compound setting to vector of other related settings.
AssemblerLibGen(string inDevice, path inHarnessFolder, path inXdlGenerationFolder)
Constructor.
string mCurTileType
Tile type for which Xdl are being generated currently.
Site type and population data for the family and the device.
static const char * sConfigValueOff
Config value to switch off element (#OFF)
Header for the Design class.
Encapsulation of a device tile and wire pair.
const Tiles & mTiles
Tiles from the database object.
Tile map, tile type, and wire information for the family and device.
virtual bool isSiteTypeSupported(const string &inSiteType)=0
Returns true if site type is supported.
torc::architecture::Tiles Tiles
Imported type name.
torc::architecture::ExtendedWireInfo ExtendedWireInfo
Imported type name.
Header for the Bitstream class.
Encapsulation of a tile within a device tile map.
boost::shared_ptr< Net > NetSharedPtr
Shared pointer encapsulation of a Net.
Verbose encapsulation of a wire's information.
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
boost::filesystem::path path
virtual std::string getRambPrimaryPrimitive()=0
Returns primary primitivie for RAMB site type
boost::shared_ptr< Instance > InstanceSharedPtr
Shared pointer encapsulation of an Instance.
void createXdlForCompoundSettings(const PrimitiveElement &inElement, const string &inSiteType, PrimitiveStructureSharedPtr inPrimitiveStructurePtr, DesignSharedPtr inHarnessDesignPtr)
Create Xdls for compound settings.
TileTypeToSiteTypeSet getTileTypeToSiteTypeMap(void)
Populate map of tile type to set of include site types.
std::map< std::string, PrimitiveStructureSharedPtr > PrimitiveStructuresSharedPtrMap
Typedef of map from primitive name to primitive structure shared pointer.
bool isCompoundSettingHead(const string &inSetting)
Is given setting head of compound setting group.
DDB & mDB
Database object.
torc::bitstream::Assembler::ConfigSettingsToValues ConfigSettingsToValues
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
DesignSharedPtr getHarnessDesignForSiteType(const string &inSiteType)
Returns harness design pointer for the given site type.
torc::bitstream::Assembler::SiteTypeToConfigSettings SiteTypeToConfigSettings
bool isDspSite(const string &inSiteType)
Returns true is input is a DSP site.
void createReferenceXdlForConfigSetting(const string &inConfigSetting, DesignSharedPtr outHarnessDesignPtr, const string &inXdlFileNamePartial)
Create reference Xdl for given config setting.
std::map< const string, ConfigSettingsToValues > SiteTypeToConfigSettings
Map from site type to config settings. SiteTypeToConfigSettings.
torc::physical::NetSharedPtr NetSharedPtr
Imported type name.
static const char * sXdlExtension
.xdl
Encapsulation of a primitive site element. Primitive elements are subcomponents of logic primitive s...
void stitchMicroBitstreams()
Stitch micro-bitstreams in mXdlGenerationFolder.
void createHexConfigXdl(const string &inConfigSetting, const string &inSiteType, int numHexChars, DesignSharedPtr inHarnessDesignPtr)
Create Xdl for configurations which hex string values.
void compressBitFiles()
Compress all Xilinx bitfiles in mXdlGenerationFolder.
void generateBitstreams()
Generate bitstream for all Xdls in mXdlGenerationFolder and mXdlGenerationReferenceFolder.
path mLibraryFolder
Path to library folder.
boost::shared_ptr< PrimitiveStructure > PrimitiveStructureSharedPtr
Shared pointer encapsulation of a PrimitiveStructure.
torc::bitstream::Assembler::TileTypeToSiteType TileTypeToSiteType
Header for the Net class.
void generateLogicXdls()
Generrate Xdls for logic sites.
void initialize()
Initialize object of this class.
torc::bitstream::Assembler::CompoundSettingMap CompoundSettingMap
Map from one setting to vector of related setings.
std::map< string, string > mDeviceToPackageMap
Map from device to pakcage.
virtual string getParentFamilyName()
Returns parent family name.
boost::shared_ptr< Bitstream > BitstreamSharedPtr
torc::bitstream::BitstreamSharedPtr BitstreamSharedPtr
Imported type name.
void createXdlForLut(const torc::architecture::PrimitiveElement &inElement, const string &inXdlFileNamePartial, DesignSharedPtr inHarnessDesignPtr)
Create Xdl for Lut.
virtual std::vector< std::string > getTilesSupportedForPips()=0
Returns vector of supported tiles.
DesignSharedPtr createEmptyDesignWithSameMetadata(DesignSharedPtr inDesignPtr)
Create an empty design with same metadata. Does not copy configurations.
torc::architecture::xilinx::TileIndex TileIndex
Imported type name.
torc::architecture::Tilewire Tilewire
Imported type name.
std::map< const string, std::vector< uint32_t > > ConfigValuesToBits
Map from config value to vector of config bits. ConfigValuesToBits.
boost::filesystem::path path
Imported type name.
torc::physical::DesignSharedPtr DesignSharedPtr
Imported type name.
torc::packer::PrimitiveStructureSharedPtr PrimitiveStructureSharedPtr
Imported type name.
virtual PrimitiveStructuresSharedPtrMap getPrimitiveNameToStructreMap()=0
Populate primitive name to primitive structure map.