torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DeviceInfoHelperUnitTest.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 the DeviceInfoHelper class.
18 
19 #include <boost/test/unit_test.hpp>
31 
32 namespace torc {
33 namespace bitstream {
34 
35 BOOST_AUTO_TEST_SUITE(bitstream)
36 
37 /// \brief Unit test for the DeviceInfoHelper class.
38 BOOST_AUTO_TEST_CASE(DeviceInfoHelperUnitTest) {
39 
40  BOOST_REQUIRE(true);
41 
42 }
43 
44 //#define GENERATE_STATIC_DEVICE_INFO
45 #ifdef GENERATE_STATIC_DEVICE_INFO
46 
47 /// \brief Unit test for the Spartan3E static device info generation.
48 BOOST_AUTO_TEST_CASE(Spartan3EGenerateUnitTest) {
49  Spartan3E bitstream;
50  DeviceInfoHelper::buildFamilyDeviceInfo("Spartan3E", "Spartan3EDeviceInfo.template",
51  "Spartan3EDeviceInfo.cpp", torc::common::Devices::getSpartan3EDevices(), bitstream);
52 }
53 
54 /// \brief Unit test for the Virtex static device info generation.
55 BOOST_AUTO_TEST_CASE(VirtexGenerateUnitTest) {
56  Virtex bitstream;
57  DeviceInfoHelper::buildFamilyDeviceInfo("Virtex", "VirtexDeviceInfo.template",
58  "VirtexDeviceInfo.cpp", torc::common::Devices::getVirtexDevices(), bitstream);
59 }
60 
61 /// \brief Unit test for the VirtexE static device info generation.
62 BOOST_AUTO_TEST_CASE(VirtexEGenerateUnitTest) {
63  VirtexE bitstream;
64  DeviceInfoHelper::buildFamilyDeviceInfo("VirtexE", "VirtexEDeviceInfo.template",
65  "VirtexEDeviceInfo.cpp", torc::common::Devices::getVirtexEDevices(), bitstream);
66 }
67 
68 /// \brief Unit test for the Virtex2 static device info generation.
69 BOOST_AUTO_TEST_CASE(Virtex2GenerateUnitTest) {
70  Virtex2 bitstream;
71  DeviceInfoHelper::buildFamilyDeviceInfo("Virtex2", "Virtex2DeviceInfo.template",
72  "Virtex2DeviceInfo.cpp", torc::common::Devices::getVirtex2Devices(), bitstream);
73 }
74 
75 /// \brief Unit test for the Virtex2P static device info generation.
76 BOOST_AUTO_TEST_CASE(Virtex2PGenerateUnitTest) {
77  Virtex2P bitstream;
78  DeviceInfoHelper::buildFamilyDeviceInfo("Virtex2P", "Virtex2PDeviceInfo.template",
79  "Virtex2PDeviceInfo.cpp", torc::common::Devices::getVirtex2PDevices(), bitstream);
80 }
81 
82 /// \brief Unit test for the Virtex4 static device info generation.
83 BOOST_AUTO_TEST_CASE(Virtex4GenerateUnitTest) {
84  Virtex4 bitstream;
85  DeviceInfoHelper::buildFamilyDeviceInfo("Virtex4", "Virtex4DeviceInfo.template",
86  "Virtex4DeviceInfo.cpp", torc::common::Devices::getVirtex4Devices(), bitstream);
87 }
88 
89 /// \brief Unit test for the Virtex5 static device info generation.
90 BOOST_AUTO_TEST_CASE(Virtex5GenerateUnitTest) {
91  Virtex5 bitstream;
92  DeviceInfoHelper::buildFamilyDeviceInfo("Virtex5", "Virtex5DeviceInfo.template",
93  "Virtex5DeviceInfo.cpp", torc::common::Devices::getVirtex5Devices(), bitstream);
94 }
95 
96 /// \brief Unit test for the Virtex6 static device info generation.
97 BOOST_AUTO_TEST_CASE(Virtex6GenerateUnitTest) {
98  Virtex6 bitstream;
99  DeviceInfoHelper::buildFamilyDeviceInfo("Virtex6", "Virtex6DeviceInfo.template",
100  "Virtex6DeviceInfo.cpp", torc::common::Devices::getVirtex6Devices(), bitstream);
101 }
102 
103 /// \brief Unit test for the Virtex7 static device info generation.
104 BOOST_AUTO_TEST_CASE(Virtex7GenerateUnitTest) {
105  Virtex7 bitstream;
111  devices.insert(devices.end(), artix7Devices.begin(), artix7Devices.end());
112  devices.insert(devices.end(), kintex7Devices.begin(), kintex7Devices.end());
113  devices.insert(devices.end(), virtex7Devices.begin(), virtex7Devices.end());
114  devices.insert(devices.end(), zynq7000Devices.begin(), zynq7000Devices.end());
115 (void) artix7Devices;
116 (void) kintex7Devices;
117 (void) virtex7Devices;
118 (void) zynq7000Devices;
119  DeviceInfoHelper::buildFamilyDeviceInfo("Virtex7", "Virtex7DeviceInfo.template",
120  "Virtex7DeviceInfo.cpp", devices, bitstream);
121 }
122 
123 #endif
124 
125 BOOST_AUTO_TEST_SUITE_END()
126 
127 } // namespace bitstream
128 } // namespace torc
Header for the VirtexE class.
static const DeviceVector & getVirtex2PDevices(void)
Returns the Virtex2P devices.
Definition: Devices.hpp:187
static const DeviceVector & getVirtexEDevices(void)
Returns the VirtexE devices.
Definition: Devices.hpp:183
Header for the Virtex4 class.
Header for the DeviceInfoHelper class.
Header for the Virtex2P class.
static const DeviceVector & getArtix7Devices(void)
Returns the Artix7 devices.
Definition: Devices.hpp:199
Header for the Virtex6 class.
Header for the Virtex5 class.
Header for the Spartan6 class.
static const DeviceVector & getVirtex2Devices(void)
Returns the Virtex2 devices.
Definition: Devices.hpp:185
static const DeviceVector & getVirtex5Devices(void)
Returns the Virtex5 devices.
Definition: Devices.hpp:191
static const DeviceVector & getZynq7000Devices(void)
Returns the Zynq7000 devices.
Definition: Devices.hpp:201
static const DeviceVector & getVirtex6Devices(void)
Returns the Virtex6 devices.
Definition: Devices.hpp:193
static const DeviceVector & getSpartan3EDevices(void)
Returns the Spartan3E devices.
Definition: Devices.hpp:203
static const DeviceVector & getVirtex4Devices(void)
Returns the Virtex4 devices.
Definition: Devices.hpp:189
Header for the Virtex class.
Header for the Virtex2 class.
Header for the Spartan3E class.
static const DeviceVector & getVirtexDevices(void)
Returns the Virtex devices.
Definition: Devices.hpp:181
BOOST_AUTO_TEST_CASE(hexCharacterToDec)
std::vector< std::string > DeviceVector
Vector of device names.
Definition: Devices.hpp:119
static const DeviceVector & getVirtex7Devices(void)
Returns the Virtex7 devices.
Definition: Devices.hpp:195
static void buildFamilyDeviceInfo(const std::string &inFamilyName, const std::string &inTemplateName, const std::string &inOutputName, const torc::common::DeviceVector &inDeviceNames, Bitstream &inBitstream)
Build the static device information for the specified family.
Header for the Virtex7 class.
static const DeviceVector & getKintex7Devices(void)
Returns the Virtex7L devices.
Definition: Devices.hpp:197