torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Assembler.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2013-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL: https://svn.east.isi.edu/torc/trunk/src/torc/bitstream/assembler/Assembler.hpp $
3 // $Id: Assembler.hpp 1303 2013-02-25 23:18:16Z nsteiner $
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file Assembler.hpp
17 /// \brief Base class for Xdl to bitstream conversion. This class is abstract but still contains lot of architecture
18 /// independent implementation
19 /// \author Ritesh Kumar Soni
20 
21 #ifndef TORC_BITSTREAM_ASSEMBLER_ASSEMBLER_HPP
22 #define TORC_BITSTREAM_ASSEMBLER_ASSEMBLER_HPP
23 
24 #include <iostream>
25 #include <vector>
26 #include <map>
27 #include <set>
28 #include "torc/Bitstream.hpp"
31 #include "torc/Physical.hpp"
32 #include <boost/regex.hpp>
33 #include <boost/smart_ptr.hpp>
34 
35 // forward declarations of friends outside our namespace.
36 namespace torc {
37  class LutParser;
38  class LutScanner;
39  class location;
40 } // torc
41 
42 namespace torc {
43 namespace bitstream {
44 
45 /// \brief Base class for bitstream assembly
46 class Assembler {
47 
48 public:
49  // enumerations
50  /// \brief Permissible operations on LUT frames.
51  enum EOperation { eAND, eOR, eXOR, eNOT };
52  /// \brief
53  enum EMergeMode { eSet, eClear };
54 
55  // types
56  /// \brief Imported type name.
58  /// \brief Imported type name.
59  typedef std::istream istream;
60  /// \brief Imported type name.
62  /// \brief Imported type name.
64  /// \brief Imported type name.
66  /// \brief Imported type name.
68 
69  // Typedefs
70  /// \brief Element name to vector of related element names that collectively affect bits.
71  typedef std::map<const string, std::vector<string> > CompoundSettingMap;
72  /// \brief Map from config value to vector of config bits. ConfigValuesToBits.
73  typedef std::map<const string, std::vector<uint32_t> > ConfigValuesToBits;
74  /// \brief Map from config setting to config values. ConfigSettingsToValues.
75  typedef std::map<const string, ConfigValuesToBits> ConfigSettingsToValues;
76  /// \brief Map from site type to config settings. SiteTypeToConfigSettings.
77  typedef std::map<const string, ConfigSettingsToValues> SiteTypeToConfigSettings;
78  /// \brief Map from tile type to site types. Includes routing as a site type.
79  typedef std::map<const string, SiteTypeToConfigSettings> TileTypeToSiteType;
80  /// Currently not in use. Datastructure to store LUT frames in efficient and flexible way
81  typedef std::map<int32_t, map<int32_t, uint32_t> > FrameWords;
82 
83  /// \brief Constructor take only Xdl design pointer.
84 // Assembler(DesignSharedPtr inDesignPtr) : mTraceScanning(false), mTraceParsing(false),
85 // mDesignPtr(inDesignPtr), mDB(*(new DDB(inDesignPtr->getDevice()))), mSites(mDB.getSites()),
86 // mTiles(mDB.getTiles()), mFreeDB(true) {
87 // initialize();
88 // }
89  /// \brief Constructor takes Xdl design pointer and architecture database object
90  Assembler(DDB &inDB) : mTraceScanning(false),
91  mTraceParsing(false), mDB(inDB), mSites(mDB.getSites()),
92  mTiles(mDB.getTiles()), mFreeDB(false) {
93  initialize();
94  }
95  /// \brief Destructor does not do anything
96  virtual ~Assembler(void) {
97  if(mFreeDB)
98  delete &mDB;
99  }
100 
101  // Public functions
102  /// \brief Function to generate bitstream, takes target bitstream path and optional base bitstream path
103  virtual int generateBitstream(DesignSharedPtr inDesignPtr, const path inTargetBitstreamPath,
104  EMergeMode inMergeMode = eSet, path baseBitstreamPath = path());
105 
106  // members
107  /// \brief Enable debug output in the flex scanner.
109  /// \brief Enable debug output in the bison parser.
111  /// \brief Name of file or input stream for error messages.
112  string mStreamName;
113  /// \brief Pointer to the current lexer instance.
114  /// \details This serves to connect the parser to the scanner, and is used by the yylex
115  /// macro.
117 
118  // macros
119  /// \cond OMIT_FROM_DOXYGEN
120  // Doxygen gets confused by the explicit "__attribute__ ((deprecated))" so we used this
121  #define DEPRECATED __attribute__ ((deprecated))
122  /// \endcond
123 
124  // functions
125  /// \brief Import Lut expression from a string.
126  /// \param input Input stream.
127  /// \param name Stream name to use for error messages.
128  /// \returns true if successfully parsed.
129  bool processLut(const string& input, const string& name = "string stream");
130  /// \brief Lut parse error handling.
131  void error(const location& l, const string& m);
132  /// \brief Lut general error handling.
133  void error(const string& m);
134  /// \brief Signals a parsing failure by deasserting the success flag.
135  void failure(void) { mSuccess = false; }
136 
137  /// \brief Convert a hex ASCII character to a decimal value.
138  /// \returns The equivalent decimal value, or -1 if the input is not a valid hex digit.
139  static inline int hexCharacterToDec(char inDigit) {
140  // handle numeric hex digits
141  if(inDigit >= '0' && inDigit <= '9') return inDigit - '0';
142  // force lower case to upper case
143  inDigit &= 0xdf;
144  // handle alphabetic hex digits
145  if(inDigit >= 'A' && inDigit <= 'F') return inDigit - 'A' + 10;
146  // reject non-hex digits
147  return -1;
148  }
149 
150  /// \brief Function called from parser when it encounters a bit operator
151  void binaryLutFrameOperation(EOperation inOperation);
152  /// \brief Function called from parser when it encounters a literal
153  void pushLutFrame(string inLiteral);
154 
155 protected:
156  // friends
157  /// \brief The LutParse has access to our members.
158  friend class torc::LutParser;
159 
160  // Protected functions
161  /// \brief Initializations done in constructor
162  void initialize(void);
163  /// \brief Initiates Xdl to bitstream conversion
164  void convertXdlToBitstream(void);
165  /// \brief Save bitstream
166  void saveBitstream(void);
167  /// \brief Assemble bitstream for instances
168  void assembleInstances(void);
169  /// \brief Assemble bitstream for nets
170  void assembleNets(void);
171  /// \brief Assemble bitstream for Ramb
173  /// \brief Get tile type from site type
174  string getTiletypeFromSitename(const string &inSiteType);
175  /// \brief Verify the configuratino and merge with base bitstream
176  virtual void checkValidityAndMergeBitstream(string inElementName, string inConfigValue,
177  const ConfigSettingsToValues &inConfigMap);
178  /// \brief Is config value a LUT equation
179  virtual bool isLutEquationSetting(const string &inConfigValue) {
180  return boost::regex_match(inConfigValue, sLutConfigRegEx);
181  }
182  /// \brief Is config a _ROUTETHROUGH
183  virtual bool isRoutethrough(const string &inSetting) {
184  return boost::regex_match(inSetting, sRoutethroughRegEx);
185  }
186  /// \brief Is config value a LUT ram setting
187  virtual bool isLutRamOrRomSetting(const string &inConfigVal) {
188  return boost::regex_match(inConfigVal, sLutRamOrRomConfigRegEx);
189  }
190  /// \brief Returns true if the site is some form of RAMB site.
191  /// \details This function might have to be reimplemented in different
192  /// architectures as name of RAMB site might change.
193  virtual bool isRambSite(const string &inSiteType) {
194  if (inSiteType.length() > 3) {
195  return inSiteType.substr(0, 4).compare("RAMB") == 0;
196  }
197  return false;
198  }
199  /// \breif Does the configuration have hex string in config value.
200  virtual bool isConfigValHexString(const string &inSiteType,
201  const string &inElementName) {
202 
203  if (inSiteType.compare("DSP48E") == 0) {
204  if (inElementName.compare("PATTERN") == 0 || inElementName.compare(
205  "MASK") == 0) {
206  return true;
207  }
208  }
209  return false;
210  }
211  /// \brief Is ramb memory init setting
212  bool isMemoryInitSetting(const string &inConfigName) {
213  return inConfigName.length() == 7 && inConfigName.substr(0, 5).compare(
214  "INIT_") == 0;
215  }
216  /// \brief Is ramb parity init setting
217  bool isMemoryParityInitSetting(const string &inConfigName) {
218  return inConfigName.substr(0, 6).compare("INITP_") == 0;
219  }
220  /// \brief Is site present in library database
221  /// ToDo: This function will need tile type also.
222  bool tileAndSiteExistInLibrary(const string &inTileType, const string &inSiteType) {
223 
224  //unused(inSiteType);
225  TileTypeToSiteType::iterator pTiles = mLibrary.find(inTileType);
226  if(pTiles == mLibrary.end()) {
228  mUnsupportedTileTypeSet.insert(inTileType+"-"+inSiteType);
229  return false;
230  } else {
231  SiteTypeToConfigSettings::iterator pSites = pTiles->second.find(inSiteType);
232  if(pSites == pTiles->second.end()) {
234  mUnsupportedTileTypeSet.insert(inTileType+"-"+inSiteType);
235  return false;
236  }
237  }
238  return true;
239  }
240  /// \brief Is configuration present in given map
241  bool elementAndConfigExistInLibrary(const string &inElementName,
242  const string &configValue, ConfigSettingsToValues &inConfigSettingToValues);
243  /// \brief If slice site type, annotate type as per even or odd column
244  virtual void getAnnotatedSiteTypeForSlicel(string &inOutSiteType,
245  const string &siteLocation);
246  /// \brief Merge micro-bitstream for Lut equation
247  void mergeLutEquationBits(const string &inElementName,
248  const string &inConfigValue, ConfigSettingsToValues &inConfigSettingToValues);
249  /// \brief Merge micro-bitsram for Lut in ram/rom mode
250  void mergeLutRamOrRomBits(const string &inElementName, const string &inConfigVal,
251  ConfigSettingsToValues &inConfigSettingToValues);
252  /// \brief Merge micro-bitstream for compound setting
253  void mergeCompoundSettingBits(string inElement1Name,
254  string inConfig1Val,
255  InstanceSharedPtr inInstancePtr,
256  const ConfigSettingsToValues &inConfigSettingToValues);
257  /// \brief Merge micro-bitstream for configuration with Hex values
258  void mergeHexConfigBits(string inElementName,
259  string inConfigVal,
260  const ConfigSettingsToValues &inConfigSettingToValues);
261  /// \brief Merge micro-bitstreams for ramb memory init values
262  void mergeRambInitBits(const string &inConfigVal,
263  uint32_t inMemoryInitRow, const vector<uint32_t> &inBitAddresses,
264  uint32_t inBlock);
265  /// \brief Read micro-bitstream library file and populate it in a map
266  void populateLibraryMap(path inLibDBPath);
267  /// \brief Check if processor is big endian
269  uint32_t check = 0x01020304;
270  char *p = (char *)&check;
271  return (p[0] == 0x01);
272  }
273  /// \brief Read word from stream and convert endianness if required
274  void readWord(std::ifstream &fileStream, uint32_t &outWord) {
275  fileStream.read((char *) &outWord, sizeof(uint32_t));
276  if(mBigEndian)
277  outWord = reverseEndianness(outWord);
278  }
279  /// \brief Reverse endianness of input word
280  uint32_t reverseEndianness(uint32_t inWord) {
281  uint32_t outWord = 0;
282  char *in = (char *)&inWord;
283  char *out = (char *)&outWord;
284  uint wordSize = sizeof(inWord);
285  for(uint i = 0; i< wordSize; i++) {
286  out[i] = in[wordSize-i-1];
287  }
288  return outWord;
289  }
290 
291  // Pure virtual functions
292  /// \brief Is site supporeted for Xdl to bitstream conversion
293  virtual bool isSiteTypeSupported(const string &inSiteType) = 0;
294  /// \brief Store frame blocks and bit offset for given site
295  virtual void initializeFrameDataForSite(const string &inSiteName) = 0;
296  /// \brief Store frame blocks and bit offset for given tile index
297  virtual void initializeFrameDataForTile(TileIndex inTileIndex) = 0;
298  /// \brief Returs vector of related configurations
299  virtual vector<string> getDependantConfigs(string inElement1Name) = 0;
300  /// \brief Does element need compound setting
301  virtual bool isCompoundSetting(string inElementName) = 0;
302  /// \brief Merge micro-bitstream with base bitstream
303  virtual void mergeWithBaseBitstream(
304  const vector<uint32_t> &inBitAddresses, uint32_t inBlockIndex) = 0;
305 
306 protected:
307  // Protected members
309  path mTargetBitstreamPath; ///< Target bitstream path
310  EMergeMode mMergeMode; ///< Merge mode - set bits or clear bits
311  TileTypeToSiteType mLibrary; ///< Micro-bitstream library in map datastructure
312  const torc::architecture::DDB &mDB; ///< Torc database of architecutre on which design is implemented
313  const torc::architecture::Sites &mSites; ///< Sites from the architecture database
314  const torc::architecture::Tiles &mTiles; ///< Tiles from architecture database
315  bool mFreeDB; ///< To track if DB object was allocated in constructor
316  torc::bitstream::BitstreamSharedPtr mBitstreamPtr; /// Pointer to bitstream object to which micro bitstreams are merged.
319  bool mSuccess; ///< Flag signaling parsing success.
321  // Member variables to store state during Lut equation parsing
322  vector<vector<uint32_t> > mLutFrameSetStack; ///< Frame set for literals are pushed to this stack
323  uint32_t mLutCurrentReferenceFrameIndex; ///< Address of 1st frame being affected by Lut equation
324  uint32_t mCurrentReferenceWordIndex; ///< Address of 1st work within frame affected by Lut equation
325  std::vector<uint32_t> mLutFrameSetForOne; ///< Frame set for Lut output assigned to 1.
326  ConfigValuesToBits mCurrentConfigToBitMap; ///< Map from Lut config value to micro-bitstreams
327  string mLutCurrentEquationLhs; ///< LHS of Lut equation currently being processed
328  // Member variables to track unsupported resources
334  std::set<std::string> mUnsupportedTileTypeSet;
335  // Static member variables
336  static const string sLibraryRelativePath; ///< Path to library folder containing mirco-bitstream database
337  static const string sLibraryExtension; ///< Extension used for micro-bitstream libraries
338  static const string sConfigOff; ///< String used when an element is explicity configured off
339  static const boost::regex sLutRamOrRomConfigRegEx; ///< Regex to identify Luts configured as ram/rom
340  static const boost::regex sLutConfigRegEx; ///< Regex to identify Lut configuration
341  static const boost::regex sRoutethroughRegEx; ///< Regex to indentify ROUTETHROUGH configuration in instances
342 
343 };
344 /// \brief Typedef for shared pointer of Assembler class
345 typedef boost::shared_ptr<Assembler> AssemblerSharedPtr;
346 
347 } // namespace bitstream
348 } // namespace torc
349 
350 #endif // TORC_BITSTREAM_ASSEMBLER_ASSEMBLER_HPP
bool isMemoryInitSetting(const string &inConfigName)
Is ramb memory init setting.
Definition: Assembler.hpp:212
void convertXdlToBitstream(void)
Initiates Xdl to bitstream conversion.
Definition: Assembler.cpp:104
Encapsulation of a tile index in an unsigned 32-bit integer.
std::set< std::string > mUnsupportedTileTypeSet
Definition: Assembler.hpp:334
std::map< const string, std::vector< string > > CompoundSettingMap
Element name to vector of related element names that collectively affect bits.
Definition: Assembler.hpp:71
void mergeHexConfigBits(string inElementName, string inConfigVal, const ConfigSettingsToValues &inConfigSettingToValues)
Merge micro-bitstream for configuration with Hex values.
Definition: Assembler.cpp:590
string getTiletypeFromSitename(const string &inSiteType)
Get tile type from site type.
Definition: Assembler.cpp:345
virtual void checkValidityAndMergeBitstream(string inElementName, string inConfigValue, const ConfigSettingsToValues &inConfigMap)
Verify the configuratino and merge with base bitstream.
Definition: Assembler.cpp:357
virtual bool isLutRamOrRomSetting(const string &inConfigVal)
Is config value a LUT ram setting.
Definition: Assembler.hpp:187
virtual bool isCompoundSetting(string inElementName)=0
Does element need compound setting.
torc::physical::DesignSharedPtr DesignSharedPtr
Imported type name.
Definition: Assembler.hpp:61
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
static int hexCharacterToDec(char inDigit)
Convert a hex ASCII character to a decimal value.
Definition: Assembler.hpp:139
std::map< const string, ConfigValuesToBits > ConfigSettingsToValues
Map from config setting to config values. ConfigSettingsToValues.
Definition: Assembler.hpp:75
bool mTraceParsing
Enable debug output in the bison parser.
Definition: Assembler.hpp:110
string mLutCurrentEquationLhs
LHS of Lut equation currently being processed.
Definition: Assembler.hpp:327
virtual bool isLutEquationSetting(const string &inConfigValue)
Is config value a LUT equation.
Definition: Assembler.hpp:179
virtual bool isConfigValHexString(const string &inSiteType, const string &inElementName)
Does the configuration have hex string in config value.
Definition: Assembler.hpp:200
Header for the DirectoryTree class.
void mergeRambInitBits(const string &inConfigVal, uint32_t inMemoryInitRow, const vector< uint32_t > &inBitAddresses, uint32_t inBlock)
Merge micro-bitstreams for ramb memory init values.
Definition: Assembler.cpp:614
static const string sLibraryRelativePath
Path to library folder containing mirco-bitstream database.
Definition: Assembler.hpp:336
bool tileAndSiteExistInLibrary(const string &inTileType, const string &inSiteType)
Is site present in library database ToDo: This function will need tile type also. ...
Definition: Assembler.hpp:222
Main torc::bitstream namespace header.
std::istream istream
Imported type name.
Definition: Assembler.hpp:59
string mStreamName
Name of file or input stream for error messages.
Definition: Assembler.hpp:112
A Bison parser.
Definition: LutParser.hpp:144
std::map< int32_t, map< int32_t, uint32_t > > FrameWords
Currently not in use. Datastructure to store LUT frames in efficient and flexible way...
Definition: Assembler.hpp:81
bool mSuccess
Flag signaling parsing success.
Definition: Assembler.hpp:319
std::map< const string, SiteTypeToConfigSettings > TileTypeToSiteType
Map from tile type to site types. Includes routing as a site type.
Definition: Assembler.hpp:79
void failure(void)
Signals a parsing failure by deasserting the success flag.
Definition: Assembler.hpp:135
uint32_t reverseEndianness(uint32_t inWord)
Reverse endianness of input word.
Definition: Assembler.hpp:280
bool processLut(const string &input, const string &name="string stream")
Import Lut expression from a string.
Definition: Assembler.cpp:835
torc::bitstream::BitstreamSharedPtr mBitstreamPtr
Definition: Assembler.hpp:316
torc::architecture::DDB DDB
Imported type name.
Definition: Assembler.hpp:65
virtual bool isRoutethrough(const string &inSetting)
Is config a _ROUTETHROUGH.
Definition: Assembler.hpp:183
void assembleRamb(torc::physical::InstanceSharedPtr inInstancePtr)
Assemble bitstream for Ramb.
Definition: Assembler.cpp:260
void initialize(void)
Initializations done in constructor.
Definition: Assembler.cpp:46
void readWord(std::ifstream &fileStream, uint32_t &outWord)
Read word from stream and convert endianness if required.
Definition: Assembler.hpp:274
std::string string
path mTargetBitstreamPath
Target bitstream path.
Definition: Assembler.hpp:309
void mergeCompoundSettingBits(string inElement1Name, string inConfig1Val, InstanceSharedPtr inInstancePtr, const ConfigSettingsToValues &inConfigSettingToValues)
Merge micro-bitstream for compound setting.
Definition: Assembler.cpp:550
bool isMemoryParityInitSetting(const string &inConfigName)
Is ramb parity init setting.
Definition: Assembler.hpp:217
EOperation
Permissible operations on LUT frames.
Definition: Assembler.hpp:51
std::vector< uint32_t > mLutFrameSetForOne
Frame set for Lut output assigned to 1.
Definition: Assembler.hpp:325
void binaryLutFrameOperation(EOperation inOperation)
Function called from parser when it encounters a bit operator.
Definition: Assembler.cpp:747
Main torc::physical namespace header.
Site type and population data for the family and the device.
Definition: Sites.hpp:45
bool mTraceScanning
Enable debug output in the flex scanner.
Definition: Assembler.hpp:108
virtual vector< string > getDependantConfigs(string inElement1Name)=0
Returs vector of related configurations.
virtual void initializeFrameDataForSite(const string &inSiteName)=0
Store frame blocks and bit offset for given site.
Tile map, tile type, and wire information for the family and device.
Definition: Tiles.hpp:36
void pushLutFrame(string inLiteral)
Function called from parser when it encounters a literal.
Definition: Assembler.cpp:803
EMergeMode mMergeMode
Merge mode - set bits or clear bits.
Definition: Assembler.hpp:310
const torc::architecture::DDB & mDB
Torc database of architecutre on which design is implemented.
Definition: Assembler.hpp:312
boost::filesystem::path path
Imported type name.
Definition: Assembler.hpp:67
Assembler(DDB &inDB)
Constructor take only Xdl design pointer.
Definition: Assembler.hpp:90
torc::physical::InstanceSharedPtr InstanceSharedPtr
Imported type name.
Definition: Assembler.hpp:63
static const boost::regex sLutConfigRegEx
Regex to identify Lut configuration.
Definition: Assembler.hpp:340
virtual int generateBitstream(DesignSharedPtr inDesignPtr, const path inTargetBitstreamPath, EMergeMode inMergeMode=eSet, path baseBitstreamPath=path())
Function to generate bitstream, takes target bitstream path and optional base bitstream path...
Definition: Assembler.cpp:64
boost::filesystem::path path
const torc::architecture::Sites & mSites
Sites from the architecture database.
Definition: Assembler.hpp:313
boost::shared_ptr< Instance > InstanceSharedPtr
Shared pointer encapsulation of an Instance.
virtual void getAnnotatedSiteTypeForSlicel(string &inOutSiteType, const string &siteLocation)
If slice site type, annotate type as per even or odd column.
Definition: Assembler.cpp:396
bool mFreeDB
To track if DB object was allocated in constructor.
Definition: Assembler.hpp:315
void mergeLutEquationBits(const string &inElementName, const string &inConfigValue, ConfigSettingsToValues &inConfigSettingToValues)
Merge micro-bitstream for Lut equation.
Definition: Assembler.cpp:420
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
void saveBitstream(void)
Save bitstream.
Definition: Assembler.cpp:737
std::string string
Imported type name.
Definition: Assembler.hpp:57
ConfigValuesToBits mCurrentConfigToBitMap
Map from Lut config value to micro-bitstreams.
Definition: Assembler.hpp:326
void assembleNets(void)
Assemble bitstream for nets.
Definition: Assembler.cpp:210
virtual bool isSiteTypeSupported(const string &inSiteType)=0
Is site supporeted for Xdl to bitstream conversion.
Definition: Assembler.cpp:253
static const string sConfigOff
String used when an element is explicity configured off.
Definition: Assembler.hpp:338
std::map< const string, ConfigSettingsToValues > SiteTypeToConfigSettings
Map from site type to config settings. SiteTypeToConfigSettings.
Definition: Assembler.hpp:77
void mergeLutRamOrRomBits(const string &inElementName, const string &inConfigVal, ConfigSettingsToValues &inConfigSettingToValues)
Merge micro-bitsram for Lut in ram/rom mode.
Definition: Assembler.cpp:491
virtual ~Assembler(void)
Destructor does not do anything.
Definition: Assembler.hpp:96
boost::filesystem::path mLibraryPath
Pointer to bitstream object to which micro bitstreams are merged.
Definition: Assembler.hpp:317
TileTypeToSiteType mLibrary
Micro-bitstream library in map datastructure.
Definition: Assembler.hpp:311
static const boost::regex sRoutethroughRegEx
Regex to indentify ROUTETHROUGH configuration in instances.
Definition: Assembler.hpp:341
static const boost::regex sLutRamOrRomConfigRegEx
Regex to identify Luts configured as ram/rom.
Definition: Assembler.hpp:339
void error(const location &l, const string &m)
Lut parse error handling.
Definition: Assembler.cpp:849
void assembleInstances(void)
Assemble bitstream for instances.
Definition: Assembler.cpp:123
Header for the DDB class.
class torc::LutScanner * lexer
Pointer to the current lexer instance.
Definition: Assembler.hpp:116
vector< vector< uint32_t > > mLutFrameSetStack
Frame set for literals are pushed to this stack.
Definition: Assembler.hpp:322
torc::physical::DesignSharedPtr mDesignPtr
Xdl design pointer.
Definition: Assembler.hpp:308
bool isBigEndianMachine()
Check if processor is big endian.
Definition: Assembler.hpp:268
uint32_t mLutCurrentReferenceFrameIndex
Address of 1st frame being affected by Lut equation.
Definition: Assembler.hpp:323
static const string sLibraryExtension
Extension used for micro-bitstream libraries.
Definition: Assembler.hpp:337
virtual void mergeWithBaseBitstream(const vector< uint32_t > &inBitAddresses, uint32_t inBlockIndex)=0
Merge micro-bitstream with base bitstream.
Base class for bitstream assembly.
Definition: Assembler.hpp:46
uint32_t mCurrentReferenceWordIndex
Address of 1st work within frame affected by Lut equation.
Definition: Assembler.hpp:324
virtual void initializeFrameDataForTile(TileIndex inTileIndex)=0
Store frame blocks and bit offset for given tile index.
boost::shared_ptr< Bitstream > BitstreamSharedPtr
bool elementAndConfigExistInLibrary(const string &inElementName, const string &configValue, ConfigSettingsToValues &inConfigSettingToValues)
Is configuration present in given map.
Definition: Assembler.cpp:379
void populateLibraryMap(path inLibDBPath)
Read micro-bitstream library file and populate it in a map.
Definition: Assembler.cpp:646
const torc::architecture::Tiles & mTiles
Tiles from architecture database.
Definition: Assembler.hpp:314
virtual bool isRambSite(const string &inSiteType)
Returns true if the site is some form of RAMB site.
Definition: Assembler.hpp:193
std::map< const string, std::vector< uint32_t > > ConfigValuesToBits
Map from config value to vector of config bits. ConfigValuesToBits.
Definition: Assembler.hpp:73
boost::shared_ptr< Assembler > AssemblerSharedPtr
Typedef for shared pointer of Assembler class.
Definition: Assembler.hpp:345