torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Virtex5Assembler.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL: https://svn.east.isi.edu/torc/trunk/src/torc/bitstream/assembler/lut/parser.yy $
3 // $Id: parser.yy 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 #ifndef TORC_BITSTREAM_ASSEMBLER_VIRTEX5ASSEMBLER_HPP
17 #define TORC_BITSTREAM_ASSEMBLER_VIRTEX5ASSEMBLER_HPP
18 
20 #include "torc/Physical.hpp"
23 #include "build/Virtex5LibGen.hpp"
24 
25 namespace torc {
26 namespace bitstream {
27 
29 public:
30  // Constructor
32  VirtexAssembler(inDB) {
33  initialize();
34  }
35 
36 protected:
37  void initialize(void) {
38  //mCompoundSettingMap = torc::bitstream::AssemblerLibGen::getCompoundSettingsMapForVirtex5();
40  mParentFamilyName = "Virtex5";
41 
42  // Get the compressed bitstreams library database file path
43  string libDBFileName = mParentFamilyName + sLibraryExtension;
44  boost::filesystem::path libDBPath = mLibraryPath / libDBFileName;
45  if(!boost::filesystem::exists(libDBPath)) {
46  std::cout << "ERROR: Library database file - " << libDBPath.string() << " - does not exist."
47  << std::endl;
48  throw "Library file does not exist";
49  }
50  // Populate map data structure from the library database
51  populateLibraryMap(libDBPath);
52  }
53  /// \brief Returns true if site type is supported
54  virtual bool isSiteTypeSupported(const std::string &inSiteType) {
55  return (inSiteType.compare("SLICEL") == 0 ||
56  inSiteType.compare("SLICEM") == 0 ||
57  inSiteType.compare("RAMB36_EXP") == 0 ||
58  inSiteType.compare("DSP48E") == 0);
59  }
60  /// \brief Returns true if input resource is associated with compound group
61  virtual bool isCompoundSetting(string inElementName) {
62  CompoundSettingMap::const_iterator pElement = mCompoundSettingMap.find(inElementName);
63  // If element found in the compound settings map
64  if(pElement != mCompoundSettingMap.end()) {
65  return true;
66  }
67  return false;
68  }
69 
70  /// \brief Returs vector of related configurations
71  virtual vector<string> getDependantConfigs(string inElement1Name) {
72  return mCompoundSettingMap[inElement1Name];
73  }
74 
75  virtual void initializeFullFrameBlocks() {
76  torc::bitstream::Virtex5 *virtexBitStream =
77  dynamic_cast<torc::bitstream::Virtex5 *> (mBitstreamPtr.get());
78  virtexBitStream->readFramePackets();
79  }
80 
81  virtual void updateFullFrameBlocks() {
82  torc::bitstream::Virtex5 *virtexBitStream =
83  dynamic_cast<torc::bitstream::Virtex5 *> (mBitstreamPtr.get());
84  virtexBitStream->updateFramePackets();
85  }
86 
87  /// \brief For an INT tile, returns associated CLB column
88  virtual uint32_t getPrimaryXdlColumn(TileCol inTileColumn) {
89  torc::bitstream::Virtex5 *virtex5Bitstream =
90  dynamic_cast<torc::bitstream::Virtex5 *> (mBitstreamPtr.get());
91  return virtex5Bitstream->getPrimaryXdlColumn(inTileColumn);
92  }
93 
95  uint32_t inPrimaryXdlCol, uint32_t inBitIndexBegin, uint32_t inBitIndexEnd) {
96  torc::bitstream::Virtex5 *virtex5Bitstream =
97  dynamic_cast<torc::bitstream::Virtex5 *> (mBitstreamPtr.get());
98  return virtex5Bitstream->getXdlFrames(inTileRow, inPrimaryXdlCol, inBitIndexBegin,
99  inBitIndexEnd);
100  }
101  /// \brief Store frame blocks and bit offset for given tile index
102  virtual void initializeFrameDataForTile(TileIndex tileIndex);
103 protected:
104  // Member variables
106 
107 };
108 
109 }
110 }
111 
112 #endif // TORC_BITSTREAM_ASSEMBLER_VIRTEX5ASSEMBLER_HPP
Encapsulation of a tile index in an unsigned 32-bit integer.
virtual bool isSiteTypeSupported(const std::string &inSiteType)
Returns true if site type is supported.
Encapsulation of a tile row in an unsigned 16-bit integer.
std::map< const string, std::vector< string > > CompoundSettingMap
Element name to vector of related element names that collectively affect bits.
Definition: Assembler.hpp:71
virtual void readFramePackets(void)
Read frame data into the frame blocks structure.
Definition: Virtex5.hpp:181
virtual vector< string > getDependantConfigs(string inElement1Name)
Returs vector of related configurations.
Encapsulation of a tile column in an unsigned 16-bit integer.
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
virtual void initializeFrameDataForTile(TileIndex tileIndex)
Store frame blocks and bit offset for given tile index.
static CompoundSettingMap getCompoundSettingsMap()
Returns map of coumpound settings.
Base Virtex class to implement functions common across all/some Virtex architectures.
torc::bitstream::BitstreamSharedPtr mBitstreamPtr
Definition: Assembler.hpp:316
std::string string
Virtex5 bitstream.
Definition: Virtex5.hpp:41
Main torc::physical namespace header.
virtual torc::bitstream::VirtexFrameBlocks getXdlFrames(TileRow inTileRow, uint32_t inPrimaryXdlCol, uint32_t inBitIndexBegin, uint32_t inBitIndexEnd)
Virtex5Assembler(torc::architecture::DDB &inDB)
boost::filesystem::path path
virtual bool isCompoundSetting(string inElementName)
Returns true if input resource is associated with compound group.
VirtexFrameBlocks getXdlFrames(uint32_t inXdlRow, uint32_t inXdlCol, uint32_t &outBeginBit, uint32_t &outEndBit, uint32_t inBlockCount=eBlockTypeCount)
Returns frames for specified XDL tile coordinates. inXldRow The XDL row coordinate. inXdlCol The XDL column coordinate. outBeginBit The bit index of the beginning of the requested tile. outEndBit The bit index of the end of the requested tile. inBlockCount The highest block type requested (8 for Xilinx architectures).
Definition: Virtex5.cpp:1091
Definition of base Virtex class to implement functions common across all/some Virtex architectures...
boost::filesystem::path mLibraryPath
Pointer to bitstream object to which micro bitstreams are merged.
Definition: Assembler.hpp:317
Header for the DDB class.
static const string sLibraryExtension
Extension used for micro-bitstream libraries.
Definition: Assembler.hpp:337
virtual void updateFramePackets(EBitstreamType inBitstreamType=eBitstreamTypeFull, EFrameInclude inFrameInclusion=eFrameIncludeAllUsedFrames)
Update the bitstream frame packets By default this updates the bitstream with full frame data...
uint32_t getPrimaryXdlColumn(uint32_t inXdlCol)
Returns the primary column corresponding to the given column. If immediately to the left of a BRAM...
Definition: Virtex5.cpp:1176
virtual uint32_t getPrimaryXdlColumn(TileCol inTileColumn)
For an INT tile, returns associated CLB column.
void populateLibraryMap(path inLibDBPath)
Read micro-bitstream library file and populate it in a map.
Definition: Assembler.cpp:646