torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XilinxDatabaseTypesUnitTest.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 Unit test for Xilinx device database types.
18 
19 #include <boost/test/unit_test.hpp>
21 
22 namespace torc {
23 
24 using namespace torc::architecture::xilinx;
25 
26 BOOST_AUTO_TEST_SUITE(architecture)
27 
28 /// \brief Unit test for device database type sizes.
29 BOOST_AUTO_TEST_CASE(XilinxDatabaseTypesUnitTest) {
30  // verify the sizes of device database types
31  // wires
32  BOOST_CHECK_EQUAL((size_t) 2, sizeof(WireCount));
33  BOOST_CHECK_EQUAL((size_t) 2, sizeof(WireIndex));
34  BOOST_CHECK_EQUAL((size_t) 2, sizeof(WireFlags));
35  // tiles
36  BOOST_CHECK_EQUAL((size_t) 4, sizeof(TileCount));
37  BOOST_CHECK_EQUAL((size_t) 4, sizeof(TileIndex));
38  BOOST_CHECK_EQUAL((size_t) 4, sizeof(TileOffset));
39  BOOST_CHECK_EQUAL((size_t) 2, sizeof(TileRow));
40  BOOST_CHECK_EQUAL((size_t) 2, sizeof(TileCol));
41  // tile types
42  BOOST_CHECK_EQUAL((size_t) 2, sizeof(TileTypeCount));
43  BOOST_CHECK_EQUAL((size_t) 2, sizeof(TileTypeIndex));
44  // compact segments
45  BOOST_CHECK_EQUAL((size_t) 4, sizeof(CompactSegmentCount));
46  BOOST_CHECK_EQUAL((size_t) 4, sizeof(CompactSegmentIndex));
47  // sites
48  BOOST_CHECK_EQUAL((size_t) 4, sizeof(SiteCount));
49  BOOST_CHECK_EQUAL((size_t) 4, sizeof(SiteIndex));
50  BOOST_CHECK_EQUAL((size_t) 2, sizeof(SiteFlags));
51  // site types
52  BOOST_CHECK_EQUAL((size_t) 2, sizeof(SiteTypeCount));
53  BOOST_CHECK_EQUAL((size_t) 2, sizeof(SiteTypeIndex));
54  // pins
55  BOOST_CHECK_EQUAL((size_t) 4, sizeof(PinCount));
56  BOOST_CHECK_EQUAL((size_t) 4, sizeof(PinIndex));
57  BOOST_CHECK_EQUAL((size_t) 2, sizeof(PinFlags));
58 }
59 
60 BOOST_AUTO_TEST_SUITE_END()
61 
62 } // namespace torc
Encapsulation of a tile index in an unsigned 32-bit integer.
Encapsulation of a tile row in an unsigned 16-bit integer.
Encapsulation of a tile column in an unsigned 16-bit integer.
Encapsulation of a compact segment count in an unsigned 32-bit integer.
Encapsulation of a pin count in an unsigned 32-bit integer.
Encapsulation of wire attribute flags in an unsigned 16-bit integer.
Encapsulation of a site count in an unsigned 32-bit integer.
Encapsulation of a pin index in an unsigned 32-bit integer.
Encapsulation of a wire index in an unsigned 16-bit integer.
BOOST_AUTO_TEST_CASE(TilewireUnitTest)
Unit test for the Tilewire class.
Encapsulation of a tile offset in an unsigned 32-bit integer.
Encapsulation of a site type index in an unsigned 16-bit integer.
Encapsulation of a wire count in an unsigned 16-bit integer.
Encapsulation of a tile count in an unsigned 32-bit integer.
Encapsulation of pin attribute flags in an unsigned 16-bit integer.
Encapsulation of a compact segment index in an unsigned 32-bit integer.
Encapsulation of a site type count in an unsigned 16-bit integer.
Encapsulation of site attribute flags in an unsigned 16-bit integer.
Encapsulation of a tile type count in an unsigned 16-bit integer.
Encapsulation of a site index in an unsigned 32-bit integer.
Encapsulation of a tile type index in an unsigned 16-bit integer.
Device database types for Xilinx architectures.