torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DeviceSite.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-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 #ifndef TORC_PLACER_DEVICESITE_HPP
17 #define TORC_PLACER_DEVICESITE_HPP
18 
19 #include <string>
20 #include "DeviceSiteType.hpp"
21 #include "DeviceSitePin.hpp"
22 #include "NetlistInstance.hpp"
23 
24 namespace torc {
25 namespace placer {
26  class NetlistInstance;
27  class DeviceSitePin;
28 
29  class DeviceSite {
30  typedef std::vector<DeviceSitePin*> DeviceSitePinPtrVector;
31  protected:
32  NetlistInstance* mInstance; // this is the instance that is contained in this site
36 
38 
39  //CSites::CSite& mSite;
40  int mRow; // these are the coordinates extracted from the site name
41  int mCol;
42  //int mTileRow; // tile row and column
43  //int mTileCol;
44 
45  //std::vector<PlacerSite*>* // pointer to candidate list that needs update
46  //int // index into candidate list that needs update
47 
48 
49 
50  public:
51  //PlacerSite(CSite& inSite) : mInstance(NULL), mSite(inSite)
52  DeviceSite(const std::string& inName, int inSiteTypeIndex, int inTileIndex, int inRow,
53  int inCol) : mInstance(NULL),
54  mName(inName), mSiteTypeIndex(inSiteTypeIndex), mTileIndex(inTileIndex), mRow(inRow),
55  mCol(inCol) {}
57  void setInstance(NetlistInstance* instptr) {
58  mInstance = instptr;
59  }
61  return mInstance;
62  }
63  const std::string& getName() {
64  return mName;
65  }
67  return mSiteTypeIndex;
68  }
69  int getTileIndex() {
70  return mTileIndex;
71  }
72  int getRow() {
73  return mRow;
74  }
75  int getCol() {
76  return mCol;
77  }
78  void addPin(std::string inName, int inRow, int inCol) {
79  DeviceSitePin* pin = new DeviceSitePin(inName, inRow, inCol);
80  mPins.push_back(pin); // this is a nasty thing, copying this around, but probably
81  // don't matter, only to initialize the thing
82  }
83  int getNumPins() {
84  return mPins.size();
85  }
87  return mPins[i];
88  }
89 
90  }; //class DeviceSite
91 } // namespace placer
92 } // namespace torc
93 #endif // TORC_PLACER_DEVICESITE_HPP
std::vector< DeviceSitePin * > DeviceSitePinPtrVector
Definition: DeviceSite.hpp:30
DeviceSitePinPtrVector mPins
Definition: DeviceSite.hpp:37
NetlistInstance * mInstance
Definition: DeviceSite.hpp:32
std::string string
DeviceSitePin * getPin(int i)
Definition: DeviceSite.hpp:86
DeviceSite(const std::string &inName, int inSiteTypeIndex, int inTileIndex, int inRow, int inCol)
Definition: DeviceSite.hpp:52
void addPin(std::string inName, int inRow, int inCol)
Definition: DeviceSite.hpp:78
const std::string & mName
Definition: DeviceSite.hpp:33
const std::string & getName()
Definition: DeviceSite.hpp:63
void setInstance(NetlistInstance *instptr)
Definition: DeviceSite.hpp:57
Header for the DeviceSiteType class.
NetlistInstance * getInstance()
Definition: DeviceSite.hpp:60