torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Virtex5LibGen.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 for Virtex5 family
17 
18 #ifndef VIRTEX5LIBGEN_HPP_
19 #define VIRTEX5LIBGEN_HPP_
20 
21 #include "AssemblerLibGen.hpp"
22 
23 namespace torc {
24 namespace bitstream {
25 
26  class Virtex5LibGen : public AssemblerLibGen {
27  public:
28  /// \brief Constructor
29  Virtex5LibGen(string inDevice, path inHarnessFolder, path inXdlGenerationFolder)
30  : AssemblerLibGen(inDevice, inHarnessFolder, inXdlGenerationFolder) {
31  initialize();
32  }
33  /// \brief Destructor
34  virtual ~Virtex5LibGen() { }
35 
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  /// \brief Get a map from config setting to reference value
51  std::map<string, string> getReferenceConfigMap() {
52  std::map<string, string> referenceConfigMap;
53  referenceConfigMap["LFSR_EN_SET"] = "SET";
54  referenceConfigMap["TEST_SET_P"] = "SET";
55  referenceConfigMap["MASK"] = "000000000000";
56  referenceConfigMap["PATTERN"] = "000000000000";
57 
58  return referenceConfigMap;
59  }
60 
61  protected:
62  /// \brief Do architecture specific part of initialization
63  void initialize();
64 
65  /// Virtual Functions
66  /// \brief Returns true if site type is supported
67  virtual bool isSiteTypeSupported(const string &inSiteType);
68  /// \brief Returns list of supported tiles.
69  virtual std::vector<std::string> getTilesSupportedForPips();
70  /// \brief Returns primiry primitive or Ramb site
72  return "RAMB36_EXP";
73  }
74  /// \brief Compress given bitstream file against reference bitstream file
75  virtual void compressBitFile(path primaryFile, path referenceFile);
76  /// \brief Get word offset from tile row and col
77  virtual uint32_t getWordOffsetFromTileLocation(TileRow tileRow, TileCol tileCol, BitstreamSharedPtr inBitstreamPtr);
78  /// \brief Populate primitive name to primitive structure map
80  /// \brief Generate micro-bitstreams for memory elements like LUT in RAM mode
81  virtual void generateMemoryMicroBitstream();
82 
83  protected:
84  // Static members
85  static const int sCrcWordIndex; ///< This have to be changed for different Family
86  static const string sTilesSupportedForPips[]; ///< Array of supported routing tiles
87 
88  };
89 
90 } //namepsace bitstream
91 } // namespace torc
92 
93 #endif // VIRTEX5LIBGEN_HPP_
94 
Encapsulation of a tile row in an unsigned 16-bit integer.
Encapsulation of a tile column in an unsigned 16-bit integer.
std::map< string, string > getReferenceConfigMap()
Get a map from config setting to reference value.
virtual std::string getRambPrimaryPrimitive()
Returns primiry primitive or Ramb site.
static CompoundSettingMap getCompoundSettingsMap()
Returns map of coumpound settings.
virtual ~Virtex5LibGen()
Destructor.
virtual void compressBitFile(path primaryFile, path referenceFile)
Compress given bitstream file against reference bitstream file.
std::string string
Virtex5LibGen(string inDevice, path inHarnessFolder, path inXdlGenerationFolder)
Constructor.
virtual PrimitiveStructuresSharedPtrMap getPrimitiveNameToStructreMap()
Populate primitive name to primitive structure map.
boost::filesystem::path path
std::map< std::string, PrimitiveStructureSharedPtr > PrimitiveStructuresSharedPtrMap
Typedef of map from primitive name to primitive structure shared pointer.
static const int sCrcWordIndex
This have to be changed for different Family.
virtual void generateMemoryMicroBitstream()
Generate micro-bitstreams for memory elements like LUT in RAM mode.
virtual bool isSiteTypeSupported(const string &inSiteType)
Returns true if site type is supported.
virtual std::vector< std::string > getTilesSupportedForPips()
Returns list of supported tiles.
torc::bitstream::Assembler::CompoundSettingMap CompoundSettingMap
Map from one setting to vector of related setings.
void initialize()
Do architecture specific part of initialization.
virtual uint32_t getWordOffsetFromTileLocation(TileRow tileRow, TileCol tileCol, BitstreamSharedPtr inBitstreamPtr)
Get word offset from tile row and col.
static const string sTilesSupportedForPips[]
Array of supported routing tiles.
boost::shared_ptr< Bitstream > BitstreamSharedPtr
boost::filesystem::path path
Imported type name.