torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Virtex5UnitTest.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 Virtex5 class.
18 
19 #include <boost/test/unit_test.hpp>
22 #include "torc/common/Devices.hpp"
28 #include <fstream>
29 #include <iostream>
30 #include <boost/filesystem.hpp>
31 
32 #include <torc/Architecture.hpp>
33 
34 namespace torc {
35 namespace bitstream {
36 
37 BOOST_AUTO_TEST_SUITE(bitstream)
38 
39 /// \brief Unit test for the Virtex5 FX130T getPrimaryXdlColumn()
40 BOOST_AUTO_TEST_CASE(Virtex5PrimaryXdlColumnUnitTest) {
41  torc::architecture::DDB ddb("xc5vfx130t");
42  const torc::architecture::Tiles& tiles = ddb.getTiles();
46  for(torc::architecture::xilinx::TileCol col(0); col < cols; col++) {
47  torc::architecture::xilinx::TileIndex tileIndex = tiles.getTileIndex(row, col);
48  const torc::architecture::TileInfo& tileInfo = tiles.getTileInfo(tileIndex);
49  std::cerr << col << ": " << tileInfo.getName() << ", ";
50  }
51  std::cerr << std::endl;
52  (void) rows;
53 
54  Virtex5 bitstream;
55  bitstream.setDevice("xc5vfx130t");
56  bitstream.initializeDeviceInfo("xc5vfx130t");
57  bitstream.initializeFrameMaps();
58  for(uint32_t xdlCol = 0; xdlCol < 190; xdlCol++) {
59  uint32_t primaryXdlCol = bitstream.getPrimaryXdlColumn(xdlCol);
60  std::cerr << xdlCol << ": " << primaryXdlCol << ", ";
61  }
62  std::cerr << std::endl;
63  BOOST_REQUIRE(true);
64 }
65 
66 /// \brief Unit test for the Virtex5 class.
67 BOOST_AUTO_TEST_CASE(Virtex5UnitTest) {
68 
69  // enums tested:
70  // EPacket
71  // EFar
72  boost::uint32_t mask;
73  // type 1 packet subfield masks
77  BOOST_CHECK_EQUAL(mask, 0xFFFFFFFFu);
78  // type 2 packet subfield masks
81  BOOST_CHECK_EQUAL(mask, 0xFFFFFFFFu);
82  // frame address register subfield masks
85  BOOST_CHECK_EQUAL(mask, 0x00FFFFFFu);
86 
87  // members tested:
88  // Virtex5::sPacketTypeName and EPacketTypeName
89  BOOST_CHECK_EQUAL(Virtex5::sPacketTypeName[0], "[UNKNOWN TYPE 0]");
90  BOOST_CHECK_EQUAL(Virtex5::sPacketTypeName[Virtex5::ePacketType1], "TYPE1");
91  BOOST_CHECK_EQUAL(Virtex5::sPacketTypeName[Virtex5::ePacketType2], "TYPE2");
92  BOOST_CHECK_EQUAL(Virtex5::sPacketTypeName[3], "[UNKNOWN TYPE 3]");
93  BOOST_CHECK_EQUAL(Virtex5::sPacketTypeName[4], "[UNKNOWN TYPE 4]");
94  BOOST_CHECK_EQUAL(Virtex5::sPacketTypeName[5], "[UNKNOWN TYPE 5]");
95  BOOST_CHECK_EQUAL(Virtex5::sPacketTypeName[6], "[UNKNOWN TYPE 6]");
96  BOOST_CHECK_EQUAL(Virtex5::sPacketTypeName[7], "[UNKNOWN TYPE 7]");
97 
98  // members tested:
99  // Virtex5::sOpcodeName and EOpcode
100  BOOST_CHECK_EQUAL(Virtex5::sOpcodeName[Virtex5::eOpcodeNOP], "NOP");
101  BOOST_CHECK_EQUAL(Virtex5::sOpcodeName[Virtex5::eOpcodeRead], "READ");
102  BOOST_CHECK_EQUAL(Virtex5::sOpcodeName[Virtex5::eOpcodeWrite], "WRITE");
103  BOOST_CHECK_EQUAL(Virtex5::sOpcodeName[Virtex5::eOpcodeReserved], "RESERVED");
104 
105  // members tested:
106  // Virtex5::sRegisterName and ERegister
107  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterCRC], "CRC");
108  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterFAR], "FAR");
109  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterFDRI], "FDRI");
110  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterFDRO], "FDRO");
111  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterCMD], "CMD");
112  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterCTL0], "CTL0");
113  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterMASK], "MASK");
114  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterSTAT], "STAT");
115  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterLOUT], "LOUT");
116  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterCOR0], "COR0");
117  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterMFWR], "MFWR");
118  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterCBC], "CBC");
119  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterIDCODE], "IDCODE");
120  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterAXSS], "AXSS");
121  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterCOR1], "COR1");
122  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterCSOB], "CSOB");
123  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterWBSTAR], "WBSTAR");
124  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterTIMER], "TIMER");
125  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterBOOTSTS], "BOOTSTS");
126  BOOST_CHECK_EQUAL(Virtex5::sRegisterName[Virtex5::eRegisterCTL1], "CTL1");
127 
128  // members tested:
129  // Virtex5::sCommandName and ECommand
130  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandNULL], "NULL");
131  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandWCFG], "WCFG");
132  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandMFW], "MFW");
133  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandLFRM], "DGHIGH/LFRM");
134  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandRCFG], "RCFG");
135  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandSTART], "START");
136  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandRCAP], "RCAP");
137  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandRCRC], "RCRC");
138  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandAGHIGH], "AGHIGH");
139  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandSWITCH], "SWITCH");
140  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandGRESTORE], "GRESTORE");
141  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandSHUTDOWN], "SHUTDOWN");
142  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandGCAPTURE], "GCAPTURE");
143  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandDESYNCH], "DESYNCH");
144  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandReserved], "Reserved");
145  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandIPROG], "IPROG");
146  BOOST_CHECK_EQUAL(Virtex5::sCommandName[Virtex5::eCommandLTIMER], "LTIMER");
147 
148  uint32_t u1 = 0xffffffff & mask;
149  BOOST_CHECK_EQUAL(uint32_t(Virtex5::FrameAddress(u1)), u1);
150  uint32_t u2 = 0xffff0000 & mask;
151  BOOST_CHECK_EQUAL(uint32_t(Virtex5::FrameAddress(u2)), u2);
152  uint32_t u3 = 0xff00ff00 & mask;
153  BOOST_CHECK_EQUAL(uint32_t(Virtex5::FrameAddress(u3)), u3);
154  uint32_t u4 = 0xf0f0f0f0 & mask;
155  BOOST_CHECK_EQUAL(uint32_t(Virtex5::FrameAddress(u4)), u4);
156  uint32_t u5 = 0xcccccccc & mask;
157  BOOST_CHECK_EQUAL(uint32_t(Virtex5::FrameAddress(u5)), u5);
158  uint32_t u6 = 0xaaaaaaaa & mask;
159  BOOST_CHECK_EQUAL(uint32_t(Virtex5::FrameAddress(u6)), u6);
160 
161  // build the file paths
163  / "torc" / "bitstream" / "Virtex5UnitTest.reference.bit";
165  / "regression" / "Virtex5UnitTest.generated.bit";
166 
167  // read the bitstream
168  std::fstream fileStream(referencePath.string().c_str(), std::ios::binary | std::ios::in);
169  BOOST_REQUIRE(fileStream.good());
170  Virtex5 bitstream;
171  bitstream.read(fileStream, false);
172  // write the bitstream digest to the console
173  std::cout << bitstream << std::endl;
174 
175  std::string designName = bitstream.getDesignName();
176  std::string deviceName = bitstream.getDeviceName();
177  std::string designDate = bitstream.getDesignDate();
178  std::string designTime = bitstream.getDesignTime();
179  torc::common::DeviceDesignator deviceDesignator(deviceName);
180  std::cout << "family of " << deviceName << " is " << deviceDesignator.getFamily() << std::endl;
181 
182  // write the bitstream back out
183  std::fstream outputStream(generatedPath.string().c_str(), std::ios::binary | std::ios::out);
184  BOOST_REQUIRE(outputStream.good());
185  bitstream.write(outputStream);
186  outputStream.flush();
187 
188  // compare the reference and generated XDL
189  BOOST_CHECK(torc::common::fileContentsAreEqual(generatedPath, referencePath));
190 }
191 
192 
193 
194 
195 
196 
197 
198 
199 
200 
201 
202 
203 
204 
205 
206 
207 
208 
209 
210 
211 
212 
213 
214 
215 
216 
217 
218 
219 
220 
221 
222 
223 
224 
225 
226 
227 
228 void testVirtex5Device(const std::string& inDeviceName, const boost::filesystem::path& inWorkingPath);
229 
230 /// \brief Unit test for the Virtex5 class Frame Address Register mapping.
231 BOOST_AUTO_TEST_CASE(Virtex5FarUnitTest) {
232 
233  // look up the command line arguments
234  int& argc = boost::unit_test::framework::master_test_suite().argc;
235  char**& argv = boost::unit_test::framework::master_test_suite().argv;
236  // make sure that we at least have the name under which we were invoked
237  BOOST_REQUIRE(argc >= 1);
238  // resolve symbolic links if applicable
239  torc::common::DirectoryTree directoryTree(argv[0]);
240 
241  // iterate over the devices
243  torc::common::DeviceVector::const_iterator dp = devices.begin();
244  torc::common::DeviceVector::const_iterator de = devices.end();
245  while(dp < de) {
246  const std::string& device = *dp++;
247  if(device.empty()) break;
248 //std::cout << "device " << ": " << device << std::endl;
250  }
251 }
252 
253 
254 void testVirtex5Device(const std::string& inDeviceName, const boost::filesystem::path& inWorkingPath) {
255 
256  // build the file paths
257  boost::filesystem::path debugBitstreamPath = inWorkingPath / "torc" / "bitstream" / "regression";
258  //boost::filesystem::path generatedPath = debugBitstreamPath / (inDeviceName + ".debug.bit");
259  boost::filesystem::path referencePath = debugBitstreamPath / (inDeviceName + ".debug.bit");
260 std::cerr << "TRYING TO FIND " << referencePath << std::endl;
261 
262  // read the bitstream
263  std::fstream fileStream(referencePath.string().c_str(), std::ios::binary | std::ios::in);
264  std::cerr << "Trying to read: " << referencePath << std::endl;
265  BOOST_REQUIRE(fileStream.good());
266  Virtex5 bitstream;
267 std::cerr << "test0" << std::endl;
268  bitstream.read(fileStream, false);
269 std::cerr << "test1" << std::endl;
270  // write the bitstream digest to the console
271 // std::cout << bitstream << std::endl;
272 
273 // // initialize the bitstream frame maps
274 // boost::filesystem::path deviceColumnsPath = inWorkingPath / "torc" / "bitstream" / "regression"
275 // / (inDeviceName + ".cpp");
276 // std::fstream deviceColumnsStream(deviceColumnsPath.string().c_str(), std::ios::out);
277  bitstream.initializeDeviceInfo(inDeviceName);
278 std::cerr << "test2" << std::endl;
279  bitstream.initializeFrameMaps();
280 std::cerr << "test3" << std::endl;
281 
282  // iterate through the packets, and extract all of the FARs
283  Virtex5::FrameAddressToIndex farRemaining = bitstream.mFrameAddressToIndex;
284  Virtex5::FrameAddressToIndex farVisited;
285  {
286  bool first = true;
287  Virtex5::const_iterator p = bitstream.begin();
288  Virtex5::const_iterator e = bitstream.end();
291  while(p < e) {
292  const VirtexPacket& packet = *p++;
293  if(packet.getHeader() != header) continue;
294  if(first) { first = false; continue; }
295  Virtex5::FrameAddress far = packet[1];
296  farVisited[far] = 0;
297  Virtex5::FrameAddressToIndex::iterator found = farRemaining.find(far);
298  if(found != farRemaining.end()) {
299  farRemaining.erase(found);
300  } else {
301  std::cerr << "missing " << far << " ";
302  }
303  }
304  }
305  // verify that we have visited all of the expected FARs and no others
306  std::cout << "Device: " << inDeviceName << std::endl;
307  std::cout << "Size of farRemaining: " << farRemaining.size() << std::endl;
308  std::cout << "Size of farVisited: " << farVisited.size() << std::endl;
309  BOOST_REQUIRE_EQUAL(bitstream.mFrameAddressToIndex.size(), farVisited.size());
310  BOOST_REQUIRE_EQUAL(farRemaining.size(), 0u);
311 
312 return;
313 
314  // iterate through the debug bitstream packets, and extract all of the FARs
315  // this isn't currently being used, but it may come in handy for debugging
316  for(int half = 0; half < 2; half++) {
317  for(uint32_t row = 0; row < 2; row++) {
318  typedef std::map<uint32_t, uint32_t> ColumnMaxFrame;
319  ColumnMaxFrame maxFrames[Virtex5::eFarBlockTypeCount];
320  Virtex5::const_iterator p = bitstream.begin();
321  Virtex5::const_iterator e = bitstream.end();
324  while(p < e) {
325  const VirtexPacket& packet = *p++;
326  if(packet.getHeader() != header) continue;
327  Virtex5::FrameAddress far = packet[1];
328 // uint32_t far = packet[1];
329 // std::cerr << Hex32(far) << " ";
330  if(far.mTopBottom == half && far.mRow == row) {
331 // std::cerr << far << " ";
332  ColumnMaxFrame::iterator i = maxFrames[far.mBlockType].find(far.mMajor);
333  if(i == maxFrames[far.mBlockType].end()) {
334  maxFrames[far.mBlockType][far.mMajor] = 0;
335  } else {
336  if(maxFrames[far.mBlockType][far.mMajor] < far.mMinor)
337  maxFrames[far.mBlockType][far.mMajor] = far.mMinor;
338  }
339  }
340  }
341  std::cerr << std::endl;
342  uint32_t frameCount = 0;
343  for(uint32_t i = 0; i < Virtex5::eFarBlockTypeCount; i++) {
345  uint32_t majorCount = maxFrames[blockType].size();
346  for(uint32_t major = 0; major < majorCount; major++) {
347  frameCount += maxFrames[blockType][major] + 1;
348  std::cerr << blockType << "(" << major << "): "
349  << (maxFrames[blockType][major] + 1) << " (" << frameCount << ")"
350  << std::endl;
351  }
352  }
353  }
354  }
355 
356 }
357 
358 void testVirtex5FullMapping(const boost::filesystem::path& inWorkingPath);
359 void testVirtex5PartialMapping(const boost::filesystem::path& inWorkingPath);
360 
361 /// \brief Unit test for the Virtex5 bitstream to bitmap conversion.
362 BOOST_AUTO_TEST_CASE(Virtex5MapUnitTest) {
363  // look up the command line arguments
364  int& argc = boost::unit_test::framework::master_test_suite().argc;
365  char**& argv = boost::unit_test::framework::master_test_suite().argv;
366  // make sure that we at least have the name under which we were invoked
367  BOOST_REQUIRE(argc >= 1);
368  // resolve symbolic links if applicable
369  torc::common::DirectoryTree directoryTree(argv[0]);
371  //testVirtex5PartialMapping(torc::common::DirectoryTree::getWorkingPath());
372 }
373 
374 
376  // build the file paths
378  / "torc" / "bitstream" / "Virtex5UnitTest.reference.bit";
380  / "regression" / "Virtex5MapUnitTest.generated.bit";
381 
382  // read the bitstream
383  std::fstream fileStream(referencePath.string().c_str(), std::ios::binary | std::ios::in);
384  BOOST_REQUIRE(fileStream.good());
385  // read and gather bitstream frames
386  Virtex5 bitstream;
387  bitstream.read(fileStream, false);
388 
389  // initialize frame map
390  bitstream.initializeDeviceInfo("xc5vlx20t");
391  bitstream.initializeFrameMaps();
392 
393  // load bitstream frames in data structure
394  bitstream.readFramePackets();
395 
396  // write full bitstream from frame blocks data structure
397  uint32_t frameLength = bitstream.getFrameLength();
398  typedef boost::shared_array<uint32_t> WordSharedArray;
399  Virtex5::iterator p = bitstream.begin();
400  Virtex5::iterator e = bitstream.end();
401  while(p < e) {
402  const VirtexPacket& packet = *p++;
403  if(packet.isType2()) {
404  WordSharedArray words = packet.getWords();
405  uint32_t* ptr = words.get();
406  for(uint32_t block = 0; block < 8; block++) {
407  for(uint32_t frame = 0; frame < bitstream.mBlockFrameIndexBounds[block]; frame++) {
408  VirtexFrameBlocks::word_t* words = const_cast<VirtexFrameBlocks::word_t*>(bitstream.mFrameBlocks.mBlock[block][frame]->getWords());
409  for(uint32_t index = 0; index < frameLength; index++) {
410  *ptr++ = words[index];
411  }
412  }
413  }
414  }
415  }
416  // write the test bitstream back out
417  std::fstream outputStream(generatedPath.string().c_str(), std::ios::binary | std::ios::out);
418  BOOST_REQUIRE(outputStream.good());
419  bitstream.write(outputStream);
420  outputStream.flush();
421  BOOST_REQUIRE(torc::common::fileContentsAreEqual(referencePath, generatedPath));
422 
423  return;
424 }
425 
426 /*
427 void testVirtex5PartialMapping(const boost::filesystem::path& inWorkingPath) {
428  // build the file paths
429  boost::filesystem::path regressionPath
430  = torc::common::DirectoryTree::getExecutablePath() / "regression";
431  boost::filesystem::path generatedPath = regressionPath / "Virtex5UnitTest.generatedPartial.bit";
432  boost::filesystem::path referencePath = regressionPath / "Virtex5UnitTest.reference.bit";
433 
434  // read the bitstream
435  std::fstream fileStream("partial.bit", std::ios::binary | std::ios::in);
436  BOOST_REQUIRE(fileStream.good());
437  // read and gather bitstream frames
438  Virtex5 bitstream;
439  bitstream.read(fileStream, false);
440 
441  // initialize frame map
442  bitstream.initializeDeviceInfo("xc5vlx110t");
443  bitstream.initializeFrameMaps();
444 
445  // load bitstream frames in data structure
446  bitstream.initializePartialFrameBlocks();
447 
448  uint32_t frameLength = bitstream.getFrameLength();
449  typedef boost::shared_array<uint32_t> WordSharedArray;
450  Virtex5::iterator p = bitstream.begin();
451  Virtex5::iterator e = bitstream.end();
452  while(p < e) {
453  const VirtexPacket& packet = *p++;
454  if(packet.isType2()) {
455  WordSharedArray words = packet.getWords();
456  uint32_t* ptr = words.get();
457  }
458  }
459  // write the test bitstream back out
460  std::fstream outputStream(generatedPath.string().c_str(), std::ios::binary | std::ios::out);
461  BOOST_REQUIRE(outputStream.good());
462  bitstream.write(outputStream);
463  outputStream.flush();
464 
465  return;
466 }
467 */
468 
469 BOOST_AUTO_TEST_SUITE_END()
470 
471 } // namespace bitstream
472 } // namespace torc
Header for torc::bitstream output stream helpers.
virtual void initializeFrameMaps(void)
Initialize the maps between frame indexes and frame addresses.
Definition: Virtex5.cpp:528
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.
Main torc::architecture namespace header.
Encapsulation of a device designator and its constituent elements.
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
TileRow getRowCount(void) const
Returns the row count for this device.
Definition: Tiles.hpp:153
Header for the DeviceInfoHelper class.
const EFamily & getFamily(void) const
Returns the device family.
Header for the DirectoryTree class.
const Tiles & getTiles(void) const
Returns a constant reference to the family and device tile data.
Definition: DDB.hpp:146
static const char * sRegisterName[eRegisterCount]
Configuration register names.
Definition: Virtex5.hpp:120
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
Header for the Virtex5 class.
Header for the DeviceDesignator class.
EFarBlockType
Frame Address Register block type constants.
Definition: Virtex5.hpp:85
void testVirtex5FullMapping(const boost::filesystem::path &inWorkingPath)
std::string string
Header for Boost.Test helper functions.
Virtex5 bitstream.
Definition: Virtex5.hpp:41
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
Definition: Virtex5.hpp:116
static const DeviceVector & getVirtex5Devices(void)
Returns the Virtex5 devices.
Definition: Devices.hpp:191
void testVirtex5Device(const std::string &inDeviceName, const boost::filesystem::path &inWorkingPath)
VirtexFrame::word_t word_t
FrameSet word type.
Definition: FrameSet.hpp:85
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Definition: Virtex5.hpp:118
Tile map, tile type, and wire information for the family and device.
Definition: Tiles.hpp:36
Encapsulation of filesystem paths that are used by the library.
static const char * sCommandName[eCommandCount]
Configuration command names.
Definition: Virtex5.hpp:122
Encapsulation of a tile within a device tile map.
Definition: TileInfo.hpp:33
Header for the Devices class.
boost::filesystem::path path
void setDevice(const std::string &inDeviceName)
Assign the device enumeration constant for the given device name.
std::map< Virtex5::FrameAddress, uint32_t > FrameAddressToIndex
Map from frame address to frame index.
Definition: Virtex5.hpp:327
static const boost::filesystem::path & getWorkingPath(void)
Returns the absolute path to the working directory.
const WordSharedArray getWords(void) const
brief Returns the raw packet words, including the header word.
TileCol getColCount(void) const
Returns the column count for this device.
Definition: Tiles.hpp:155
const char * getName(void) const
Returns the name for this tile.
Definition: TileInfo.hpp:98
Header for the DDB class.
bool fileContentsAreEqual(const boost::filesystem::path &inA, const boost::filesystem::path &inB)
Compare the raw contents of two files to determine whether they are identical.
Bitstream packet for Virtex class architectures.
static uint32_t makeHeader(EPacketType inType, EOpcode inOpcode, uint32_t inAddress, uint32_t inCount)
Construct a packet header.
BOOST_AUTO_TEST_CASE(hexCharacterToDec)
std::vector< std::string > DeviceVector
Vector of device names.
Definition: Devices.hpp:119
virtual void read(std::istream &inStream, bool inCleanDateAndTime=true)
Read the bitstream header and packets from a stream.
uint32_t getPrimaryXdlColumn(uint32_t inXdlCol)
Returns the primary column corresponding to the given column. If immediately to the left of a BRAM...
Definition: Virtex5.cpp:1176
void testVirtex5PartialMapping(const boost::filesystem::path &inWorkingPath)
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.
uint32_t getHeader(void) const
TileIndex getTileIndex(TileRow inRow, TileCol inCol) const
Returns the tile index for the given [row,column] pair.
Definition: Tiles.hpp:161
virtual void initializeDeviceInfo(const std::string &inDeviceName)
Initialize the device information.
Definition: Virtex5.cpp:412