torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NetlistNet.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_NETLISTNET_HPP
17 #define TORC_PLACER_NETLISTNET_HPP
18 
19 #include <vector>
20 #include <string>
23 
24 namespace torc {
25 namespace placer {
26  class NetlistPin;
27 
28  class NetlistNet {
29  // types
31  typedef boost::uint32_t uint32;
32  protected:
36  std::vector<NetlistPin*> mSources;
37  std::vector<NetlistPin*> mSinks;
38 
39  public:
40  NetlistNet(std::string inName, ENetType inType, uint32 inIndex) :
41  mIndex(inIndex), mName(inName), mType(inType) {}
44  uint32 index = mSources.size();
45  mSources.push_back(newPin);
46  return index;
47  }
49  uint32 index = mSinks.size();
50  mSinks.push_back(newPin);
51  return index;
52  }
54  return mSources.size();
55  }
57  return mSinks.size();
58  }
60  return mSources[i];
61  }
63  return mSinks[i];
64  }
66  return mName;
67  }
69  return mType;
70  }
72  return mIndex;
73  }
74  }; //class NetlistNet
75 
76  typedef std::vector<NetlistNet*> NetlistNetPtrVector;
77 } // namespace placer
78 } // namespace torc
79 #endif // TORC_PLACER_NETLISTNET_HPP
ENetType
Enumeration of net power types.
physical::ENetType ENetType
Definition: NetlistNet.hpp:30
std::vector< NetlistPin * > mSinks
Definition: NetlistNet.hpp:37
std::string & getName()
Definition: NetlistNet.hpp:65
uint32 addSink(NetlistPin *newPin)
Definition: NetlistNet.hpp:48
NetlistPin * getSink(uint32 i)
Definition: NetlistNet.hpp:62
std::string string
boost::uint32_t uint32
Definition: NetlistNet.hpp:31
Header for Xilinx physical types.
NetlistPin * getSource(uint32 i)
Definition: NetlistNet.hpp:59
std::vector< NetlistNet * > NetlistNetPtrVector
Definition: NetlistNet.hpp:76
std::vector< NetlistPin * > mSources
Definition: NetlistNet.hpp:36
NetlistNet(std::string inName, ENetType inType, uint32 inIndex)
Definition: NetlistNet.hpp:40
uint32 addSource(NetlistPin *newPin)
Definition: NetlistNet.hpp:43