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

Regression test class for segments consistency across all devices. More...

+ Collaboration diagram for torc::architecture::segments_regression_test_helper:

Public Member Functions

 segments_regression_test_helper (DDB &inDDB)
 Basic constructor. More...
 
void operator() (void)
 Analyze segment expansion, and detect any tilewire conflicts. More...
 
void analyzeSegmentTilewire (const Tilewire &inTilewire)
 Verifies and enforces segment ownership of the specified tilewire. More...
 

Static Public Member Functions

static void statistics (void)
 Outputs statistics on segment expansion. More...
 

Private Types

typedef xilinx::TileCount TileCount
 
typedef xilinx::TileIndex TileIndex
 
typedef xilinx::TileTypeIndex TileTypeIndex
 
typedef xilinx::WireCount WireCount
 
typedef xilinx::WireIndex WireIndex
 
typedef Segments::SegmentReference SegmentReference
 
typedef xilinx::CompactSegmentIndex CompactSegmentIndex
 
typedef boost::uint64_t uint64_t
 

Private Attributes

DDBmDDB
 
const TilesmTiles
 
const SegmentsmSegments
 
std::map< Tilewire,
CompactSegmentIndex
mUsage
 
const CompactSegmentIndex cUsagePruned
 
const CompactSegmentIndex cUsageUndefined
 
uint64_t mTilewireCount
 
uint64_t mTilewiresAnalyzed
 
uint64_t mTilewiresPruned
 
uint64_t mTilewiresUndefined
 
uint64_t mTilewireMismatches
 

Static Private Attributes

static uint64_t sTotalTilewireCount = 0
 Total number of tilewires visited. More...
 
static uint64_t sTotalTilewiresAnalyzed = 0
 Total number of tilewires analyzed (visited or expanded). More...
 
static uint64_t sTotalTilewiresPruned = 0
 Total number of tilewires pruned from the device (absent from XDLRC). More...
 
static uint64_t sTotalTilewiresUndefined = 0
 Total number of tilewires never defined (sanity check). More...
 
static uint64_t sTotalTilewireMismatches = 0
 Total number of tilewire mismatches (more than one segment contending for one tilewire). More...
 

Detailed Description

Regression test class for segments consistency across all devices.

Definition at line 49 of file SegmentsRegressionTest.cpp.

Member Typedef Documentation

Definition at line 57 of file SegmentsRegressionTest.cpp.

Constructor & Destructor Documentation

torc::architecture::segments_regression_test_helper::segments_regression_test_helper ( DDB inDDB)
inline

Basic constructor.

Definition at line 76 of file SegmentsRegressionTest.cpp.

76  : mDDB(inDDB), mTiles(mDDB.getTiles()),
79  cUsageUndefined(CompactSegmentIndex(static_cast<boost::uint32_t>(-2))), mTilewireCount(0),
81  // functions tested during database initialization and deletion:
82  // Segments(void);
83  // size_t readTilewireSegments(DigestStream& inStream);
84  // size_t readSegments(DigestStream& inStream);
85  // size_t readIrregularArcs(DigestStream& inStream);
86  }
const Tiles & getTiles(void) const
Returns a constant reference to the family and device tile data.
Definition: DDB.hpp:146
const Segments & getSegments(void) const
Returns a constant reference to the device segment data.
Definition: DDB.hpp:142

Member Function Documentation

void torc::architecture::segments_regression_test_helper::analyzeSegmentTilewire ( const Tilewire inTilewire)
inline

Verifies and enforces segment ownership of the specified tilewire.

Definition at line 176 of file SegmentsRegressionTest.cpp.

176  {
178  // extract the tilewire information
179  TileIndex tileIndex = inTilewire.getTileIndex();
180  WireIndex wireIndex = inTilewire.getWireIndex();
181  const Array<SegmentReference>& tilewireSegments = mSegments.mTilewireSegments[tileIndex];
182  // look up the segment reference information
183  const SegmentReference& segmentReference = tilewireSegments[wireIndex];
184  CompactSegmentIndex compactSegmentIndex = segmentReference.getCompactSegmentIndex();
185  TileIndex anchorTileIndex = segmentReference.getAnchorTileIndex();
186  (void) anchorTileIndex;
187  // look up the current tilewire membership
188  CompactSegmentIndex usageCompactSegmentIndex = mUsage[inTilewire];
189  if(compactSegmentIndex == usageCompactSegmentIndex) {
190  // there has been no change
191  //std::cerr << "Match: " << static_cast<int>(compactSegmentIndex) << " for "
192  // << inTilewire << std::endl;
193  } else if(usageCompactSegmentIndex == cUsageUndefined) {
194  // this wire was not previously defined, so we accept the new value
195  mUsage[inTilewire] = compactSegmentIndex;
196  //std::cerr << "Definition: " << static_cast<int>(compactSegmentIndex) << " for "
197  // << inTilewire << std::endl;
198  } else {
200  std::cerr << "Mismatch (" << static_cast<int>(compactSegmentIndex) << " vs. "
201  << static_cast<int>(usageCompactSegmentIndex) << ") for " << inTilewire
202  << std::endl;
203  BOOST_CHECK_EQUAL(static_cast<int>(compactSegmentIndex),
204  static_cast<int>(usageCompactSegmentIndex));
205  }
206  }
Array2D< SegmentReference > mTilewireSegments
The segment references for every wire in every tile.
Definition: Segments.hpp:119
std::map< Tilewire, CompactSegmentIndex > mUsage

+ Here is the call graph for this function:

void torc::architecture::segments_regression_test_helper::operator() ( void  )
inline

Analyze segment expansion, and detect any tilewire conflicts.

Definition at line 102 of file SegmentsRegressionTest.cpp.

102  {
103  TileCount tileCount = mTiles.getTileCount();
104  mUsage.clear();
105 
106  // members tested:
107  // Array2D<SegmentReference> mTilewireSegments;
108  // clear the usage information for all tilewires
109  for(TileIndex tileIndex; tileIndex < tileCount; tileIndex++) {
110  const Array<SegmentReference>& tilewireSegments
111  = mSegments.mTilewireSegments[tileIndex];
112  WireCount wireCount = WireCount(tilewireSegments.getSize());
113  for(WireIndex wireIndex; wireIndex < wireCount; wireIndex++) {
114  Tilewire tilewire(tileIndex, wireIndex);
115  mUsage[tilewire] = cUsageUndefined;
116  mTilewireCount++;
117  }
118  }
119  // iterate through all tilewires and look for any conflicting segment ownership
120  for(TileIndex tileIndex; tileIndex < tileCount; tileIndex++) {
121  const Array<SegmentReference>& tilewireSegments
122  = mSegments.mTilewireSegments[tileIndex];
123  WireCount wireCount = WireCount(tilewireSegments.getSize());
124  for(WireIndex wireIndex; wireIndex < wireCount; wireIndex++) {
125  Tilewire tilewire(tileIndex, wireIndex);
126  analyzeSegmentTilewire(tilewire);
127  TilewireVector segmentTilewires;
128  mDDB.expandSegment(tilewire, segmentTilewires, DDB::eExpandDirectionNone);
129  TilewireVector::const_iterator p = segmentTilewires.begin();
130  TilewireVector::const_iterator e = segmentTilewires.end();
131  while(p < e) {
133  }
134  }
135  }
136  // look for any tilewires without segment definitions
137  for(TileIndex tileIndex; tileIndex < tileCount; tileIndex++) {
138  const Array<SegmentReference>& tilewireSegments
139  = mSegments.mTilewireSegments[tileIndex];
140  WireCount wireCount = WireCount(tilewireSegments.getSize());
141  for(WireIndex wireIndex; wireIndex < wireCount; wireIndex++) {
142  Tilewire tilewire(tileIndex, wireIndex);
143  CompactSegmentIndex usage = mUsage[tilewire];
144  if(usage == cUsageUndefined) {
146  std::cerr << "Undefined: " << tilewire << std::endl;
147  BOOST_CHECK(mUsage[tilewire] != cUsageUndefined);
148  } else if(usage == cUsagePruned) {
150  }
151  }
152  }
153  std::cerr << "---------------------------------------" << std::endl;
154  std::cerr << "Tilewire count: " << std::setw(12) << mTilewireCount
155  << std::endl;
156  std::cerr << "Tilewires analyzed: " << std::setw(12) << mTilewiresAnalyzed
157  << std::endl;
158  std::cerr << "Tilewires pruned: " << std::setw(12) << mTilewiresPruned
159  << std::endl;
160  std::cerr << "Tilewires undefined: " << std::setw(12) << mTilewiresUndefined
161  << std::endl;
162  std::cerr << "Tilewire mismatches: " << std::setw(12) << mTilewireMismatches
163  << std::endl;
169 
170  // functions tested:
171  // uint32_t getTotalWireCount(void) const;
173  BOOST_CHECK(mTilewireMismatches == 0);
174  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
static uint64_t sTotalTilewireMismatches
Total number of tilewire mismatches (more than one segment contending for one tilewire).
void analyzeSegmentTilewire(const Tilewire &inTilewire)
Verifies and enforces segment ownership of the specified tilewire.
static uint64_t sTotalTilewiresPruned
Total number of tilewires pruned from the device (absent from XDLRC).
Array2D< SegmentReference > mTilewireSegments
The segment references for every wire in every tile.
Definition: Segments.hpp:119
static uint64_t sTotalTilewiresAnalyzed
Total number of tilewires analyzed (visited or expanded).
static uint64_t sTotalTilewiresUndefined
Total number of tilewires never defined (sanity check).
TileCount getTileCount(void) const
Returns the tile count for this device.
Definition: Tiles.hpp:149
static uint64_t sTotalTilewireCount
Total number of tilewires visited.
uint32_t getActualWireCount(void) const
Return the number of actual wires in the device (unpruned and non-trivial).
Definition: Segments.hpp:168
std::map< Tilewire, CompactSegmentIndex > mUsage
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:

static void torc::architecture::segments_regression_test_helper::statistics ( void  )
inlinestatic

Outputs statistics on segment expansion.

Definition at line 88 of file SegmentsRegressionTest.cpp.

88  {
89  std::cerr << "=======================================" << std::endl;
90  std::cerr << "Total tilewire count: " << std::setw(12) << sTotalTilewireCount
91  << std::endl;
92  std::cerr << "Total tilewires analyzed: " << std::setw(12) << sTotalTilewiresAnalyzed
93  << std::endl;
94  std::cerr << "Total tilewires pruned: " << std::setw(12) << sTotalTilewiresPruned
95  << std::endl;
96  std::cerr << "Total tilewires undefined: " << std::setw(12) << sTotalTilewiresUndefined
97  << std::endl;
98  std::cerr << "Total tilewire mismatches: " << std::setw(12) << sTotalTilewireMismatches
99  << std::endl;
100  }
static uint64_t sTotalTilewireMismatches
Total number of tilewire mismatches (more than one segment contending for one tilewire).
static uint64_t sTotalTilewiresPruned
Total number of tilewires pruned from the device (absent from XDLRC).
static uint64_t sTotalTilewiresAnalyzed
Total number of tilewires analyzed (visited or expanded).
static uint64_t sTotalTilewiresUndefined
Total number of tilewires never defined (sanity check).
static uint64_t sTotalTilewireCount
Total number of tilewires visited.

+ Here is the caller graph for this function:

Field Documentation

const CompactSegmentIndex torc::architecture::segments_regression_test_helper::cUsagePruned
private

Definition at line 62 of file SegmentsRegressionTest.cpp.

const CompactSegmentIndex torc::architecture::segments_regression_test_helper::cUsageUndefined
private

Definition at line 63 of file SegmentsRegressionTest.cpp.

DDB& torc::architecture::segments_regression_test_helper::mDDB
private

Definition at line 58 of file SegmentsRegressionTest.cpp.

const Segments& torc::architecture::segments_regression_test_helper::mSegments
private

Definition at line 60 of file SegmentsRegressionTest.cpp.

const Tiles& torc::architecture::segments_regression_test_helper::mTiles
private

Definition at line 59 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::mTilewireCount
private

Definition at line 64 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::mTilewireMismatches
private

Definition at line 68 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::mTilewiresAnalyzed
private

Definition at line 65 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::mTilewiresPruned
private

Definition at line 66 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::mTilewiresUndefined
private

Definition at line 67 of file SegmentsRegressionTest.cpp.

std::map<Tilewire, CompactSegmentIndex> torc::architecture::segments_regression_test_helper::mUsage
private

Definition at line 61 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::sTotalTilewireCount = 0
staticprivate

Total number of tilewires visited.

Definition at line 69 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::sTotalTilewireMismatches = 0
staticprivate

Total number of tilewire mismatches (more than one segment contending for one tilewire).

Definition at line 73 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::sTotalTilewiresAnalyzed = 0
staticprivate

Total number of tilewires analyzed (visited or expanded).

Definition at line 70 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::sTotalTilewiresPruned = 0
staticprivate

Total number of tilewires pruned from the device (absent from XDLRC).

Definition at line 71 of file SegmentsRegressionTest.cpp.

uint64_t torc::architecture::segments_regression_test_helper::sTotalTilewiresUndefined = 0
staticprivate

Total number of tilewires never defined (sanity check).

Definition at line 72 of file SegmentsRegressionTest.cpp.


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