torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Virtex7LibGen.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
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 /// \brief Class to encapsulate micro-bitstream library generation code
17 /// \author Ritesh Kumar Soni
18 
19 #ifndef VIRTEX7LIBGEN_HPP_
20 #define VIRTEX7LIBGEN_HPP_
21 
22 #include "AssemblerLibGen.hpp"
23 
24 namespace torc {
25 namespace bitstream {
26 
27  class Virtex7LibGen : public AssemblerLibGen {
28  public:
29  /// \brief Constructor
30  Virtex7LibGen(string inDevice, path inHarnessFolder, path inXdlGenerationFolder)
31  : AssemblerLibGen(inDevice, inHarnessFolder, inXdlGenerationFolder) {
32  initialize();
33  }
34  /// \brief Destructor
35  virtual ~Virtex7LibGen() { }
36  /// \brief Returns map of coumpound settings
38  CompoundSettingMap compoundSettingMap;
39  std::vector<std::string> acascregCompound;
40  acascregCompound.push_back("AREG");
41  compoundSettingMap["ACASCREG"] = acascregCompound;
42 
43  std::vector<std::string> bcascregCompound;
44  bcascregCompound.push_back("BREG");
45  compoundSettingMap["BCASCREG"] = bcascregCompound;
46 
47  return compoundSettingMap;
48  }
49 
50 
51  protected:
52  /// \brief Returns true if site type is supported
53  virtual bool isSiteTypeSupported(const string &inSiteType);
54  /// \brief Returns list of supported tiles. Assumes last tile is "LAST_TILE"
55  virtual std::vector<std::string> getTilesSupportedForPips();
56  /// \brief Returns primary primitive for Ramb site type
58  return "RAMB36E1";
59  }
60  /// \brief Do architecture specific part of initialization
61  void initialize();
62  /// \brief Get a map from config setting to reference value
63  std::map<string, string> getReferenceConfigMap() {
64  std::map<string, string> referenceConfigMap;
65  referenceConfigMap["A5FFINIT"] = "INIT1";
66  referenceConfigMap["B5FFINIT"] = "INIT1";
67  referenceConfigMap["C5FFINIT"] = "INIT1";
68  referenceConfigMap["D5FFINIT"] = "INIT1";
69  referenceConfigMap["AFFINIT"] = "INIT1";
70  referenceConfigMap["BFFINIT"] = "INIT1";
71  referenceConfigMap["CFFINIT"] = "INIT1";
72  referenceConfigMap["DFFINIT"] = "INIT1";
73  referenceConfigMap["RAM_MODE"] = "TDP";
74  referenceConfigMap["LFSR_EN_SET"] = "SET";
75  referenceConfigMap["TEST_SET_P"] = "SET";
76  referenceConfigMap["MASK"] = "000000000000";
77  referenceConfigMap["PATTERN"] = "000000000000";
78 
79  return referenceConfigMap;
80  }
81 
82  /// Virtual Functions
83  /// \brief Get parent family name
84  virtual string getParentFamilyName() {
85  return "Virtex7";
86  }
87  /// \brief Compress given bitstream file against reference bitstream file
88  virtual void compressBitFile(path primaryFile, path referenceFile);
89  /// \brief Get word offset from tile row and col
90  virtual uint32_t getWordOffsetFromTileLocation(TileRow tileRow, TileCol tileCol, BitstreamSharedPtr inBitstreamPtr);
91  /// \brief Populate primitive name to primitive structure map
93  /// \brief Generate micro-bitstreams for memory elements like LUT in RAM mode
94  virtual void generateMemoryMicroBitstream();
95 
96  protected:
97  // Static members
98  static const int sCrcWordIndex; ///< This have to be changed for different Family
99  static const string sTilesSupportedForPips[]; ///< Array of supported routing tiles
100 
101  };
102 
103 } //namepsace bitstream
104 } // namespace torc
105 
106 
107 #endif // VIRTEX7LIBGEN_HPP_
108 
109 
Encapsulation of a tile row in an unsigned 16-bit integer.
Encapsulation of a tile column in an unsigned 16-bit integer.
virtual std::string getRambPrimaryPrimitive()
Returns primary primitive for Ramb site type.
static const string sTilesSupportedForPips[]
Array of supported routing tiles.
virtual uint32_t getWordOffsetFromTileLocation(TileRow tileRow, TileCol tileCol, BitstreamSharedPtr inBitstreamPtr)
Get word offset from tile row and col.
virtual ~Virtex7LibGen()
Destructor.
virtual PrimitiveStructuresSharedPtrMap getPrimitiveNameToStructreMap()
Populate primitive name to primitive structure map.
virtual string getParentFamilyName()
Get parent family name.
void initialize()
Do architecture specific part of initialization.
virtual bool isSiteTypeSupported(const string &inSiteType)
Returns true if site type is supported.
std::string string
static const int sCrcWordIndex
This have to be changed for different Family.
boost::filesystem::path path
std::map< std::string, PrimitiveStructureSharedPtr > PrimitiveStructuresSharedPtrMap
Typedef of map from primitive name to primitive structure shared pointer.
std::map< string, string > getReferenceConfigMap()
Get a map from config setting to reference value.
static CompoundSettingMap getCompoundSettingsMap()
Returns map of coumpound settings.
torc::bitstream::Assembler::CompoundSettingMap CompoundSettingMap
Map from one setting to vector of related setings.
virtual std::vector< std::string > getTilesSupportedForPips()
Returns list of supported tiles. Assumes last tile is "LAST_TILE".
boost::shared_ptr< Bitstream > BitstreamSharedPtr
virtual void compressBitFile(path primaryFile, path referenceFile)
Compress given bitstream file against reference bitstream file.
virtual void generateMemoryMicroBitstream()
Generate micro-bitstreams for memory elements like LUT in RAM mode.
Virtex7LibGen(string inDevice, path inHarnessFolder, path inXdlGenerationFolder)
Constructor.
boost::filesystem::path path
Imported type name.