torc-master
|
#include <Virtex7Assembler.hpp>
Public Types | |
typedef torc::bitstream::VirtexFrameBlocks | VirtexFrameBlocks |
Imported type. More... | |
enum | EOperation { eAND, eOR, eXOR, eNOT } |
Permissible operations on LUT frames. More... | |
enum | EMergeMode { eSet, eClear } |
typedef std::string | string |
Imported type name. More... | |
typedef std::istream | istream |
Imported type name. More... | |
typedef torc::physical::DesignSharedPtr | DesignSharedPtr |
Imported type name. More... | |
typedef torc::physical::InstanceSharedPtr | InstanceSharedPtr |
Imported type name. More... | |
typedef torc::architecture::DDB | DDB |
Imported type name. More... | |
typedef boost::filesystem::path | path |
Imported type name. More... | |
typedef std::map< const string, std::vector< string > > | CompoundSettingMap |
Element name to vector of related element names that collectively affect bits. More... | |
typedef std::map< const string, std::vector< uint32_t > > | ConfigValuesToBits |
Map from config value to vector of config bits. ConfigValuesToBits. More... | |
typedef std::map< const string, ConfigValuesToBits > | ConfigSettingsToValues |
Map from config setting to config values. ConfigSettingsToValues. More... | |
typedef std::map< const string, ConfigSettingsToValues > | SiteTypeToConfigSettings |
Map from site type to config settings. SiteTypeToConfigSettings. More... | |
typedef std::map< const string, SiteTypeToConfigSettings > | TileTypeToSiteType |
Map from tile type to site types. Includes routing as a site type. More... | |
typedef std::map< int32_t, map < int32_t, uint32_t > > | FrameWords |
Currently not in use. Datastructure to store LUT frames in efficient and flexible way. More... | |
Public Member Functions | |
Virtex7Assembler (torc::architecture::DDB &inDB) | |
virtual int | generateBitstream (DesignSharedPtr inDesignPtr, const path inTargetBitstreamPath, EMergeMode inMergeMode=eSet, path baseBitstreamPath=path()) |
Function to generate bitstream to be called by user. More... | |
bool | processLut (const string &input, const string &name="string stream") |
Import Lut expression from a string. More... | |
void | error (const location &l, const string &m) |
Lut parse error handling. More... | |
void | error (const string &m) |
Lut general error handling. More... | |
void | failure (void) |
Signals a parsing failure by deasserting the success flag. More... | |
void | binaryLutFrameOperation (EOperation inOperation) |
Function called from parser when it encounters a bit operator. More... | |
void | pushLutFrame (string inLiteral) |
Function called from parser when it encounters a literal. More... | |
Static Public Member Functions | |
static int | hexCharacterToDec (char inDigit) |
Convert a hex ASCII character to a decimal value. More... | |
Data Fields | |
bool | mTraceScanning |
Enable debug output in the flex scanner. More... | |
bool | mTraceParsing |
Enable debug output in the bison parser. More... | |
string | mStreamName |
Name of file or input stream for error messages. More... | |
class torc::LutScanner * | lexer |
Pointer to the current lexer instance. More... | |
Protected Member Functions | |
void | initialize (void) |
virtual bool | isSiteTypeSupported (const std::string &inSiteType) |
Returns true if site type is supported. More... | |
virtual bool | isCompoundSetting (string inElementName) |
Returns true if input resource is associated with compound group. More... | |
virtual vector< string > | getDependantConfigs (string inElement1Name) |
Returs vector of related configurations. More... | |
virtual void | initializeFullFrameBlocks () |
virtual void | updateFullFrameBlocks () |
virtual uint32_t | getPrimaryXdlColumn (TileCol inTileColumn) |
For an INT tile, returns associated CLB column. More... | |
virtual torc::bitstream::VirtexFrameBlocks | getXdlFrames (TileRow inTileRow, uint32_t inPrimaryXdlCol, uint32_t inBitIndexBegin, uint32_t inBitIndexEnd) |
virtual void | initializeFrameDataForTile (TileIndex tileIndex) |
Store frame blocks and bit offset for given tile index. More... | |
virtual void | initializeFrameDataForSite (const std::string &siteName) |
Store frame blocks and bit offset for given site. More... | |
virtual void | mergeWithBaseBitstream (const std::vector< uint32_t > &bitAddresses, uint32_t blockIndex) |
Merge compressed micro-bitstream with base bitstream. More... | |
void | convertXdlToBitstream (void) |
Initiates Xdl to bitstream conversion. More... | |
void | saveBitstream (void) |
Save bitstream. More... | |
void | assembleInstances (void) |
Assemble bitstream for instances. More... | |
void | assembleNets (void) |
Assemble bitstream for nets. More... | |
void | assembleRamb (torc::physical::InstanceSharedPtr inInstancePtr) |
Assemble bitstream for Ramb. More... | |
string | getTiletypeFromSitename (const string &inSiteType) |
Get tile type from site type. More... | |
virtual void | checkValidityAndMergeBitstream (string inElementName, string inConfigValue, const ConfigSettingsToValues &inConfigMap) |
Verify the configuratino and merge with base bitstream. More... | |
virtual bool | isLutEquationSetting (const string &inConfigValue) |
Is config value a LUT equation. More... | |
virtual bool | isRoutethrough (const string &inSetting) |
Is config a _ROUTETHROUGH. More... | |
virtual bool | isLutRamOrRomSetting (const string &inConfigVal) |
Is config value a LUT ram setting. More... | |
virtual bool | isRambSite (const string &inSiteType) |
Returns true if the site is some form of RAMB site. More... | |
virtual bool | isConfigValHexString (const string &inSiteType, const string &inElementName) |
Does the configuration have hex string in config value. More... | |
bool | isMemoryInitSetting (const string &inConfigName) |
Is ramb memory init setting. More... | |
bool | isMemoryParityInitSetting (const string &inConfigName) |
Is ramb parity init setting. More... | |
bool | tileAndSiteExistInLibrary (const string &inTileType, const string &inSiteType) |
Is site present in library database ToDo: This function will need tile type also. More... | |
bool | elementAndConfigExistInLibrary (const string &inElementName, const string &configValue, ConfigSettingsToValues &inConfigSettingToValues) |
Is configuration present in given map. More... | |
virtual void | getAnnotatedSiteTypeForSlicel (string &inOutSiteType, const string &siteLocation) |
If slice site type, annotate type as per even or odd column. More... | |
void | mergeLutEquationBits (const string &inElementName, const string &inConfigValue, ConfigSettingsToValues &inConfigSettingToValues) |
Merge micro-bitstream for Lut equation. More... | |
void | mergeLutRamOrRomBits (const string &inElementName, const string &inConfigVal, ConfigSettingsToValues &inConfigSettingToValues) |
Merge micro-bitsram for Lut in ram/rom mode. More... | |
void | mergeCompoundSettingBits (string inElement1Name, string inConfig1Val, InstanceSharedPtr inInstancePtr, const ConfigSettingsToValues &inConfigSettingToValues) |
Merge micro-bitstream for compound setting. More... | |
void | mergeHexConfigBits (string inElementName, string inConfigVal, const ConfigSettingsToValues &inConfigSettingToValues) |
Merge micro-bitstream for configuration with Hex values. More... | |
void | mergeRambInitBits (const string &inConfigVal, uint32_t inMemoryInitRow, const vector< uint32_t > &inBitAddresses, uint32_t inBlock) |
Merge micro-bitstreams for ramb memory init values. More... | |
void | populateLibraryMap (path inLibDBPath) |
Read micro-bitstream library file and populate it in a map. More... | |
bool | isBigEndianMachine () |
Check if processor is big endian. More... | |
void | readWord (std::ifstream &fileStream, uint32_t &outWord) |
Read word from stream and convert endianness if required. More... | |
uint32_t | reverseEndianness (uint32_t inWord) |
Reverse endianness of input word. More... | |
Protected Attributes | |
CompoundSettingMap | mCompoundSettingMap |
torc::bitstream::VirtexFrameBlocks | mCurrFrameBlocks |
Frame blocks for current site/tile. More... | |
boost::uint32_t | mCurrWordOffset |
Word offset withing frame for current site/tile. More... | |
torc::physical::DesignSharedPtr | mDesignPtr |
Xdl design pointer. More... | |
path | mTargetBitstreamPath |
Target bitstream path. More... | |
EMergeMode | mMergeMode |
Merge mode - set bits or clear bits. More... | |
TileTypeToSiteType | mLibrary |
Micro-bitstream library in map datastructure. More... | |
const torc::architecture::DDB & | mDB |
Torc database of architecutre on which design is implemented. More... | |
const torc::architecture::Sites & | mSites |
Sites from the architecture database. More... | |
const torc::architecture::Tiles & | mTiles |
Tiles from architecture database. More... | |
bool | mFreeDB |
To track if DB object was allocated in constructor. More... | |
torc::bitstream::BitstreamSharedPtr | mBitstreamPtr |
boost::filesystem::path | mLibraryPath |
Pointer to bitstream object to which micro bitstreams are merged. More... | |
string | mParentFamilyName |
bool | mSuccess |
Flag signaling parsing success. More... | |
bool | mBigEndian |
vector< vector< uint32_t > > | mLutFrameSetStack |
Frame set for literals are pushed to this stack. More... | |
uint32_t | mLutCurrentReferenceFrameIndex |
Address of 1st frame being affected by Lut equation. More... | |
uint32_t | mCurrentReferenceWordIndex |
Address of 1st work within frame affected by Lut equation. More... | |
std::vector< uint32_t > | mLutFrameSetForOne |
Frame set for Lut output assigned to 1. More... | |
ConfigValuesToBits | mCurrentConfigToBitMap |
Map from Lut config value to micro-bitstreams. More... | |
string | mLutCurrentEquationLhs |
LHS of Lut equation currently being processed. More... | |
int | mUnsupportedTileTypeCount |
int | mUnsupportedTileCount |
int | mUnsupportedPipCount |
int | mUnsupportedInstCount |
int | mMissingConfigs |
std::set< std::string > | mUnsupportedTileTypeSet |
Static Protected Attributes | |
static const string | sLibraryRelativePath = "torc/bitstream/assembler/libraries" |
Path to library folder containing mirco-bitstream database. More... | |
static const string | sLibraryExtension = ".ldb" |
Extension used for micro-bitstream libraries. More... | |
static const string | sConfigOff = "#OFF" |
String used when an element is explicity configured off. More... | |
static const boost::regex | sLutRamOrRomConfigRegEx |
Regex to identify Luts configured as ram/rom. More... | |
static const boost::regex | sLutConfigRegEx |
Regex to identify Lut configuration. More... | |
static const boost::regex | sRoutethroughRegEx |
Regex to indentify ROUTETHROUGH configuration in instances. More... | |
Definition at line 29 of file Virtex7Assembler.hpp.
|
inherited |
Element name to vector of related element names that collectively affect bits.
Definition at line 71 of file Assembler.hpp.
|
inherited |
Map from config setting to config values. ConfigSettingsToValues.
Definition at line 75 of file Assembler.hpp.
|
inherited |
Map from config value to vector of config bits. ConfigValuesToBits.
Definition at line 73 of file Assembler.hpp.
|
inherited |
Imported type name.
Definition at line 65 of file Assembler.hpp.
|
inherited |
Imported type name.
Definition at line 61 of file Assembler.hpp.
|
inherited |
Currently not in use. Datastructure to store LUT frames in efficient and flexible way.
Definition at line 81 of file Assembler.hpp.
Imported type name.
Definition at line 63 of file Assembler.hpp.
|
inherited |
Imported type name.
Definition at line 59 of file Assembler.hpp.
|
inherited |
Imported type name.
Definition at line 67 of file Assembler.hpp.
|
inherited |
Map from site type to config settings. SiteTypeToConfigSettings.
Definition at line 77 of file Assembler.hpp.
|
inherited |
Imported type name.
Definition at line 57 of file Assembler.hpp.
|
inherited |
Map from tile type to site types. Includes routing as a site type.
Definition at line 79 of file Assembler.hpp.
|
inherited |
Imported type.
Definition at line 38 of file VirtexAssembler.hpp.
|
inherited |
|
inherited |
Permissible operations on LUT frames.
Enumerator | |
---|---|
eAND | |
eOR | |
eXOR | |
eNOT |
Definition at line 51 of file Assembler.hpp.
|
inline |
Definition at line 32 of file Virtex7Assembler.hpp.
|
protectedinherited |
Assemble bitstream for instances.
Function to assemble micro-bitstreams for instances of Xdl design. This function iterates over instances, stores frame blocks and bit offset within for site location, and then iterates over config settings of the instance. Ramb instances are handled in separate function. Special cases for configurations are - lut equations, lut in ram/rom mode, compound configuration, and configuration with hex values.
Definition at line 123 of file Assembler.cpp.
|
protectedinherited |
Assemble bitstream for nets.
Function to assemble micro-bitstreams for net of Xdl design.
Definition at line 210 of file Assembler.cpp.
|
protectedinherited |
Assemble bitstream for Ramb.
Assemble micro-bitstream for ramb site. First the base micro-bitstream is merged. Micro-bitstream info for memory and parity init values are gathered from ll files.
Definition at line 260 of file Assembler.cpp.
|
inherited |
Function called from parser when it encounters a bit operator.
Perform bit operation on two frame set from stack for lut operation.
Definition at line 747 of file Assembler.cpp.
|
protectedvirtualinherited |
Verify the configuratino and merge with base bitstream.
Check if configurations is present in library. If yes, merge the corresponding bits with the bitstream.
Definition at line 357 of file Assembler.cpp.
|
protectedinherited |
Initiates Xdl to bitstream conversion.
Protected function to internally initiate micro-bitstream assembly process. This function should be called after design ptr, base bitstream, and library have be initialized.
Definition at line 104 of file Assembler.cpp.
|
protectedinherited |
Is configuration present in given map.
Returns true if configuration is preseRnt in library.
Definition at line 379 of file Assembler.cpp.
Lut parse error handling.
Definition at line 849 of file Assembler.cpp.
|
inherited |
Lut general error handling.
Definition at line 854 of file Assembler.cpp.
|
inlineinherited |
Signals a parsing failure by deasserting the success flag.
Definition at line 135 of file Assembler.hpp.
|
virtualinherited |
Function to generate bitstream to be called by user.
Public function to be called by user to initiate bitstream generation process. The parameter inBaseBitstreamPath will act as base bitstream for micro-bitstream assembly process. This function might be implemented in derived class for additional architecture specific processing.
Reimplemented from torc::bitstream::Assembler.
Definition at line 35 of file VirtexAssembler.cpp.
|
protectedvirtualinherited |
If slice site type, annotate type as per even or odd column.
Definition at line 396 of file Assembler.cpp.
|
inlineprotectedvirtual |
Returs vector of related configurations.
Implements torc::bitstream::VirtexAssembler.
Definition at line 71 of file Virtex7Assembler.hpp.
|
inlineprotectedvirtual |
For an INT tile, returns associated CLB column.
Implements torc::bitstream::VirtexAssembler.
Definition at line 88 of file Virtex7Assembler.hpp.
|
protectedinherited |
Get tile type from site type.
Get tile type from site location(name) ToDo: A lot of this code is present in initializeFrameDataForSite()
Definition at line 345 of file Assembler.cpp.
|
inlineprotectedvirtual |
Implements torc::bitstream::VirtexAssembler.
Definition at line 94 of file Virtex7Assembler.hpp.
|
inlinestaticinherited |
Convert a hex ASCII character to a decimal value.
Definition at line 139 of file Assembler.hpp.
|
inlineprotected |
Definition at line 38 of file Virtex7Assembler.hpp.
|
protectedvirtualinherited |
Store frame blocks and bit offset for given site.
Store frame data and bit offset for site
Implements torc::bitstream::Assembler.
Definition at line 55 of file VirtexAssembler.cpp.
|
protectedvirtual |
Store frame blocks and bit offset for given tile index.
Store frame data and bit offset for given tile index
Implements torc::bitstream::VirtexAssembler.
Definition at line 22 of file Virtex7Assembler.cpp.
|
inlineprotectedvirtual |
Implements torc::bitstream::VirtexAssembler.
Definition at line 75 of file Virtex7Assembler.hpp.
|
inlineprotectedinherited |
Check if processor is big endian.
Definition at line 268 of file Assembler.hpp.
|
inlineprotectedvirtual |
Returns true if input resource is associated with compound group.
Implements torc::bitstream::VirtexAssembler.
Definition at line 61 of file Virtex7Assembler.hpp.
|
inlineprotectedvirtualinherited |
Does the configuration have hex string in config value.
Definition at line 200 of file Assembler.hpp.
|
inlineprotectedvirtualinherited |
Is config value a LUT equation.
Definition at line 179 of file Assembler.hpp.
|
inlineprotectedvirtualinherited |
Is config value a LUT ram setting.
Definition at line 187 of file Assembler.hpp.
|
inlineprotectedinherited |
Is ramb memory init setting.
Definition at line 212 of file Assembler.hpp.
|
inlineprotectedinherited |
Is ramb parity init setting.
Definition at line 217 of file Assembler.hpp.
|
inlineprotectedvirtualinherited |
Returns true if the site is some form of RAMB site.
This function might have to be reimplemented in different architectures as name of RAMB site might change.
Definition at line 193 of file Assembler.hpp.
|
inlineprotectedvirtualinherited |
Is config a _ROUTETHROUGH.
Definition at line 183 of file Assembler.hpp.
|
inlineprotectedvirtual |
Returns true if site type is supported.
Implements torc::bitstream::VirtexAssembler.
Definition at line 54 of file Virtex7Assembler.hpp.
|
protectedinherited |
Merge micro-bitstream for compound setting.
Merge micro-bitstream for compound setting. There are some settings which together affect the bitstream.
Definition at line 550 of file Assembler.cpp.
|
protectedinherited |
Merge micro-bitstream for configuration with Hex values.
Merge micro-bitstream for configurations with hex values. The hex string is parsed character by character and micro-bitstream for every set bit is retrived from library and merged with base bitstream.
Definition at line 590 of file Assembler.cpp.
|
protectedinherited |
Merge micro-bitstream for Lut equation.
Merge micro-bitstream for Lut equation. The bit operations (AND, OR, etc.) are performed on the micro-bitstreams corresponding to every literal. Bit operation NOT is performed by XORing with micro-bitstream for LUT output assigned to 1. The lut equation is parsed using bison and flex. When a literal is encountered, the set of frames corresponding to literal is pushed on to a stack. When a bit operator is encountered, two set of frames is poped from the stack and the bit operations is performed on the two set of frames and result is pushed back to stack.
Definition at line 420 of file Assembler.cpp.
|
protectedinherited |
Merge micro-bitsram for Lut in ram/rom mode.
Merge micro-bitstream for lut in ram/rom mode. The lut ram/rom memory address to bit address map is obtained from ll files.
Definition at line 491 of file Assembler.cpp.
|
protectedinherited |
Merge micro-bitstreams for ramb memory init values.
Merges micro-bitstream for ramb init (both memory and parity) values.
Definition at line 614 of file Assembler.cpp.
|
protectedvirtualinherited |
Merge compressed micro-bitstream with base bitstream.
Go over all the bitaddresses, split it into frame address, word address, and bit address. Merge bits with outBitstream after handling offset.
Implements torc::bitstream::Assembler.
Definition at line 67 of file VirtexAssembler.cpp.
|
protectedinherited |
Read micro-bitstream library file and populate it in a map.
Loads micro-bitstream library from given path and populates the data in a map.
Definition at line 646 of file Assembler.cpp.
|
inherited |
Import Lut expression from a string.
input | Input stream. |
name | Stream name to use for error messages. |
Definition at line 835 of file Assembler.cpp.
|
inherited |
Function called from parser when it encounters a literal.
Push set of frames corresponding to literal passed for current lut equation.
Definition at line 803 of file Assembler.cpp.
|
inlineprotectedinherited |
Read word from stream and convert endianness if required.
Definition at line 274 of file Assembler.hpp.
|
inlineprotectedinherited |
Reverse endianness of input word.
Definition at line 280 of file Assembler.hpp.
|
protectedinherited |
Save bitstream.
Save the assembled bitstream.
Definition at line 737 of file Assembler.cpp.
|
inlineprotectedinherited |
Is site present in library database ToDo: This function will need tile type also.
Definition at line 222 of file Assembler.hpp.
|
inlineprotectedvirtual |
Implements torc::bitstream::VirtexAssembler.
Definition at line 81 of file Virtex7Assembler.hpp.
|
inherited |
Pointer to the current lexer instance.
This serves to connect the parser to the scanner, and is used by the yylex macro.
Definition at line 116 of file Assembler.hpp.
|
protectedinherited |
Definition at line 320 of file Assembler.hpp.
|
protectedinherited |
Definition at line 316 of file Assembler.hpp.
|
protected |
Definition at line 105 of file Virtex7Assembler.hpp.
|
protectedinherited |
Map from Lut config value to micro-bitstreams.
Definition at line 326 of file Assembler.hpp.
|
protectedinherited |
Address of 1st work within frame affected by Lut equation.
Definition at line 324 of file Assembler.hpp.
|
protectedinherited |
Frame blocks for current site/tile.
Definition at line 88 of file VirtexAssembler.hpp.
|
protectedinherited |
Word offset withing frame for current site/tile.
Definition at line 89 of file VirtexAssembler.hpp.
|
protectedinherited |
Torc database of architecutre on which design is implemented.
Definition at line 312 of file Assembler.hpp.
|
protectedinherited |
Xdl design pointer.
Definition at line 308 of file Assembler.hpp.
|
protectedinherited |
To track if DB object was allocated in constructor.
Definition at line 315 of file Assembler.hpp.
|
protectedinherited |
Micro-bitstream library in map datastructure.
Definition at line 311 of file Assembler.hpp.
|
protectedinherited |
Pointer to bitstream object to which micro bitstreams are merged.
Definition at line 317 of file Assembler.hpp.
|
protectedinherited |
LHS of Lut equation currently being processed.
Definition at line 327 of file Assembler.hpp.
|
protectedinherited |
Address of 1st frame being affected by Lut equation.
Definition at line 323 of file Assembler.hpp.
|
protectedinherited |
Frame set for Lut output assigned to 1.
Definition at line 325 of file Assembler.hpp.
|
protectedinherited |
Frame set for literals are pushed to this stack.
Definition at line 322 of file Assembler.hpp.
|
protectedinherited |
Merge mode - set bits or clear bits.
Definition at line 310 of file Assembler.hpp.
|
protectedinherited |
Definition at line 333 of file Assembler.hpp.
|
protectedinherited |
Definition at line 318 of file Assembler.hpp.
|
protectedinherited |
Sites from the architecture database.
Definition at line 313 of file Assembler.hpp.
|
inherited |
Name of file or input stream for error messages.
Definition at line 112 of file Assembler.hpp.
|
protectedinherited |
Flag signaling parsing success.
Definition at line 319 of file Assembler.hpp.
|
protectedinherited |
Target bitstream path.
Definition at line 309 of file Assembler.hpp.
|
protectedinherited |
Tiles from architecture database.
Definition at line 314 of file Assembler.hpp.
|
inherited |
Enable debug output in the bison parser.
Definition at line 110 of file Assembler.hpp.
|
inherited |
Enable debug output in the flex scanner.
Definition at line 108 of file Assembler.hpp.
|
protectedinherited |
Definition at line 332 of file Assembler.hpp.
|
protectedinherited |
Definition at line 331 of file Assembler.hpp.
|
protectedinherited |
Definition at line 330 of file Assembler.hpp.
|
protectedinherited |
Definition at line 329 of file Assembler.hpp.
|
protectedinherited |
Definition at line 334 of file Assembler.hpp.
|
staticprotectedinherited |
String used when an element is explicity configured off.
Definition at line 338 of file Assembler.hpp.
|
staticprotectedinherited |
Extension used for micro-bitstream libraries.
Definition at line 337 of file Assembler.hpp.
|
staticprotectedinherited |
Path to library folder containing mirco-bitstream database.
Definition at line 336 of file Assembler.hpp.
|
staticprotectedinherited |
Regex to identify Lut configuration.
Definition at line 340 of file Assembler.hpp.
|
staticprotectedinherited |
Regex to identify Luts configured as ram/rom.
Definition at line 339 of file Assembler.hpp.
|
staticprotectedinherited |
Regex to indentify ROUTETHROUGH configuration in instances.
Definition at line 341 of file Assembler.hpp.