00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://svn.east.isi.edu/torc/trunk/src/torc/architecture/ExtendedWireInfo.cpp $ 00003 // $Id: ExtendedWireInfo.cpp 481 2011-06-07 20:34:36Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 /// \file 00017 /// \brief Source for the ExtendedWireInfo class. 00018 00019 #include "torc/architecture/ExtendedWireInfo.hpp" 00020 #include "torc/architecture/DDB.hpp" 00021 #include "torc/architecture/TileInfo.hpp" 00022 #include "torc/architecture/WireInfo.hpp" 00023 00024 namespace torc { 00025 namespace architecture { 00026 00027 void ExtendedWireInfo::set(const Tilewire& inTilewire) { 00028 // be sure to handle invalid tilewires appropriately 00029 if(inTilewire.isUndefined()) { 00030 mWireIndex = WireIndex(WireIndex::undefined()); 00031 mTileIndex = TileIndex(TileIndex::undefined()); 00032 mTileTypeIndex = TileTypeIndex(TileTypeIndex::undefined()); 00033 mTileRow = TileRow(TileRow::undefined()); 00034 mTileCol = TileCol(TileCol::undefined()); 00035 mTileName = ""; 00036 mTileTypeName = ""; 00037 mWireName = ""; 00038 mWireFlags = WireFlags(); 00039 return; 00040 } 00041 // extract the tile and wire indexes 00042 mWireIndex = inTilewire.getWireIndex(); 00043 mTileIndex = inTilewire.getTileIndex(); 00044 const Tiles& tiles = mDDB.getTiles(); 00045 // get information about the tile itself 00046 const TileInfo& tileInfo = tiles.getTileInfo(mTileIndex); 00047 mTileTypeIndex = tileInfo.getTypeIndex(); 00048 mTileRow = tileInfo.getRow(); 00049 mTileCol = tileInfo.getCol(); 00050 //mTileName = ""; 00051 mTileName = tileInfo.getName(); 00052 // get information about the tile type 00053 mTileTypeName = mDDB.getTiles().getTileTypeName(mTileTypeIndex); 00054 // get information about the wire 00055 const WireInfo& wireInfo = tiles.getWireInfo(mTileTypeIndex, mWireIndex); 00056 mWireName = wireInfo.getName(); 00057 mWireFlags = wireInfo.getFlags(); 00058 } 00059 00060 } // namespace architecture 00061 } // namespace torc