torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
architecture/XdlImporter.cpp
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 /// \file
17 /// \brief Source for the XdlImporter class.
18 
21 
22 namespace torc {
23 namespace architecture {
24 
28  mDDBPtr = new DDB(deviceDesignator);
29  }
30 
32  if(!mDDBPtr) return;
33  INSTANCE_PIN_PHYSICAL_TO_ARCHITECTURE(inInstancePin)->updateTilewire(*mDDBPtr);
34  }
35 
37  if(!mDDBPtr) return;
38  torc::physical::TileName tileName = inPip.getTileName();
39  torc::physical::WireName sourceWireName = inPip.getSourceWireName();
40  torc::physical::WireName sinkWireName = inPip.getSinkWireName();
41  // the pip directions defined in the XDL seem not to follow XDLRC conventions
42  switch(inPip.getDirection()) {
44  //std::cerr << inPip.getDirectionString() << std::endl;
46  //std::cerr << inPip.getDirectionString() << std::endl;
48  //std::cerr << inPip.getDirectionString() << std::endl;
49  try {
50  mDDBPtr->useArc(mDDBPtr->tilePipToArc(tileName, sinkWireName, sourceWireName));
51  } catch(InvalidArcException& iae) {
52  std::cerr << "WARNING: Arc " << iae.mArc << " is invalid." << std::endl;
53  }
54  // fall through to include opposite direction arc
56  //std::cerr << inPip.getDirectionString() << std::endl;
57  try {
58  mDDBPtr->useArc(mDDBPtr->tilePipToArc(tileName, sourceWireName, sinkWireName));
59  } catch(InvalidArcException& iae) {
60  std::cerr << "WARNING: Arc " << iae.mArc << " is invalid." << std::endl;
61  }
62  default:
63  break;
64  }
65  }
66 
67 } // namespace architecture
68 } // namespace torc
string mDesignPackage
Package specified for the design.
Encapsulation of a wire name.
Encapsulation of a device designator and its constituent elements.
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
string mDesignDevice
Device specified for the design.
virtual void initializeDatabase(void)
Initialize the device database.
Arc tilePipToArc(const std::string &inTileName, const std::string &inSourceWireName, const std::string &inSinkWireName)
Returns the arc for the specified pip tile and wires.
Definition: DDB.hpp:243
string mDesignSpeedGrade
Speed grade specified for the design.
Header for the DeviceDesignator class.
Encapsulation of a tile name.
void useArc(const Arc &inArc)
Marks the arc and all of its source and sink segment wires as used.
Definition: DDB.hpp:173
boost::shared_ptr< class InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.
EPipType
The pip type, either regular or routethrough.
const WireName & getSinkWireName(void) const
Returns the pip sink wire.
Definition: Pip.hpp:77
const TileName & getTileName(void) const
Returns the pip tile.
Definition: Pip.hpp:73
EPipDirection getDirection(void) const
Returns the pip directionality.
Definition: Pip.hpp:79
Physical design programmable interconnect point.
Definition: Pip.hpp:34
const WireName & getSourceWireName(void) const
Returns the pip source wire.
Definition: Pip.hpp:75
#define INSTANCE_PIN_PHYSICAL_TO_ARCHITECTURE(x)
Reinterpret the given torc::physical::InstancePinSharedPtr as a torc::architecture::InstancePinShared...
virtual void bind(torc::physical::InstancePinSharedPtr &inInstancePin)
Bind the given instance pin to its database Tilewire if applicable.
DDB * mDDBPtr
The device database pointer.
Header for the XdlImporter class.