19 #include <boost/test/unit_test.hpp>
24 namespace architecture {
26 BOOST_AUTO_TEST_SUITE(architecture)
28 using namespace torc::architecture::xilinx;
38 Arc arc1(tilewire1, tilewire2);
39 uint32_t virtexCenterArcCount = 1511u;
71 BOOST_CHECK_EQUAL(arcUsage.
isUsed(arc1),
false);
73 BOOST_CHECK_EQUAL(arcUsage.
isUsed(arc1),
true);
76 BOOST_CHECK_EQUAL(arcUsage.
getBitCount(), virtexCenterArcCount);
78 BOOST_CHECK_EQUAL(arcUsage.
isUsed(arc1),
false);
81 BOOST_CHECK_EQUAL(arcUsage.
getBitCount(), virtexCenterArcCount);
87 bool threwInvalidArcException =
false;
93 threwInvalidArcException =
true;
95 BOOST_CHECK_EQUAL(threwInvalidArcException,
true);
96 threwInvalidArcException =
false;
102 threwInvalidArcException =
true;
104 BOOST_CHECK_EQUAL(threwInvalidArcException,
false);
105 threwInvalidArcException =
false;
111 threwInvalidArcException =
true;
113 BOOST_CHECK_EQUAL(threwInvalidArcException,
true);
121 BOOST_CHECK_EQUAL(arcUsage.
getBitCount(), virtexCenterArcCount);
126 arcUsagePtr->autosize();
127 arcUsagePtr->use(arc1);
128 arcUsagePtr->~ArcUsage();
129 uint32_t bitsetsAfterDestruction = 0;
130 for(uint32_t i = 0; i < arcUsagePtr->mBitsets.getSize(); i++) {
131 bitsetsAfterDestruction += (arcUsagePtr->mBitsets[i] != 0);
133 BOOST_CHECK_EQUAL(bitsetsAfterDestruction, 0u);
136 BOOST_AUTO_TEST_SUITE_END()
Encapsulation of an arc between two tilewires.
void autosize(void)
Size the wire usage according to the number of device tiles.
void clear(void)
Marks all arcs as being unused, without releasing the bitset objects.
Device database, including complete wiring and logic support.
BOOST_AUTO_TEST_CASE(ArcUnitTest)
Unit test for the Arc class.
Array< dynamic_bitset * > mBitsets
The wire usage bitset array.
TileCount getTileUsageCount(void) const
Returns the number of tiles that have been touched.
const Tiles & getTiles(void) const
Returns a constant reference to the family and device tile data.
uint32_t getArcUsageCount(void) const
Returns the number of arcs in use.
uint32_t getArcOffset(const Tilewire &inTilewire1, const Tilewire &inTilewire2) const
Returns the offset into the bitset for the specified arc.
Encapsulation of a wire index in an unsigned 16-bit integer.
uint32_t getBitCount(void) const
Returns the number of bits allocated.
void use(const Arc &inArc)
Marks the specified arc as being used.
Encapsulation of a device tile and wire pair.
Encapsulation the design arc usage.
Tile map, tile type, and wire information for the family and device.
Encapsulation of a tile count in an unsigned 32-bit integer.
Header for the ArcUsage class.
Tilewire lookupTilewire(const std::string &inTileName, const std::string &inWireName)
Returns the tilewire for the specified tile and wire names.
Header for the DDB class.
const TileIndex & getTileIndex(void) const
Returns the tile index.
void release(const Arc &inArc)
Marks the specified arc as being unused.
bool isUsed(const Arc &inArc)
Determines whether the specified arc is in use.
uint32_t getSize(void) const
Returns the array size.