00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_PLACER_NETLISTNET_HPP
00017 #define TORC_PLACER_NETLISTNET_HPP
00018
00019 #include <vector>
00020 #include <string>
00021 #include "torc/placer/NetlistPin.hpp"
00022 #include "torc/physical/XilinxPhysicalTypes.hpp"
00023
00024 namespace torc {
00025 namespace placer {
00026 class NetlistPin;
00027
00028 class NetlistNet {
00029
00030 typedef physical::ENetType ENetType;
00031 typedef boost::uint32_t uint32;
00032 protected:
00033 uint32 mIndex;
00034 std::string mName;
00035 ENetType mType;
00036 std::vector<NetlistPin*> mSources;
00037 std::vector<NetlistPin*> mSinks;
00038
00039 public:
00040 NetlistNet(std::string inName, ENetType inType, uint32 inIndex) :
00041 mIndex(inIndex), mName(inName), mType(inType) {}
00042 ~NetlistNet() {}
00043 uint32 addSource(NetlistPin* newPin) {
00044 uint32 index = mSources.size();
00045 mSources.push_back(newPin);
00046 return index;
00047 }
00048 uint32 addSink(NetlistPin* newPin) {
00049 uint32 index = mSinks.size();
00050 mSinks.push_back(newPin);
00051 return index;
00052 }
00053 uint32 getNumSources() {
00054 return mSources.size();
00055 }
00056 uint32 getNumSinks() {
00057 return mSinks.size();
00058 }
00059 NetlistPin* getSource(uint32 i) {
00060 return mSources[i];
00061 }
00062 NetlistPin* getSink(uint32 i) {
00063 return mSinks[i];
00064 }
00065 std::string& getName() {
00066 return mName;
00067 }
00068 ENetType getType() {
00069 return mType;
00070 }
00071 uint32 getIndex() {
00072 return mIndex;
00073 }
00074 };
00075
00076 typedef std::vector<NetlistNet*> NetlistNetPtrVector;
00077 }
00078 }
00079 #endif // TORC_PLACER_NETLISTNET_HPP