torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::architecture::DDB Class Reference

Device database, including complete wiring and logic support. More...

#include <DDB.hpp>

+ Inheritance diagram for torc::architecture::DDB:
+ Collaboration diagram for torc::architecture::DDB:

Public Types

enum  EExpandDirection { eExpandDirectionNone = 0, eExpandDirectionSinkward = 1, eExpandDirectionSourceward = 2, eExpandDirectionBidirectional = eExpandDirectionSinkward | eExpandDirectionSourceward }
 Enumeration to indicate in which directions segments should be expanded. More...
 

Public Member Functions

 mWireUsage (mTiles)
 
 DDB (const string &inDeviceName, const string &inPackageName, DDBConsoleStreams inDDBConsoleStreams=DDBConsoleStreams())
 Public constructor. More...
 
 DDB (const torc::common::DeviceDesignator &inDeviceDesignator, DDBConsoleStreams inDDBConsoleStreams=DDBConsoleStreams())
 Public constructor. More...
 
 ~DDB (void)
 Destructor. More...
 
const stringgetDeviceName (void) const
 Returns the device name. More...
 
const stringgetFamilyName (void) const
 Returns the family name. More...
 
const boost::filesystem::path & getDevicePath (void) const
 Returns the device database path. More...
 
const boost::filesystem::path & getFamilyPath (void) const
 Returns the family database path. More...
 
const StringVectorgetSpeedGrades (void) const
 Returns a constant reference to a vector of speed grades. More...
 
const SegmentsgetSegments (void) const
 Returns a constant reference to the device segment data. More...
 
const SitesgetSites (void) const
 Returns a constant reference to the family and device site data. More...
 
const TilesgetTiles (void) const
 Returns a constant reference to the family and device tile data. More...
 
ArcUsagegetArcUsage (void)
 Returns a constant reference to the design arc usage. More...
 
WireUsagegetWireUsage (void)
 Returns a constant reference to the design wire usage. More...
 
virtual void setConsoleStreams (DDBConsoleStreams inConsoleStreams)
 Sets all of the database console streams. More...
 
virtual void setConsoleStreams (istream &inIn, ostream &inOut, ostream &inErr, ostream &inLog)
 Sets all of the database console streams. More...
 
void clearUsage (void)
 Clears all arc and wire usage, effectively restaring with an empty device. More...
 
void useArc (const Arc &inArc)
 Marks the arc and all of its source and sink segment wires as used. More...
 
void releaseArc (const Arc &inArc, bool releaseSource=true, bool releaseSink=true)
 Marks the arc and all of its source and sink segment wires as unused. More...
 
void useSegment (const Tilewire &inTilewire)
 Marks all wires on the segment as used. More...
 
void releaseSegment (const Tilewire &inTilewire)
 Marks all wires on the segment as unused. More...
 
void expandSegment (const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
 Expands the given tilewire's segment. More...
 
void expandTilewireSinks (const Tilewire &inTilewire, TilewireVector &outSinks, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
 Expands the given tilewire's arc sinks. More...
 
void expandTilewireSources (const Tilewire &inTilewire, TilewireVector &outSources, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
 Expands the given tilewire's arc sources. More...
 
void expandSegmentSinks (const Tilewire &inTilewire, ArcVector &outSinks, EExpandDirection inExpandDirection=eExpandDirectionNone, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
 Expands all sink arcs for the given tilewire's segment. More...
 
void expandSegmentSources (const Tilewire &inTilewire, ArcVector &outSources, EExpandDirection inExpandDirection=eExpandDirectionNone, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
 Expands all source arcs for the given tilewire's segment. More...
 
Tilewire sitePinToTilewire (const std::string &inSiteName, const std::string &inPinName)
 Returns the tilewire for the specified site and pin name pair. More...
 
Arc tilePipToArc (const std::string &inTileName, const std::string &inSourceWireName, const std::string &inSinkWireName)
 Returns the arc for the specified pip tile and wires. More...
 
Tilewire lookupTilewire (const std::string &inTileName, const std::string &inWireName)
 Returns the tilewire for the specified tile and wire names. More...
 

Data Fields

 __pad0__: mArcUsage(mTiles)
 Public constructor. More...
 

Protected Types

typedef std::string string
 Imported type name. More...
 
typedef std::vector< stringStringVector
 Imported type name. More...
 
typedef xilinx::SiteIndex SiteIndex
 Imported type name. More...
 
typedef xilinx::WireIndex WireIndex
 Imported type name. More...
 
typedef xilinx::TileIndex TileIndex
 Imported type name. More...
 
typedef xilinx::TileOffset TileOffset
 Imported type name. More...
 
typedef xilinx::TileTypeIndex TileTypeIndex
 Imported type name. More...
 

Protected Member Functions

size_t readFamilyName (class DigestStream &inStream)
 Reads the family name from a device DigestStream. More...
 
size_t readSpeedGrades (class DigestStream &inStream)
 Reads the supported speed grades from a device DigestStream. More...
 
void initialize (const string &inDeviceName, const string &inPackageName)
 Initializes the database. More...
 

Protected Attributes

string mDeviceName
 The name of the device. More...
 
string mFamilyName
 The name of the family. More...
 
boost::filesystem::path mDevicePath
 the device database path. More...
 
boost::filesystem::path mFamilyPath
 the family database path. More...
 
Versions mDeviceVersion
 The device database version. More...
 
Versions mFamilyVersion
 The family database version. More...
 
StringVector mSpeedGrades
 The supported speed grades. More...
 
Segments mSegments
 The device segment data. More...
 
Sites mSites
 The family and device site data. More...
 
Tiles mTiles
 The family and device tile data. More...
 
ArcUsage mArcUsage
 The design arc usage. More...
 
WireUsage mWireUsage
 The design wire usage. More...
 

Private Types

typedef std::basic_istream< char > istream
 Internal typedef of istream;. More...
 
typedef std::basic_ostream< char > ostream
 Internal typedef of ostream;. More...
 

Private Member Functions

istreammIn (void)
 Returns the database console input stream. More...
 
ostreammOut (void)
 Returns the database console output stream. More...
 
ostreammErr (void)
 Returns the database console error stream. More...
 
ostreammLog (void)
 Returns the database console log stream. More...
 
istreamgetConsoleIn (void)
 Returns the database console input stream. More...
 
ostreamgetConsoleOut (void)
 Returns the database console output stream. More...
 
ostreamgetConsoleErr (void)
 Returns the database console error stream. More...
 
ostreamgetConsoleLog (void)
 Returns the database console log stream. More...
 
void setConsoleIn (istream &inStream)
 Sets the database console input stream. More...
 
void setConsoleOut (ostream &inStream)
 Sets the database console output stream. More...
 
void setConsoleErr (ostream &inStream)
 Sets the database console error stream. More...
 
void setConsoleLog (ostream &inStream)
 Sets the database console log stream. More...
 

Private Attributes

istreammInPtr
 Pointer to the database console input stream. More...
 
ostreammOutPtr
 
ostreammErrPtr
 
ostreammLogPtr
 

Static Private Attributes

static DDBConsoleStreams sDefaultConsoleStreams
 
static DDBConsoleStreams sNullConsoleStreams
 

Detailed Description

Device database, including complete wiring and logic support.

Note
The DDBConsoleStreams superclass is a utility class that allows for console stream redirection.

Definition at line 42 of file DDB.hpp.

Member Typedef Documentation

Internal typedef of istream;.

Definition at line 41 of file DDBConsoleStreams.hpp.

Internal typedef of ostream;.

Definition at line 43 of file DDBConsoleStreams.hpp.

Imported type name.

Definition at line 47 of file DDB.hpp.

typedef std::string torc::architecture::DDB::string
protected

Imported type name.

Definition at line 45 of file DDB.hpp.

typedef std::vector<string> torc::architecture::DDB::StringVector
protected

Imported type name.

Definition at line 46 of file DDB.hpp.

Imported type name.

Definition at line 49 of file DDB.hpp.

Imported type name.

Definition at line 50 of file DDB.hpp.

Imported type name.

Definition at line 51 of file DDB.hpp.

Imported type name.

Definition at line 48 of file DDB.hpp.

Member Enumeration Documentation

Enumeration to indicate in which directions segments should be expanded.

Segment expansion direction only makes sense when device databases include tied wires (or "fake pips"). When tied wires are present, the caller can request that segment expansions include no tied wires, include tied wires in the sinkward direction, include tied wires in the sourceward direction, or include tied wires in both directions.

Enumerator
eExpandDirectionNone 
eExpandDirectionSinkward 
eExpandDirectionSourceward 
eExpandDirectionBidirectional 

Definition at line 92 of file DDB.hpp.

Constructor & Destructor Documentation

torc::architecture::DDB::DDB ( const string inDeviceName,
const string inPackageName,
DDBConsoleStreams  inDDBConsoleStreams = DDBConsoleStreams() 
)
inline

Public constructor.

Parameters
inDeviceNameThe name of the device to open. This name should not include any package or speed grade information, nor any extension. Examples are xc2vp100, xc4vfx60, xc5vlx30, et cetera.
inPackageNameThe name of the package to use.
inDDBConsoleStreamsThe console streams that the database should use.

Definition at line 112 of file DDB.hpp.

115  { setConsoleStreams(inDDBConsoleStreams); initialize(inDeviceName, inPackageName); }
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
ArcUsage mArcUsage
The design arc usage.
Definition: DDB.hpp:74
virtual void setConsoleStreams(DDBConsoleStreams inConsoleStreams)
Sets all of the database console streams.
Definition: DDB.hpp:152
void initialize(const string &inDeviceName, const string &inPackageName)
Initializes the database.
Definition: DDB.cpp:31
WireUsage mWireUsage
The design wire usage.
Definition: DDB.hpp:76

+ Here is the call graph for this function:

torc::architecture::DDB::DDB ( const torc::common::DeviceDesignator inDeviceDesignator,
DDBConsoleStreams  inDDBConsoleStreams = DDBConsoleStreams() 
)
inline

Public constructor.

Parameters
inDeviceDesignatorA designator for the device to open.
inDDBConsoleStreamsThe console streams that the database should use.

Definition at line 119 of file DDB.hpp.

122  setConsoleStreams(inDDBConsoleStreams);
123  initialize(inDeviceDesignator.getDeviceName(), inDeviceDesignator.getDevicePackage());
124  }
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
ArcUsage mArcUsage
The design arc usage.
Definition: DDB.hpp:74
const string & getDevicePackage(void) const
Returns the device package.
virtual void setConsoleStreams(DDBConsoleStreams inConsoleStreams)
Sets all of the database console streams.
Definition: DDB.hpp:152
const string & getDeviceName(void) const
Returns the device name.
void initialize(const string &inDeviceName, const string &inPackageName)
Initializes the database.
Definition: DDB.cpp:31
WireUsage mWireUsage
The design wire usage.
Definition: DDB.hpp:76

+ Here is the call graph for this function:

torc::architecture::DDB::~DDB ( void  )
inline

Destructor.

Definition at line 126 of file DDB.hpp.

126  {
128  }
static void dissociate(const class DDB &ddb)
Dissociate the given device database from any stream.

+ Here is the call graph for this function:

Member Function Documentation

void torc::architecture::DDB::clearUsage ( void  )
inline

Clears all arc and wire usage, effectively restaring with an empty device.

Definition at line 168 of file DDB.hpp.

168  {
169  mWireUsage.clear();
170  mArcUsage.clear();
171  }
void clear(void)
Marks all arcs as being unused, without releasing the bitset objects.
Definition: ArcUsage.hpp:192
void clear(void)
Marks all wires as being unused, without releasing the bitset objects.
Definition: WireUsage.hpp:121
ArcUsage mArcUsage
The design arc usage.
Definition: DDB.hpp:74
WireUsage mWireUsage
The design wire usage.
Definition: DDB.hpp:76

+ Here is the call graph for this function:

void torc::architecture::DDB::expandSegment ( const Tilewire inTilewire,
TilewireVector outTilewires,
EExpandDirection  inExpandDirection = eExpandDirectionNone 
)

Expands the given tilewire's segment.

Given a tilewire belonging to a segment, this function populates the supplied vector with all of the tilewires on the segment. An optional parameter allows the expansion to continue in the sinkward or sourceward directions in cases where tied sources or sinks are available.

Definition at line 154 of file DDB.cpp.

155  {
156 
157  // look up the segment specified by this tile and wire
158  WireIndex wireIndex = inTilewire.getWireIndex();
159  TileIndex tileIndex = inTilewire.getTileIndex();
160  const Segments::SegmentReference& compactSegmentReference
161  = mSegments.getTilewireSegment(inTilewire);
162  // undefined segments are not real in the current device
163  if(!compactSegmentReference.isDefined()) return;
164 
165  // initialize the wire array with the segment information or the trivial wire
166  Array<Segments::CompactSegmentTilewire> trivialSegmentReference;
167  if(compactSegmentReference.isTrivial()) {
168  trivialSegmentReference.setSize(1);
169  trivialSegmentReference[0] = Segments::CompactSegmentTilewire(wireIndex,
170  TileOffset(tileIndex));
171  }
172  const Array<Segments::CompactSegmentTilewire>& segmentReference
173  = compactSegmentReference.isTrivial() ? trivialSegmentReference
174  : mSegments.mCompactSegments[compactSegmentReference.getCompactSegmentIndex()];
175 
176  // iterate through each wire in the compact segment
177  TileIndex anchorTileIndex = compactSegmentReference.getAnchorTileIndex();
178  Array<Segments::CompactSegmentTilewire>::const_iterator csp
179  = segmentReference.begin();
180  Array<Segments::CompactSegmentTilewire>::const_iterator cse
181  = segmentReference.end();
182  bool sinkward = (inExpandDirection & eExpandDirectionSinkward) != 0;
183  bool sourceward = (inExpandDirection & eExpandDirectionSourceward) != 0;
184  while(csp < cse) {
185  // get information about the current tilewire
186  const Segments::CompactSegmentTilewire& compactSegmentTilewire = *csp++;
187  WireIndex csWireIndex = compactSegmentTilewire.getWireIndex();
188  TileOffset csTileOffset = compactSegmentTilewire.getTileOffset();
189  TileIndex csTileIndex = csTileOffset + anchorTileIndex;
190  // push each wire into the segment
191  outTilewires.push_back(Tilewire(csTileIndex, csWireIndex));
192  // look up tile and wire information
193  const TileInfo& tileInfo = mTiles.getTileInfo(csTileIndex);
194  const WireInfo& wireInfo = mTiles.getWireInfo(tileInfo.getTypeIndex(), csWireIndex);
195  // include tied sinks
196  if(sinkward) {
197  const WireArray& tiedSinks = wireInfo.getTiedSinks();
198  WireArray::const_iterator p = tiedSinks.begin();
199  WireArray::const_iterator e = tiedSinks.end();
200  while(p < e) expandSegment(Tilewire(csTileIndex, *p++), outTilewires,
201  inExpandDirection);
202  }
203  // include tied sources
204  if(sourceward) {
205  const WireArray& tiedSources = wireInfo.getTiedSources();
206  WireArray::const_iterator p = tiedSources.begin();
207  WireArray::const_iterator e = tiedSources.end();
208  while(p < e) expandSegment(Tilewire(csTileIndex, *p++), outTilewires,
209  inExpandDirection);
210  }
211  }
212  }
const const xilinx::WireIndex * const_iterator
Constant T iterator type.
Definition: Array.hpp:83
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
xilinx::TileOffset TileOffset
Imported type name.
Definition: DDB.hpp:50
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
xilinx::TileIndex TileIndex
Imported type name.
Definition: DDB.hpp:49
const Array< const WireInfo > & getWireInfo(TileTypeIndex inTileTypeIndex) const
Returns the WireInfo array for the specified tile type.
Definition: Tiles.hpp:140
Array2D< CompactSegmentTilewire > mCompactSegments
The compact segments in the device.
Definition: Segments.hpp:117
xilinx::WireIndex WireIndex
Imported type name.
Definition: DDB.hpp:48
Segments mSegments
The device segment data.
Definition: DDB.hpp:68
const Segments::SegmentReference & getTilewireSegment(const Tilewire &inTilewire) const
Return the segment reference for the given tile and wire index.
Definition: Segments.hpp:182
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDB::expandSegmentSinks ( const Tilewire inTilewire,
ArcVector outSinks,
EExpandDirection  inExpandDirection = eExpandDirectionNone,
bool  inUseTied = true,
bool  inUseRegular = true,
bool  inUseIrregular = true,
bool  inUseRoutethrough = true 
)

Expands all sink arcs for the given tilewire's segment.

The optional inUseTied, inUseRegular, inUseIrregular, and inUseRoutethrough flags determine whether the corresponding arc types will be included. Note that tied arcs (or "fake pips") are not currently available in the databases.

Definition at line 314 of file DDB.cpp.

316  {
317  // expand the segment
318  TilewireVector segment;
319  expandSegment(inTilewire, segment, inExpandDirection);
320  // expand all of the arcs
321  TilewireVector::const_iterator sep = segment.begin();
322  TilewireVector::const_iterator see = segment.end();
323  while(sep < see) {
324  // expand the tilewire sinks
325  const Tilewire& tilewire = *sep++;
326  TilewireVector sinks;
327  expandTilewireSinks(tilewire, sinks, inUseTied, inUseRegular, inUseIrregular,
328  inUseRoutethrough);
329  // rewrite the sinks as arcs
330  TilewireVector::const_iterator sip = sinks.begin();
331  TilewireVector::const_iterator sie = sinks.end();
332  while(sip < sie) outArcs.push_back(Arc(tilewire, *sip++));
333  }
334  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
void expandTilewireSinks(const Tilewire &inTilewire, TilewireVector &outSinks, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands the given tilewire's arc sinks.
Definition: DDB.cpp:214
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDB::expandSegmentSources ( const Tilewire inTilewire,
ArcVector outSources,
EExpandDirection  inExpandDirection = eExpandDirectionNone,
bool  inUseTied = true,
bool  inUseRegular = true,
bool  inUseIrregular = true,
bool  inUseRoutethrough = true 
)

Expands all source arcs for the given tilewire's segment.

The optional inUseTied, inUseRegular, inUseIrregular, and inUseRoutethrough flags determine whether the corresponding arc types will be included. Note that tied arcs (or "fake pips") are not currently available in the databases.

Definition at line 336 of file DDB.cpp.

338  {
339  // expand the segment
340  TilewireVector segment;
341  expandSegment(inTilewire, segment, inExpandDirection);
342  // expand all of the arcs
343  TilewireVector::const_iterator sep = segment.begin();
344  TilewireVector::const_iterator see = segment.end();
345  while(sep < see) {
346  // expand the tilewire sources
347  const Tilewire& tilewire = *sep++;
348  TilewireVector sources;
349  expandTilewireSources(tilewire, sources, inUseTied, inUseRegular, inUseIrregular,
350  inUseRoutethrough);
351  // rewrite the sources as arcs
352  TilewireVector::const_iterator sop = sources.begin();
353  TilewireVector::const_iterator soe = sources.end();
354  while(sop < soe) outArcs.push_back(Arc(*sop++, tilewire));
355  }
356  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
void expandTilewireSources(const Tilewire &inTilewire, TilewireVector &outSources, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands the given tilewire's arc sources.
Definition: DDB.cpp:264
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDB::expandTilewireSinks ( const Tilewire inTilewire,
TilewireVector outSinks,
bool  inUseTied = true,
bool  inUseRegular = true,
bool  inUseIrregular = true,
bool  inUseRoutethrough = true 
)

Expands the given tilewire's arc sinks.

The optional inUseTied, inUseRegular, inUseIrregular, and inUseRoutethrough flags determine whether the corresponding arc types will be included. Note that tied arcs (or "fake pips") are not currently available in the databases.

Definition at line 214 of file DDB.cpp.

215  {
216  // get information about the starting tile and wire
217  WireIndex wireIndex = inTilewire.getWireIndex();
218  TileIndex tileIndex = inTilewire.getTileIndex();
219  const TileInfo& tileInfo = mTiles.getTileInfo(tileIndex);
220  const WireInfo& wireInfo = mTiles.getWireInfo(tileInfo.getTypeIndex(), wireIndex);
221 
222  // add the regular sinks
223  if(inUseRegular) {
224  const WireArray& sinks = wireInfo.getSinks();
225  WireArray::const_iterator sp = sinks.begin();
226  WireArray::const_iterator se = sinks.end();
227  while(sp < se) outSinks.push_back(Tilewire(tileIndex, *sp++));
228  }
229 
230  // add any irregular sinks
231  if(inUseIrregular) {
232  const WireArray& irregularSinks = wireInfo.getIrregularSinks();
233  WireArray::const_iterator isp = irregularSinks.begin();
234  WireArray::const_iterator ise = irregularSinks.end();
235  while(isp < ise) {
236  WireIndex sinkWireIndex = *isp++;
237  // arcs to undefined segments are likewise undefined
238  const Segments::SegmentReference& segment
239  = mSegments.getTilewireSegment(Tilewire(tileIndex, sinkWireIndex));
240  if(!segment.isDefined()) continue;
241  // determine whether this irregular arc exists
242  const Segments::IrregularArc* irregularArc = mSegments.getIrregularArc(tileIndex,
243  wireIndex, sinkWireIndex);
244  if(irregularArc != 0 && !segment.isDefined()) {
245  mErr() << "WARNING: Irregular arc " << inTilewire << " >> "
246  << Tilewire(tileIndex, sinkWireIndex)
247  << " is defined, but the sink segment is undefined." << std::endl;
248  }
249  if(irregularArc == 0) continue;
250  // the arc exists, so add it to the list
251  outSinks.push_back(Tilewire(tileIndex, sinkWireIndex));
252  }
253  }
254 
255  // add the routethrough sinks
256  if(inUseRoutethrough) {
257  const WireArray& routethroughSinks = wireInfo.getRoutethroughSinks();
258  WireArray::const_iterator rsp = routethroughSinks.begin();
259  WireArray::const_iterator rse = routethroughSinks.end();
260  while(rsp < rse) outSinks.push_back(Tilewire(tileIndex, *rsp++));
261  }
262  }
const const xilinx::WireIndex * const_iterator
Constant T iterator type.
Definition: Array.hpp:83
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
xilinx::TileIndex TileIndex
Imported type name.
Definition: DDB.hpp:49
ostream & mErr(void)
Returns the database console error stream.
const Array< const WireInfo > & getWireInfo(TileTypeIndex inTileTypeIndex) const
Returns the WireInfo array for the specified tile type.
Definition: Tiles.hpp:140
xilinx::WireIndex WireIndex
Imported type name.
Definition: DDB.hpp:48
const Segments::IrregularArc * getIrregularArc(TileIndex inTileIndex, WireIndex inSourceWireIndex, WireIndex inSinkWireIndex)
Return a pointer to the requested IrregularArc, or 0 if the arc does not exist.
Definition: Segments.cpp:213
Segments mSegments
The device segment data.
Definition: DDB.hpp:68
const Segments::SegmentReference & getTilewireSegment(const Tilewire &inTilewire) const
Return the segment reference for the given tile and wire index.
Definition: Segments.hpp:182

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDB::expandTilewireSources ( const Tilewire inTilewire,
TilewireVector outSources,
bool  inUseTied = true,
bool  inUseRegular = true,
bool  inUseIrregular = true,
bool  inUseRoutethrough = true 
)

Expands the given tilewire's arc sources.

The optional inUseTied, inUseRegular, inUseIrregular, and inUseRoutethrough flags determine whether the corresponding arc types will be included. Note that tied arcs (or "fake pips") are not currently available in the databases.

Definition at line 264 of file DDB.cpp.

265  {
266  // get information about the starting tile and wire
267  WireIndex wireIndex = inTilewire.getWireIndex();
268  TileIndex tileIndex = inTilewire.getTileIndex();
269  const TileInfo& tileInfo = mTiles.getTileInfo(tileIndex);
270  const WireInfo& wireInfo = mTiles.getWireInfo(tileInfo.getTypeIndex(), wireIndex);
271 
272  // add the regular sources
273  if(inUseRegular) {
274  const WireArray& sources = wireInfo.getSources();
275  WireArray::const_iterator sp = sources.begin();
276  WireArray::const_iterator se = sources.end();
277  while(sp < se) outSources.push_back(Tilewire(tileIndex, *sp++));
278  }
279 
280  // add any irregular sources
281  if(inUseIrregular) {
282  const WireArray& irregularSources = wireInfo.getIrregularSources();
283  WireArray::const_iterator isp = irregularSources.begin();
284  WireArray::const_iterator ise = irregularSources.end();
285  while(isp < ise) {
286  WireIndex sourceWireIndex = *isp++;
287  // arcs to undefined segments are likewise undefined
288  const Segments::SegmentReference& segment
289  = mSegments.getTilewireSegment(Tilewire(tileIndex, sourceWireIndex));
290  if(!segment.isDefined()) continue;
291  // determine whether this irregular arc exists
292  const Segments::IrregularArc* irregularArc = mSegments.getIrregularArc(tileIndex,
293  sourceWireIndex, wireIndex);
294  if(irregularArc != 0 && !segment.isDefined()) {
295  mErr() << "WARNING: Irregular arc " << inTilewire << " >> "
296  << Tilewire(tileIndex, sourceWireIndex)
297  << " is defined, but the source segment is undefined." << std::endl;
298  }
299  if(irregularArc == 0) continue;
300  // the arc exists, so add it to the list
301  outSources.push_back(Tilewire(tileIndex, sourceWireIndex));
302  }
303  }
304 
305  // add the routethrough sinks
306  if(inUseRoutethrough) {
307  const WireArray& routethroughSources = wireInfo.getRoutethroughSources();
308  WireArray::const_iterator rsp = routethroughSources.begin();
309  WireArray::const_iterator rse = routethroughSources.end();
310  while(rsp < rse) outSources.push_back(Tilewire(tileIndex, *rsp++));
311  }
312  }
const const xilinx::WireIndex * const_iterator
Constant T iterator type.
Definition: Array.hpp:83
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
xilinx::TileIndex TileIndex
Imported type name.
Definition: DDB.hpp:49
ostream & mErr(void)
Returns the database console error stream.
const Array< const WireInfo > & getWireInfo(TileTypeIndex inTileTypeIndex) const
Returns the WireInfo array for the specified tile type.
Definition: Tiles.hpp:140
xilinx::WireIndex WireIndex
Imported type name.
Definition: DDB.hpp:48
const Segments::IrregularArc * getIrregularArc(TileIndex inTileIndex, WireIndex inSourceWireIndex, WireIndex inSinkWireIndex)
Return a pointer to the requested IrregularArc, or 0 if the arc does not exist.
Definition: Segments.cpp:213
Segments mSegments
The device segment data.
Definition: DDB.hpp:68
const Segments::SegmentReference & getTilewireSegment(const Tilewire &inTilewire) const
Return the segment reference for the given tile and wire index.
Definition: Segments.hpp:182

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ArcUsage& torc::architecture::DDB::getArcUsage ( void  )
inline

Returns a constant reference to the design arc usage.

Definition at line 148 of file DDB.hpp.

148 { return mArcUsage; }
ArcUsage mArcUsage
The design arc usage.
Definition: DDB.hpp:74

+ Here is the caller graph for this function:

ostream& torc::architecture::DDBConsoleStreams::getConsoleErr ( void  )
inlineinherited

Returns the database console error stream.

Definition at line 69 of file DDBConsoleStreams.hpp.

69 { return mErr(); }
ostream & mErr(void)
Returns the database console error stream.

+ Here is the call graph for this function:

istream& torc::architecture::DDBConsoleStreams::getConsoleIn ( void  )
inlineinherited

Returns the database console input stream.

Definition at line 65 of file DDBConsoleStreams.hpp.

65 { return mIn(); }
istream & mIn(void)
Returns the database console input stream.

+ Here is the call graph for this function:

ostream& torc::architecture::DDBConsoleStreams::getConsoleLog ( void  )
inlineinherited

Returns the database console log stream.

Definition at line 71 of file DDBConsoleStreams.hpp.

71 { return mLog(); }
ostream & mLog(void)
Returns the database console log stream.

+ Here is the call graph for this function:

ostream& torc::architecture::DDBConsoleStreams::getConsoleOut ( void  )
inlineinherited

Returns the database console output stream.

Definition at line 67 of file DDBConsoleStreams.hpp.

67 { return mOut(); }
ostream & mOut(void)
Returns the database console output stream.

+ Here is the call graph for this function:

const string& torc::architecture::DDB::getDeviceName ( void  ) const
inline

Returns the device name.

Definition at line 132 of file DDB.hpp.

132 { return mDeviceName; }
string mDeviceName
The name of the device.
Definition: DDB.hpp:54

+ Here is the caller graph for this function:

const boost::filesystem::path& torc::architecture::DDB::getDevicePath ( void  ) const
inline

Returns the device database path.

Definition at line 136 of file DDB.hpp.

136 { return mDevicePath; }
boost::filesystem::path mDevicePath
the device database path.
Definition: DDB.hpp:58
const string& torc::architecture::DDB::getFamilyName ( void  ) const
inline

Returns the family name.

Definition at line 134 of file DDB.hpp.

134 { return mFamilyName; }
string mFamilyName
The name of the family.
Definition: DDB.hpp:56

+ Here is the caller graph for this function:

const boost::filesystem::path& torc::architecture::DDB::getFamilyPath ( void  ) const
inline

Returns the family database path.

Definition at line 138 of file DDB.hpp.

138 { return mFamilyPath; }
boost::filesystem::path mFamilyPath
the family database path.
Definition: DDB.hpp:60
const Segments& torc::architecture::DDB::getSegments ( void  ) const
inline

Returns a constant reference to the device segment data.

Definition at line 142 of file DDB.hpp.

142 { return mSegments; }
Segments mSegments
The device segment data.
Definition: DDB.hpp:68
const Sites& torc::architecture::DDB::getSites ( void  ) const
inline

Returns a constant reference to the family and device site data.

Definition at line 144 of file DDB.hpp.

144 { return mSites; }
Sites mSites
The family and device site data.
Definition: DDB.hpp:70

+ Here is the caller graph for this function:

const StringVector& torc::architecture::DDB::getSpeedGrades ( void  ) const
inline

Returns a constant reference to a vector of speed grades.

Definition at line 140 of file DDB.hpp.

140 { return mSpeedGrades; }
StringVector mSpeedGrades
The supported speed grades.
Definition: DDB.hpp:66

+ Here is the caller graph for this function:

const Tiles& torc::architecture::DDB::getTiles ( void  ) const
inline

Returns a constant reference to the family and device tile data.

Definition at line 146 of file DDB.hpp.

146 { return mTiles; }
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72

+ Here is the caller graph for this function:

WireUsage& torc::architecture::DDB::getWireUsage ( void  )
inline

Returns a constant reference to the design wire usage.

Definition at line 150 of file DDB.hpp.

150 { return mWireUsage; }
WireUsage mWireUsage
The design wire usage.
Definition: DDB.hpp:76
void torc::architecture::DDB::initialize ( const string inDeviceName,
const string inPackageName 
)
protected

Initializes the database.

Definition at line 31 of file DDB.cpp.

31  {
32 
33  // pull in symbols from other namespaces
34  using std::string;
35 // using std::cout;
36 // using std::cerr;
37 // using std::clog;
38  using std::endl;
39  using std::fstream;
40  using boost::uint32_t;
41 
42  try {
43 
44  // track statistics
45  uint32_t familyDatabaseBytesRead = 0;
46  uint32_t deviceDatabaseBytesRead = 0;
47 
48  // open the device database
49  mDeviceName = inDeviceName;
50  string deviceFilename = inDeviceName + ".db";
51  boost::to_lower(deviceFilename);
53  mLog() << "Reading device " << inDeviceName << " (" << mDevicePath << ")..." << endl;
54  DigestStream deviceDatabaseStream(mDevicePath);
55  deviceDatabaseStream.exceptions(fstream::eofbit | fstream::failbit | fstream::badbit);
56  deviceDatabaseBytesRead += mDeviceVersion.readVersions(deviceDatabaseStream, true);
57  deviceDatabaseBytesRead += readFamilyName(deviceDatabaseStream);
58 
59  // open the family database
60  mFamilyPath = mDevicePath.parent_path() / (mFamilyName + ".db");
61  mOut() << "\tReading family " << mFamilyName << " (" << mFamilyPath << ")..." << endl;
62  DigestStream familyDatabaseStream(mFamilyPath);
63  familyDatabaseStream.exceptions(fstream::eofbit | fstream::failbit | fstream::badbit);
64 
65  // populate the database from family and device data
66  familyDatabaseBytesRead += mFamilyVersion.readVersions(familyDatabaseStream, false);
67  familyDatabaseBytesRead += mTiles.readTileTypes(familyDatabaseStream);
68  familyDatabaseBytesRead += mTiles.readTileWireInfo(familyDatabaseStream);
69  deviceDatabaseBytesRead += readSpeedGrades(deviceDatabaseStream);
70  deviceDatabaseBytesRead += mSites.readPackages(deviceDatabaseStream);
71  deviceDatabaseBytesRead += mTiles.readTileMap(deviceDatabaseStream);
72  deviceDatabaseBytesRead += mSegments.readTilewireSegments(deviceDatabaseStream);
73  bool extendedAnchorTileCount
75  deviceDatabaseBytesRead
76  += mSegments.readSegments(deviceDatabaseStream, extendedAnchorTileCount);
77  deviceDatabaseBytesRead += mSegments.readIrregularArcs(deviceDatabaseStream);
78  familyDatabaseBytesRead += mSites.readPrimitiveTypes(familyDatabaseStream);
79  familyDatabaseBytesRead += mSites.readPrimitivePinMaps(familyDatabaseStream);
80  deviceDatabaseBytesRead += mSites.readSites(deviceDatabaseStream);
81  mOut() << "Read " << familyDatabaseBytesRead << " bytes from " << mFamilyName << endl;
82  mOut() << "Read " << deviceDatabaseBytesRead << " bytes from " << mDeviceName << endl;
83  // automatically size the wire and arc usage objects
86 
87  // activate the specified package if any
88  if(inPackageName.length()) mSites.activatePackage(inPackageName);
89  }
90 
91  catch(fstream::failure f) {
92  mErr() << "An unprocessed ifstream::failure exception was thrown: " << f.what() << endl;
93  throw;
94  }
95 
96  }
static const boost::filesystem::path & getDevicesPath(void)
Returns the absolute path to the family and device database directory.
string mDeviceName
The name of the device.
Definition: DDB.hpp:54
void autosize(void)
Size the wire usage according to the number of device tiles.
Definition: ArcUsage.hpp:120
size_t readVersions(DigestStream &inStream, bool inShowVersion=false)
Read the version information.
Definition: Versions.cpp:25
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
void activatePackage(const string &inName)
Activate the specified device package.
Definition: Sites.hpp:92
boost::filesystem::path mDevicePath
the device database path.
Definition: DDB.hpp:58
size_t readTileWireInfo(DigestStream &inStream)
Read the family wire info.
Definition: Tiles.cpp:58
ostream & mErr(void)
Returns the database console error stream.
size_t readTileTypes(DigestStream &inStream)
Read the family tile types.
Definition: Tiles.cpp:25
size_t readIrregularArcs(DigestStream &inStream)
Read the irregular arcs for the device.
Definition: Segments.cpp:173
std::string string
size_t readFamilyName(class DigestStream &inStream)
Reads the family name from a device DigestStream.
Definition: DDB.cpp:98
string mFamilyName
The name of the family.
Definition: DDB.hpp:56
size_t readPrimitivePinMaps(DigestStream &inStream)
Read the site pin mappings for the family.
Definition: Sites.cpp:267
ArcUsage mArcUsage
The design arc usage.
Definition: DDB.hpp:74
ostream & mOut(void)
Returns the database console output stream.
ostream & mLog(void)
Returns the database console log stream.
Encapsulation of dotted decimal DottedVersion numbers.
boost::filesystem::path mFamilyPath
the family database path.
Definition: DDB.hpp:60
Segments mSegments
The device segment data.
Definition: DDB.hpp:68
size_t readPackages(DigestStream &inStream)
Read the packages for the device.
Definition: Sites.cpp:25
Sites mSites
The family and device site data.
Definition: DDB.hpp:70
size_t readTileMap(DigestStream &inStream)
Read the device tile map.
Definition: Tiles.cpp:226
size_t readTilewireSegments(DigestStream &inStream)
Read the segment entries for every tile.
Definition: Segments.cpp:32
size_t readPrimitiveTypes(DigestStream &inStream)
Read the primitive types for the family.
Definition: Sites.cpp:90
WireUsage mWireUsage
The design wire usage.
Definition: DDB.hpp:76
void autosize(void)
Size the wire usage according to the number of device tiles.
Definition: WireUsage.hpp:68
size_t readSpeedGrades(class DigestStream &inStream)
Reads the supported speed grades from a device DigestStream.
Definition: DDB.cpp:121
size_t readSegments(DigestStream &inStream, bool inExtendedAnchorTileCount)
Read the compact segments for the device.
Definition: Segments.cpp:89
Versions mFamilyVersion
The family database version.
Definition: DDB.hpp:64
const DottedVersion & getFormat(void) const
Returns the database format version.
Definition: Versions.hpp:70
size_t readSites(DigestStream &inStream)
Read the sites for the device.
Definition: Sites.cpp:305
Versions mDeviceVersion
The device database version.
Definition: DDB.hpp:62

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Tilewire torc::architecture::DDB::lookupTilewire ( const std::string &  inTileName,
const std::string &  inWireName 
)
inline

Returns the tilewire for the specified tile and wire names.

Todo:
Add to unit tests.

Definition at line 257 of file DDB.hpp.

257  {
258  TileIndex tileIndex = mTiles.findTileIndex(inTileName);
259  if(tileIndex.isUndefined()) return Tilewire::sInvalid;
260  const TileInfo& tileInfo = mTiles.getTileInfo(tileIndex);
261  TileTypeIndex tileTypeIndex = tileInfo.getTypeIndex();
262  WireIndex wireIndex = mTiles.findWireIndex(tileTypeIndex, inWireName);
263  if(wireIndex.isUndefined()) return Tilewire::sInvalid;
264  return Tilewire(tileIndex, wireIndex);
265  }
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
xilinx::TileIndex TileIndex
Imported type name.
Definition: DDB.hpp:49
xilinx::TileTypeIndex TileTypeIndex
Imported type name.
Definition: DDB.hpp:51
xilinx::WireIndex WireIndex
Imported type name.
Definition: DDB.hpp:48
TileIndex findTileIndex(const string &inName) const
Returns the tile index for the given tile name.
Definition: Tiles.hpp:170
WireIndex findWireIndex(TileTypeIndex inTileTypeIndex, const string &inName) const
Returns the wire index for the given wire name in the given tile type.
Definition: Tiles.hpp:182
static const Tilewire sInvalid
Definition: Tilewire.hpp:93

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ostream& torc::architecture::DDBConsoleStreams::mErr ( void  )
inlineinherited

Returns the database console error stream.

Definition at line 61 of file DDBConsoleStreams.hpp.

+ Here is the caller graph for this function:

istream& torc::architecture::DDBConsoleStreams::mIn ( void  )
inlineinherited

Returns the database console input stream.

Definition at line 57 of file DDBConsoleStreams.hpp.

57 { return *mInPtr; }
istream * mInPtr
Pointer to the database console input stream.

+ Here is the caller graph for this function:

ostream& torc::architecture::DDBConsoleStreams::mLog ( void  )
inlineinherited

Returns the database console log stream.

Definition at line 63 of file DDBConsoleStreams.hpp.

+ Here is the caller graph for this function:

ostream& torc::architecture::DDBConsoleStreams::mOut ( void  )
inlineinherited

Returns the database console output stream.

Definition at line 59 of file DDBConsoleStreams.hpp.

+ Here is the caller graph for this function:

torc::architecture::DDB::mWireUsage ( mTiles  )
inline

Definition at line 104 of file DDB.hpp.

105  { setConsoleStreams(inDDBConsoleStreams); initialize(inDeviceName, string()); }
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
ArcUsage mArcUsage
The design arc usage.
Definition: DDB.hpp:74
virtual void setConsoleStreams(DDBConsoleStreams inConsoleStreams)
Sets all of the database console streams.
Definition: DDB.hpp:152
void initialize(const string &inDeviceName, const string &inPackageName)
Initializes the database.
Definition: DDB.cpp:31
WireUsage mWireUsage
The design wire usage.
Definition: DDB.hpp:76

+ Here is the call graph for this function:

size_t torc::architecture::DDB::readFamilyName ( class DigestStream inStream)
protected

Reads the family name from a device DigestStream.

Todo:
Throw a proper exception.

Definition at line 98 of file DDB.cpp.

98  {
99  // prepare to read from the stream
100  size_t bytesReadOffset = inStream.getBytesRead();
101  char scratch[1 << 10]; // scratch read buffer
102  boost::uint16_t nameLength = 0; // length of family name
103 
104  // read the section header
105  string sectionName;
106  inStream.readSectionHeader(sectionName);
107  /// \todo Throw a proper exception.
108  if(sectionName != ">>>> Family >>>>") throw -1;
109 
110  // read the family name
111  inStream.read(nameLength);
112  if(nameLength > sizeof(scratch)) throw -1;
113  inStream.read(scratch, nameLength);
114  scratch[nameLength] = 0;
115  mFamilyName = scratch;
116 
117  // return the number of bytes read
118  return inStream.getBytesRead() - bytesReadOffset;
119  }
string mFamilyName
The name of the family.
Definition: DDB.hpp:56

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t torc::architecture::DDB::readSpeedGrades ( class DigestStream inStream)
protected

Reads the supported speed grades from a device DigestStream.

Todo:
Throw a proper exception.

Definition at line 121 of file DDB.cpp.

121  {
122  // prepare to read from the stream
123  size_t bytesReadOffset = inStream.getBytesRead();
124  char scratch[1 << 10]; // scratch read buffer
125  uint16_t nameLength = 0; // length of family name
126 
127  // read the section header
128  string sectionName;
129  inStream.readSectionHeader(sectionName);
130  /// \todo Throw a proper exception.
131  if(sectionName != ">>>> Speeds >>>>") throw -1;
132 
133  // read the speed grade count
134  uint16_t speedGradeCount;
135  inStream.read(speedGradeCount);
136  mOut() << "\tReading " << speedGradeCount << " speed grade"
137  << (speedGradeCount != 1 ? "s" : "") << " (";
138  // loop through each speed grade
139  for(uint16_t i = 0; i < speedGradeCount; i++) {
140  // read the speed grade
141  inStream.read(nameLength);
142  if(nameLength > sizeof(scratch)) throw -1;
143  inStream.read(scratch, nameLength);
144  scratch[nameLength] = 0;
145  mSpeedGrades.push_back(scratch);
146  mOut() << scratch << (i + 1 < speedGradeCount ? ", " : "");
147  }
148  mOut() << ") ... " << std::endl;
149 
150  // return the number of bytes read
151  return inStream.getBytesRead() - bytesReadOffset;
152  }
ostream & mOut(void)
Returns the database console output stream.
StringVector mSpeedGrades
The supported speed grades.
Definition: DDB.hpp:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDB::releaseArc ( const Arc inArc,
bool  releaseSource = true,
bool  releaseSink = true 
)
inline

Marks the arc and all of its source and sink segment wires as unused.

Definition at line 179 of file DDB.hpp.

179  {
180  mArcUsage.release(inArc);
181  if(releaseSource) releaseSegment(inArc.getSourceTilewire());
182  if(releaseSink) releaseSegment(inArc.getSinkTilewire());
183  }
void releaseSegment(const Tilewire &inTilewire)
Marks all wires on the segment as unused.
Definition: DDB.hpp:193
ArcUsage mArcUsage
The design arc usage.
Definition: DDB.hpp:74
void release(const Arc &inArc)
Marks the specified arc as being unused.
Definition: ArcUsage.hpp:169

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDB::releaseSegment ( const Tilewire inTilewire)
inline

Marks all wires on the segment as unused.

Definition at line 193 of file DDB.hpp.

193  {
194  TilewireVector segment;
195  expandSegment(inTilewire, segment);
196  TilewireVector::const_iterator p = segment.begin();
197  TilewireVector::const_iterator e = segment.end();
198  while(p < e) mWireUsage.release(*p++);
199  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
void release(const Tilewire &inTilewire)
Marks the specified tilewire as being unused.
Definition: WireUsage.hpp:104
WireUsage mWireUsage
The design wire usage.
Definition: DDB.hpp:76
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDBConsoleStreams::setConsoleErr ( ostream inStream)
inlineinherited

Sets the database console error stream.

Definition at line 77 of file DDBConsoleStreams.hpp.

77 { mErrPtr = &inStream; }

+ Here is the caller graph for this function:

void torc::architecture::DDBConsoleStreams::setConsoleIn ( istream inStream)
inlineinherited

Sets the database console input stream.

Definition at line 73 of file DDBConsoleStreams.hpp.

73 { mInPtr = &inStream; }
istream * mInPtr
Pointer to the database console input stream.

+ Here is the caller graph for this function:

void torc::architecture::DDBConsoleStreams::setConsoleLog ( ostream inStream)
inlineinherited

Sets the database console log stream.

Definition at line 79 of file DDBConsoleStreams.hpp.

79 { mLogPtr = &inStream; }

+ Here is the caller graph for this function:

void torc::architecture::DDBConsoleStreams::setConsoleOut ( ostream inStream)
inlineinherited

Sets the database console output stream.

Definition at line 75 of file DDBConsoleStreams.hpp.

75 { mOutPtr = &inStream; }

+ Here is the caller graph for this function:

virtual void torc::architecture::DDB::setConsoleStreams ( DDBConsoleStreams  inConsoleStreams)
inlinevirtual

Sets all of the database console streams.

Definition at line 152 of file DDB.hpp.

152  {
153  setConsoleStreams(inConsoleStreams.mIn(), inConsoleStreams.mOut(),
154  inConsoleStreams.mErr(), inConsoleStreams.mLog());
155  }
virtual void setConsoleStreams(DDBConsoleStreams inConsoleStreams)
Sets all of the database console streams.
Definition: DDB.hpp:152

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void torc::architecture::DDB::setConsoleStreams ( istream inIn,
ostream inOut,
ostream inErr,
ostream inLog 
)
inlinevirtual

Sets all of the database console streams.

Reimplemented from torc::architecture::DDBConsoleStreams.

Definition at line 157 of file DDB.hpp.

158  {
159  DDBConsoleStreams::setConsoleStreams(inIn, inOut, inErr, inLog);
160  mSegments.setConsoleStreams(inIn, inOut, inErr, inLog);
161  mSites.setConsoleStreams(inIn, inOut, inErr, inLog);
162  mTiles.setConsoleStreams(inIn, inOut, inErr, inLog);
163  mDeviceVersion.setConsoleStreams(inIn, inOut, inErr, inLog);
164  mFamilyVersion.setConsoleStreams(inIn, inOut, inErr, inLog);
165  }
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
Segments mSegments
The device segment data.
Definition: DDB.hpp:68
Sites mSites
The family and device site data.
Definition: DDB.hpp:70
virtual void setConsoleStreams(istream &inIn, ostream &inOut, ostream &inErr, ostream &inLog)
Sets all of the database console streams.
Versions mFamilyVersion
The family database version.
Definition: DDB.hpp:64
Versions mDeviceVersion
The device database version.
Definition: DDB.hpp:62

+ Here is the call graph for this function:

Tilewire torc::architecture::DDB::sitePinToTilewire ( const std::string &  inSiteName,
const std::string &  inPinName 
)
inline

Returns the tilewire for the specified site and pin name pair.

Definition at line 236 of file DDB.hpp.

237  {
238  SiteIndex siteIndex = mSites.findSiteIndex(inSiteName);
239  if(siteIndex.isUndefined()) return Tilewire::sInvalid;
240  return mSites.getSite(siteIndex).getPinTilewire(inPinName);
241  }
xilinx::SiteIndex SiteIndex
Imported type name.
Definition: DDB.hpp:47
const Tilewire getPinTilewire(const std::string &inName) const
Returns the Tilewire associated with the specified pin name.
Definition: Site.hpp:70
SiteIndex findSiteIndex(const string &inName) const
Returns the site index for the given site name.
Definition: Sites.hpp:134
const Site & getSite(SiteIndex inSiteIndex) const
Returns the site for the specified index.
Definition: Sites.hpp:129
static const Tilewire sInvalid
Definition: Tilewire.hpp:93
Sites mSites
The family and device site data.
Definition: DDB.hpp:70

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Arc torc::architecture::DDB::tilePipToArc ( const std::string &  inTileName,
const std::string &  inSourceWireName,
const std::string &  inSinkWireName 
)
inline

Returns the arc for the specified pip tile and wires.

Definition at line 243 of file DDB.hpp.

244  {
245  TileIndex tileIndex = mTiles.findTileIndex(inTileName);
246  if(tileIndex.isUndefined()) return Arc();
247  const TileInfo& tileInfo = mTiles.getTileInfo(tileIndex);
248  TileTypeIndex tileTypeIndex = tileInfo.getTypeIndex();
249  WireIndex sourceWireIndex = mTiles.findWireIndex(tileTypeIndex, inSourceWireName);
250  if(sourceWireIndex.isUndefined()) return Arc();
251  WireIndex sinkWireIndex = mTiles.findWireIndex(tileTypeIndex, inSinkWireName);
252  if(sinkWireIndex.isUndefined()) return Arc();
253  return Arc(Tilewire(tileIndex, sourceWireIndex), Tilewire(tileIndex, sinkWireIndex));
254  }
Tiles mTiles
The family and device tile data.
Definition: DDB.hpp:72
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
xilinx::TileIndex TileIndex
Imported type name.
Definition: DDB.hpp:49
xilinx::TileTypeIndex TileTypeIndex
Imported type name.
Definition: DDB.hpp:51
xilinx::WireIndex WireIndex
Imported type name.
Definition: DDB.hpp:48
TileIndex findTileIndex(const string &inName) const
Returns the tile index for the given tile name.
Definition: Tiles.hpp:170
WireIndex findWireIndex(TileTypeIndex inTileTypeIndex, const string &inName) const
Returns the wire index for the given wire name in the given tile type.
Definition: Tiles.hpp:182

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDB::useArc ( const Arc inArc)
inline

Marks the arc and all of its source and sink segment wires as used.

Definition at line 173 of file DDB.hpp.

173  {
174  mArcUsage.use(inArc);
175  useSegment(inArc.getSourceTilewire());
176  useSegment(inArc.getSinkTilewire());
177  }
void use(const Arc &inArc)
Marks the specified arc as being used.
Definition: ArcUsage.hpp:133
ArcUsage mArcUsage
The design arc usage.
Definition: DDB.hpp:74
void useSegment(const Tilewire &inTilewire)
Marks all wires on the segment as used.
Definition: DDB.hpp:185

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::architecture::DDB::useSegment ( const Tilewire inTilewire)
inline

Marks all wires on the segment as used.

Definition at line 185 of file DDB.hpp.

185  {
186  TilewireVector segment;
187  expandSegment(inTilewire, segment);
188  TilewireVector::const_iterator p = segment.begin();
189  TilewireVector::const_iterator e = segment.end();
190  while(p < e) mWireUsage.use(*p++);
191  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
void use(const Tilewire &inTilewire)
Marks the specified tilewire as being used.
Definition: WireUsage.hpp:81
WireUsage mWireUsage
The design wire usage.
Definition: DDB.hpp:76
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

torc::architecture::DDB::__pad0__

Public constructor.

Parameters
inDeviceNameThe name of the device to open. This name should not include any package or speed grade information, nor any extension. Examples are xc2vp100, xc4vfx60, xc5vlx30, et cetera.
inDDBConsoleStreamsThe console streams that the database should use.

Definition at line 104 of file DDB.hpp.

ArcUsage torc::architecture::DDB::mArcUsage
protected

The design arc usage.

Definition at line 74 of file DDB.hpp.

string torc::architecture::DDB::mDeviceName
protected

The name of the device.

Definition at line 54 of file DDB.hpp.

boost::filesystem::path torc::architecture::DDB::mDevicePath
protected

the device database path.

Definition at line 58 of file DDB.hpp.

Versions torc::architecture::DDB::mDeviceVersion
protected

The device database version.

Definition at line 62 of file DDB.hpp.

ostream* torc::architecture::DDBConsoleStreams::mErrPtr
protectedinherited

Definition at line 96 of file DDBConsoleStreams.hpp.

string torc::architecture::DDB::mFamilyName
protected

The name of the family.

Definition at line 56 of file DDB.hpp.

boost::filesystem::path torc::architecture::DDB::mFamilyPath
protected

the family database path.

Definition at line 60 of file DDB.hpp.

Versions torc::architecture::DDB::mFamilyVersion
protected

The family database version.

Definition at line 64 of file DDB.hpp.

istream* torc::architecture::DDBConsoleStreams::mInPtr
protectedinherited

Pointer to the database console input stream.

Definition at line 94 of file DDBConsoleStreams.hpp.

ostream* torc::architecture::DDBConsoleStreams::mLogPtr
protectedinherited

Definition at line 97 of file DDBConsoleStreams.hpp.

ostream* torc::architecture::DDBConsoleStreams::mOutPtr
protectedinherited

Definition at line 95 of file DDBConsoleStreams.hpp.

Segments torc::architecture::DDB::mSegments
protected

The device segment data.

Definition at line 68 of file DDB.hpp.

Sites torc::architecture::DDB::mSites
protected

The family and device site data.

Definition at line 70 of file DDB.hpp.

StringVector torc::architecture::DDB::mSpeedGrades
protected

The supported speed grades.

Definition at line 66 of file DDB.hpp.

Tiles torc::architecture::DDB::mTiles
protected

The family and device tile data.

Definition at line 72 of file DDB.hpp.

WireUsage torc::architecture::DDB::mWireUsage
protected

The design wire usage.

Definition at line 76 of file DDB.hpp.

DDBConsoleStreams torc::architecture::DDBConsoleStreams::sDefaultConsoleStreams
staticinherited

Definition at line 45 of file DDBConsoleStreams.hpp.

DDBConsoleStreams torc::architecture::DDBConsoleStreams::sNullConsoleStreams
staticinherited

Definition at line 46 of file DDBConsoleStreams.hpp.


The documentation for this class was generated from the following files: