torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VirtexAssembler.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/VirtexAssembler.hpp $
3 // $Id: VirtexAssembler.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 VirtexAssembler.hpp
17 /// \brief Definition of base Virtex class to implement functions common across all/some Virtex architectures.
18 
19 #ifndef TORC_BITSTREAM_ASSEMBLER_VIRTEXASSEMBLER_HPP
20 #define TORC_BITSTREAM_ASSEMBLER_VIRTEXASSEMBLER_HPP
21 
23 #include "torc/Bitstream.hpp"
26 #include "torc/Physical.hpp"
27 #include <iostream>
28 
29 namespace torc {
30 namespace bitstream {
31 
32 /// \brief Base Virtex class to implement functions common across all/some Virtex architectures
33 class VirtexAssembler: public Assembler {
34 public:
35 
36  // Types
37  /// \brief Imported type
39 
40  // Constructors
41  /// \brief Constructor taking in both design pointer and database object
43  Assembler(inDB) {
44  }
45  /// \brief Constructor taking in both design pointer and database object
46  //VirtexAssembler(DesignSharedPtr inDesignPtr) : Assembler(inDesignPtr) {
47  //}
48  /// \brief Destructor
49  virtual ~VirtexAssembler() {
50  }
51 
52  // Public functions
53  /// \brief Function to generate bitstream to be called by user.
54  virtual int generateBitstream(DesignSharedPtr inDesignPtr,
55  const path inTargetBitstreamPath,
56  EMergeMode inMergeMode = eSet,
57  path baseBitstreamPath = path());
58 
59 protected:
60 
61  // Protected functions
62  /// \brrief Interface to check if site type is supported. To be implemented by every derived architecture.
63  virtual bool isSiteTypeSupported(const std::string &siteType) = 0;
64  /// \brief Interface to check if given setting is part of compound setting
65  virtual bool isCompoundSetting(string inElementName) = 0;
66  /// \brief Interface to get vector of related configurations
67  virtual vector<string> getDependantConfigs(string inElement1Name) = 0;
68  /// \brief Initialize frame blocks after reading a bitstream
69  virtual void initializeFullFrameBlocks() = 0;
70  /// \brief Update frame blocks after modifying bitstream and just beore saving it
71  virtual void updateFullFrameBlocks() = 0;
72  /// \brief Get primary Xdl column for given tile column
73  virtual uint32_t getPrimaryXdlColumn(TileCol inTileColumn) = 0;
74  /// \brief Get Xdl frames for given tile row
75  virtual VirtexFrameBlocks
76  getXdlFrames(TileRow inTileRow, uint32_t inPrimaryXdlCol,
77  uint32_t inBitIndexBegin, uint32_t inBitIndexEnd) = 0;
78  /// \brief Store frame blocks and bit offset for given site
79  virtual void initializeFrameDataForSite(const std::string &siteName);
80  /// \brief Store frame blocks and bit offset for given tile index
81  virtual void initializeFrameDataForTile(TileIndex tileIndex) = 0;
82  /// \brief Merge compressed micro-bitstream with base bitstream
83  virtual void mergeWithBaseBitstream(const std::vector<uint32_t> &bitAddresses,
84  uint32_t blockIndex);
85 
86 protected:
87  // Protected members
88  torc::bitstream::VirtexFrameBlocks mCurrFrameBlocks; ///< Frame blocks for current site/tile
89  boost::uint32_t mCurrWordOffset; ///< Word offset withing frame for current site/tile
90 };
91 } // namespace bitstream
92 } // namespace torc
93 
94 #endif // TORC_BITSTREAM_ASSEMBLER_VIRTEXASSEMBLER_HPP
virtual void updateFullFrameBlocks()=0
Update frame blocks after modifying bitstream and just beore saving it.
virtual bool isSiteTypeSupported(const std::string &siteType)=0
Interface to check if site type is supported. To be implemented by every derived architecture.
Encapsulation of a tile index in an unsigned 32-bit integer.
Encapsulation of a tile row in an unsigned 16-bit integer.
Encapsulation of a tile column in an unsigned 16-bit integer.
torc::physical::DesignSharedPtr DesignSharedPtr
Imported type name.
Definition: Assembler.hpp:61
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
virtual uint32_t getPrimaryXdlColumn(TileCol inTileColumn)=0
Get primary Xdl column for given tile column.
Header for the DirectoryTree class.
virtual bool isCompoundSetting(string inElementName)=0
Interface to check if given setting is part of compound setting.
Main torc::bitstream namespace header.
Base Virtex class to implement functions common across all/some Virtex architectures.
virtual void mergeWithBaseBitstream(const std::vector< uint32_t > &bitAddresses, uint32_t blockIndex)
Merge compressed micro-bitstream with base bitstream.
Base class for Xdl to bitstream conversion. This class is abstract but still contains lot of architec...
std::string string
Main torc::physical namespace header.
boost::filesystem::path path
Imported type name.
Definition: Assembler.hpp:67
virtual void initializeFrameDataForTile(TileIndex tileIndex)=0
Store frame blocks and bit offset for given tile index.
boost::filesystem::path path
torc::bitstream::VirtexFrameBlocks VirtexFrameBlocks
Imported type.
virtual ~VirtexAssembler()
Constructor taking in both design pointer and database object.
torc::bitstream::VirtexFrameBlocks mCurrFrameBlocks
Frame blocks for current site/tile.
virtual void initializeFrameDataForSite(const std::string &siteName)
Store frame blocks and bit offset for given site.
virtual int generateBitstream(DesignSharedPtr inDesignPtr, const path inTargetBitstreamPath, EMergeMode inMergeMode=eSet, path baseBitstreamPath=path())
Function to generate bitstream to be called by user.
virtual void initializeFullFrameBlocks()=0
Initialize frame blocks after reading a bitstream.
Header for the DDB class.
virtual vector< string > getDependantConfigs(string inElement1Name)=0
Interface to get vector of related configurations.
virtual VirtexFrameBlocks getXdlFrames(TileRow inTileRow, uint32_t inPrimaryXdlCol, uint32_t inBitIndexBegin, uint32_t inBitIndexEnd)=0
Get Xdl frames for given tile row.
Base class for bitstream assembly.
Definition: Assembler.hpp:46
boost::uint32_t mCurrWordOffset
Word offset withing frame for current site/tile.
VirtexAssembler(torc::architecture::DDB &inDB)
Constructor taking in both design pointer and database object.