torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Virtex7UnitTest.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 Virtex7 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 namespace torc{
33 namespace bitstream{
34 
35 BOOST_AUTO_TEST_SUITE(bitstream)
36 
37 /// \brief Unit test for the Virtex7 class
38 BOOST_AUTO_TEST_CASE(Virtex7UnitTest){
39  // enums tested:
40  // Epacket
41  // Efar
42  boost::uint32_t mask;
43  // type 1 packet subfield masks
47  BOOST_CHECK_EQUAL(mask, 0xFFFFFFFFu);
48  // type 2 packet subfield masks
51  BOOST_CHECK_EQUAL(mask, 0xFFFFFFFFu);
52  // frame address register subfield masks
55  BOOST_CHECK_EQUAL(mask, 0x03FFFFFFu);
56 
57  // members tested:
58  // Virtex7::sPacketTypeName and EPacketTypeName
59  BOOST_CHECK_EQUAL(Virtex7::sPacketTypeName[0], "[UNKNOWN TYPE 0]");
60  BOOST_CHECK_EQUAL(Virtex7::sPacketTypeName[Virtex7::ePacketType1], "TYPE1");
61  BOOST_CHECK_EQUAL(Virtex7::sPacketTypeName[Virtex7::ePacketType2], "TYPE2");
62  BOOST_CHECK_EQUAL(Virtex7::sPacketTypeName[3], "[UNKNOWN TYPE 3]");
63  BOOST_CHECK_EQUAL(Virtex7::sPacketTypeName[4], "[UNKNOWN TYPE 4]");
64  BOOST_CHECK_EQUAL(Virtex7::sPacketTypeName[5], "[UNKNOWN TYPE 5]");
65  BOOST_CHECK_EQUAL(Virtex7::sPacketTypeName[6], "[UNKNOWN TYPE 6]");
66  BOOST_CHECK_EQUAL(Virtex7::sPacketTypeName[7], "[UNKNOWN TYPE 7]");
67 
68  // members tested:
69  // Virtex7::sOpcodeName and EOpcode
70  BOOST_CHECK_EQUAL(Virtex7::sOpcodeName[Virtex7::eOpcodeNOP], "NOP");
71  BOOST_CHECK_EQUAL(Virtex7::sOpcodeName[Virtex7::eOpcodeRead], "READ");
72  BOOST_CHECK_EQUAL(Virtex7::sOpcodeName[Virtex7::eOpcodeWrite], "WRITE");
73  BOOST_CHECK_EQUAL(Virtex7::sOpcodeName[Virtex7::eOpcodeReserved], "RESERVED");
74 
75  // members tested:
76  // Virtex7::sRegisterName and ERegister
77  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterCRC], "CRC");
78  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterFAR], "FAR");
79  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterFDRI], "FDRI");
80  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterFDRO], "FDRO");
81  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterCMD], "CMD");
82  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterCTL0], "CTL0");
83  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterMASK], "MASK");
84  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterSTAT], "STAT");
85  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterLOUT], "LOUT");
86  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterCOR0], "COR0");
87  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterMFWR], "MFWR");
88  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterCBC], "CBC");
89  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterIDCODE], "IDCODE");
90  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterAXSS], "AXSS");
91  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterCOR1], "COR1");
92  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterWBSTAR], "WBSTAR");
93  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterTIMER], "TIMER");
94  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterBOOTSTS], "BOOTSTS");
95  BOOST_CHECK_EQUAL(Virtex7::sRegisterName[Virtex7::eRegisterCTL1], "CTL1");
96 
97  // members tested:
98  // Virtex7::sCommandName and ECommand
99  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandNULL], "NULL");
100  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandWCFG], "WCFG");
101  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandMFW], "MFW");
102  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandLFRM], "DGHIGH/LFRM");
103  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandRCFG], "RCFG");
104  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandSTART], "START");
105  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandRCAP], "RCAP");
106  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandRCRC], "RCRC");
107  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandAGHIGH], "AGHIGH");
108  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandSWITCH], "SWITCH");
109  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandGRESTORE], "GRESTORE");
110  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandSHUTDOWN], "SHUTDOWN");
111  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandGCAPTURE], "GCAPTURE");
112  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandDESYNCH], "DESYNCH");
113  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandReserved], "Reserved");
114  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandIPROG], "IPROG");
115  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandCRCC], "CRCC");
116  BOOST_CHECK_EQUAL(Virtex7::sCommandName[Virtex7::eCommandLTIMER], "LTIMER");
117 
118 
119  // build the file paths
121  / "torc" / "bitstream" / "Virtex7UnitTest.reference.bit";
123  / "regression" / "Virtex7UnitTest.generated.bit";
124 
125  // read the bitstream
126  std::fstream fileStream(referencePath.string().c_str(), std::ios::binary | std::ios::in);
127  BOOST_REQUIRE(fileStream.good());
128  Virtex7 bitstream;
129  bitstream.read(fileStream, false);
130  // write the bitstream digest to the console
131  std::cout << bitstream << std::endl;
132 
133 
134  std::string designName = bitstream.getDesignName();
135  std::string deviceName = bitstream.getDeviceName();
136  std::string designDate = bitstream.getDesignDate();
137  std::string designTime = bitstream.getDesignTime();
138  torc::common::DeviceDesignator deviceDesignator(deviceName);
139  std::cout << "family of " << deviceName << " is " << deviceDesignator.getFamily() << std::endl;
140 
141  // write the bitstream back out
142  std::fstream outputStream(generatedPath.string().c_str(), std::ios::binary | std::ios::out);
143  BOOST_REQUIRE(outputStream.good());
144  bitstream.write(outputStream);
145  outputStream.flush();
146 
147  // compare the reference and generated XDL
148  BOOST_CHECK(torc::common::fileContentsAreEqual(generatedPath, referencePath));
149 }
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 void testVirtex7Device(const std::string& inDeviceName, const boost::filesystem::path& inWorkingPath);
167 
168 /// \brief Unit test for the Virtex7 class Frame Address Register mapping.
169 BOOST_AUTO_TEST_CASE(Virtex7FarUnitTest) {
170 
171  // look up the command line arguments
172  int& argc = boost::unit_test::framework::master_test_suite().argc;
173  char**& argv = boost::unit_test::framework::master_test_suite().argv;
174  // make sure that we at least have the name under which we were invoked
175  BOOST_REQUIRE(argc >= 1);
176  // resolve symbolic links if applicable
177  torc::common::DirectoryTree directoryTree(argv[0]);
178 #if 0
179  // iterate over the Artix7 devices
180  {
182  torc::common::DeviceVector::const_iterator dp = devices.begin();
183  torc::common::DeviceVector::const_iterator de = devices.end();
184  while(dp < de) {
185  const std::string& device = *dp++;
186  if(device.empty()) break;
187 //std::cout << "device " << ": " << device << std::endl;
189  }
190  }
191 
192  // iterate over the Kintex7 devices
193  {
195  torc::common::DeviceVector::const_iterator dp = devices.begin();
196  torc::common::DeviceVector::const_iterator de = devices.end();
197  while(dp < de) {
198  const std::string& device = *dp++;
199  if(device.empty()) break;
200 //std::cout << "device " << ": " << device << std::endl;
202  }
203  }
204 
205  // iterate over the Virtex7 devices
206  {
208  torc::common::DeviceVector::const_iterator dp = devices.begin();
209  torc::common::DeviceVector::const_iterator de = devices.end();
210  while(dp < de) {
211  const std::string& device = *dp++;
212  if(device.empty()) break;
213  // the Xilinx tools only generate debug bitstreams for a subset of Virtex7 devices
214  if(device != "xc7v585t" && device != "xc7vx330t" && device != "xc7vx415t"
215  && device != "xc7vx485t" && device != "xc7vx550t" && device != "xc7vx690t"
216  && device != "xc7vx980t") continue;
217 //std::cout << "device " << ": " << device << std::endl;
219  }
220  }
221 #endif
222  // iterate over the Zynq7000 devices
223  {
225  torc::common::DeviceVector::const_iterator dp = devices.begin();
226  torc::common::DeviceVector::const_iterator de = devices.end();
227  while(dp < de) {
228  const std::string& device = *dp++;
229  if(device.empty()) break;
230 if(device != "xc7z045") continue;
231 //std::cout << "device " << ": " << device << std::endl;
233  }
234  }
235 
236 }
237  /*
238  class TileTypeWidths {
239  public:
240  uint32_t mWidth[8];
241  TileTypeWidths(uint32_t in0 = 0, uint32_t in1 = 0, uint32_t in2 = 0, uint32_t in3 = 0,
242  uint32_t in4 = 0, uint32_t in5 = 0, uint32_t in6 = 0, uint32_t in7 = 0) {
243  int i = 0;
244  mWidth[i++] = in0; mWidth[i++] = in1; mWidth[i++] = in2; mWidth[i++] = in3;
245  mWidth[i++] = in4; mWidth[i++] = in5; mWidth[i++] = in6; mWidth[i++] = in7;
246  }
247  void clear(void) { for(int i = 0; i < 8; i++) mWidth[i] = 0; }
248  uint32_t operator[] (int inIndex) const { return mWidth[inIndex]; }
249  };
250  */
251 
252 void testVirtex7Device(const std::string& inDeviceName, const boost::filesystem::path& inWorkingPath) {
253 
254  // build the file paths
255  boost::filesystem::path debugBitstreamPath = inWorkingPath / "torc" / "bitstream" / "regression";
256  //boost::filesystem::path generatedPath = debugBitstreamPath / (inDeviceName + ".debug.bit");
257  boost::filesystem::path referencePath = debugBitstreamPath / (inDeviceName + ".debug.bit");
258 
259  // read the bitstream
260  std::fstream fileStream(referencePath.string().c_str(), std::ios::binary | std::ios::in);
261  std::cerr << "Trying to read: " << referencePath << std::endl;
262  BOOST_REQUIRE(fileStream.good());
263  Virtex7 bitstream;
264  bitstream.read(fileStream, false);
265  // write the bitstream digest to the console
266 // std::cout << bitstream << std::endl;
267 
268 
269  typedef std::map<Virtex7::FrameAddress, Virtex7::FrameAddress> FrameAddressMap;
270  FrameAddressMap fars;
271  // determine the far count in every column
272  Virtex7::const_iterator p = bitstream.begin();
273  Virtex7::const_iterator e = bitstream.end();
276  while(p < e) {
277  const VirtexPacket& packet = *p++;
278  if(packet.getHeader() != header) continue;
279  Virtex7::FrameAddress far = packet[1];
280  Virtex7::FrameAddress base = far;
281  base.mMinor = 0;
282  fars[base] = std::max(fars[base], far);
283  }
284  // write out the maximum far for every column
285  FrameAddressMap::const_iterator fp = fars.begin();
286  FrameAddressMap::const_iterator fe = fars.end();
287  while(fp != fe) {
288  const FrameAddressMap::value_type& value = *fp++;
289 (void) value;
290 // std::cerr << value.second << std::endl;
291  }
292 
293  // initialize the bitstream frame maps
294 // boost::filesystem::path deviceColumnsPath = inWorkingPath / "torc" / "bitstream" / "regression"
295 // / (inDeviceName + ".cpp");
296 // std::fstream deviceColumnsStream(deviceColumnsPath.string().c_str(), std::ios::out);
297  bitstream.initializeDeviceInfo(inDeviceName);
298  bitstream.initializeFrameMaps();
299 
300 
301  // iterate through the packets, and extract all of the FARs
302  Virtex7::FrameAddressToIndex farRemaining = bitstream.mFrameAddressToIndex;
303  Virtex7::FrameAddressToIndex farVisited;
304  {
305  bool enabled = false;
306  Virtex7::const_iterator p = bitstream.begin();
307  Virtex7::const_iterator e = bitstream.end();
312  while(p < e) {
313  const VirtexPacket& packet = *p++;
314  if(packet.getHeader() == enable) enabled = true;
315  if(!enabled) continue;
316  if(packet.getHeader() != header) continue;
317  Virtex7::FrameAddress far = packet[1];
318  farVisited[far] = 0;
319  Virtex7::FrameAddressToIndex::iterator found = farRemaining.find(far);
320  if(found != farRemaining.end()) {
321  farRemaining.erase(found);
322  } else {
323  std::cerr << "missing " << far << " ";
324  }
325  }
326  }
327  {
328  Virtex7::FrameAddressToIndex::const_iterator p = farRemaining.begin();
329  Virtex7::FrameAddressToIndex::const_iterator e = farRemaining.end();
330  while(p != e) {
331  std::cerr << "remaining " << (*p++).first << " ";
332  }
333  std::cerr << std::endl;
334  }
335  // verify that we have visited all of the expected FARs and no others
336  std::cout << "Device: " << inDeviceName << std::endl;
337  std::cout << "Size of farRemaining: " << farRemaining.size() << std::endl;
338  std::cout << "Size of farVisited: " << farVisited.size() << std::endl;
339  BOOST_CHECK_EQUAL(farRemaining.size(), 0u);
340  BOOST_CHECK_EQUAL(farVisited.size(), bitstream.mFrameAddressToIndex.size());
341 
342  // iterate through the debug bitstream packets, and extract all of the FARs
343  // this isn't currently being used, but it may come in handy for debugging
344  for(int half = 0; half < 2; half++) {
345 break;
346  for(uint32_t row = 0; row < 2; row++) {
347  typedef std::map<uint32_t, uint32_t> ColumnMaxFrame;
348  ColumnMaxFrame maxFrames[Virtex7::eFarBlockTypeCount];
349  Virtex7::const_iterator p = bitstream.begin();
350  Virtex7::const_iterator e = bitstream.end();
353  while(p < e) {
354  const VirtexPacket& packet = *p++;
355  if(packet.getHeader() != header) continue;
356  Virtex7::FrameAddress far = packet[1];
357 // uint32_t far = packet[1];
358 // std::cerr << Hex32(far) << " ";
359  if(far.mTopBottom == half && far.mRow == row) {
360 // std::cerr << far << " ";
361  ColumnMaxFrame::iterator i = maxFrames[far.mBlockType].find(far.mMajor);
362  if(i == maxFrames[far.mBlockType].end()) {
363  maxFrames[far.mBlockType][far.mMajor] = 0;
364  } else {
365  if(maxFrames[far.mBlockType][far.mMajor] < far.mMinor)
366  maxFrames[far.mBlockType][far.mMajor] = far.mMinor;
367  }
368  }
369  }
370  std::cerr << std::endl;
371  uint32_t frameCount = 0;
372  for(uint32_t i = 0; i < Virtex7::eFarBlockTypeCount; i++) {
374  uint32_t majorCount = maxFrames[blockType].size();
375  for(uint32_t major = 0; major < majorCount; major++) {
376  frameCount += maxFrames[blockType][major] + 1;
377  std::cerr << blockType << "(" << major << "): "
378  << (maxFrames[blockType][major] + 1) << " (" << frameCount << ")"
379  << std::endl;
380  }
381  }
382  }
383  }
384 
385 // BOOST_REQUIRE_EQUAL(bitstream.mFrameAddressToIndex.size(), farVisited.size());
386 // BOOST_REQUIRE_EQUAL(farRemaining.size(), 0u);
387 }
388 
389 /// \brief Unit test for the Virtex7 frame reading.
390 BOOST_AUTO_TEST_CASE(Virtex7FramesUnitTest) {
391 
392  /// \todo This should work correctly with a partial bitstream but has not yet been tested.
394  / "torc" / "bitstream" / "Virtex7UnitTest.reference.bit";
395  std::fstream fileStream(bitstreamPath.string().c_str(), std::ios::binary | std::ios::in);
396  BOOST_REQUIRE(fileStream.good());
397 
398  // read the header and determine the device family
399  Virtex7 bitstream;
400  bitstream.read(fileStream);
401  bitstream.initializeDeviceInfo(bitstream.getDeviceName());
402  bitstream.initializeFrameMaps();
403  bitstream.readFramePackets();
404 
405 }
406 
407 /// \brief Unit test for the Virtex7 class
408 BOOST_AUTO_TEST_CASE(Virtex7WriteUnitTest){
409 
410  // build the file paths
412  / "torc" / "bitstream" / "Virtex7UnitTest.reference.bit";
414  / "regression" / "Virtex7WriteUnitTest.generated.bit";
415 
416  // read the bitstream
417  std::fstream fileStream(referencePath.string().c_str(), std::ios::binary | std::ios::in);
418  BOOST_REQUIRE(fileStream.good());
419  Virtex7 bitstream;
420  bitstream.read(fileStream, false);
421  // write the bitstream digest to the console
422  std::cout << bitstream << std::endl;
423 
424  // initialize the frame information
425  common::DeviceDesignator designator(bitstream.getDeviceName());
426  bitstream.initializeDeviceInfo(designator.getDeviceName());
427  bitstream.initializeFrameMaps();
428  bitstream.readFramePackets();
429 
430  // write the bitstream back out
431  std::fstream outputStream(generatedPath.string().c_str(), std::ios::binary | std::ios::out);
432  BOOST_REQUIRE(outputStream.good());
433 /*
434 bitstream.getFrameBlocks().mBlock[0][50]->setDirty();
435 bitstream.getFrameBlocks().mBlock[0][1000]->setDirty();
436 bitstream.getFrameBlocks().mBlock[0][1001]->setDirty();
437 bitstream.getFrameBlocks().mBlock[0][1002]->setDirty();
438 bitstream.getFrameBlocks().mBlock[0][1003]->setDirty();
439 */
440 bitstream.getFrameBlocks().mBlock[0][7661]->setDirty();
441 bitstream.updateFramePackets(Bitstream::eBitstreamTypePartialActive,
443  bitstream.write(outputStream);
444  outputStream.flush();
445  std::cout << bitstream << std::endl;
446 
447 }
448 
449 #if 0
450 /// \brief Unit test for Zynq XDL frame lookup.
451 BOOST_AUTO_TEST_CASE(Zynq7000DebugUnitTest){
452  // read both bitstreams
453  std::fstream refFileStream("v7_routing.bit", std::ios::binary | std::ios::in);
454  std::fstream genFileStream("v7_routing.custom.bit", std::ios::binary | std::ios::in);
455  BOOST_REQUIRE(refFileStream.good());
456  BOOST_REQUIRE(genFileStream.good());
457  Virtex7 refBitstream;
458  Virtex7 genBitstream;
459  refBitstream.read(refFileStream, false);
460  genBitstream.read(genFileStream, false);
461  // initialize frame information
462  common::DeviceDesignator designator(refBitstream.getDeviceName());
463  refBitstream.initializeDeviceInfo(designator.getDeviceName());
464  genBitstream.initializeDeviceInfo(designator.getDeviceName());
465  refBitstream.initializeFrameMaps();
466  genBitstream.initializeFrameMaps();
467  refBitstream.readFramePackets();
468  genBitstream.readFramePackets();
469  // iterate through frame block types
470  uint32_t index = 0;
471  VirtexFrameBlocks& refFrameBlocks = refBitstream.getFrameBlocks();
472  VirtexFrameBlocks& genFrameBlocks = genBitstream.getFrameBlocks();
473  for(int i = 0; i < Bitstream::eBlockTypeCount; i++) {
474  // look up the current frame sets
475  VirtexFrameSet& refFrameSet = refFrameBlocks.mBlock[i];
476  VirtexFrameSet& genFrameSet = genFrameBlocks.mBlock[i];
477  // iterate through frame sets
478  VirtexFrameSet::iterator rp = refFrameSet.begin();
479  VirtexFrameSet::iterator re = refFrameSet.end();
480  VirtexFrameSet::iterator gp = genFrameSet.begin();
481  VirtexFrameSet::iterator ge = genFrameSet.end();
482  while(rp < re && gp < ge) {
483  // look up the current frames
484  VirtexFrameSharedPtr refFrame = *rp++;
485  VirtexFrameSharedPtr genFrame = *gp++;
486  // look up the frame words
487  uint32_t length = refFrame->getLength();
488  typedef VirtexFrame::word_t word_t;
489  const word_t* refWords = refFrame->getWords();
490  const word_t* genWords = genFrame->getWords();
491  // iterate through the words
492  const word_t* refWordsEnd = refWords + length;
493  while(refWords < refWordsEnd) {
494  if(*refWords++ != *genWords++) {
495  // convert the frame index to a frame address
496  Virtex7::FrameAddress frameAddress = refBitstream.mFrameIndexToAddress[index];
497  // we found a difference in this frame
498  std::cout << " Difference in frame index " << index << ": "
499  << frameAddress << std::endl;
500  // no need to continue inspecting the frame
501  break;
502  }
503  }
504  // increment the frame index
505  index++;
506  }
507  }
508  // look up the frame set for tile INT_R_X93Y83 [277,225]
509  uint32_t beginBit;
510  uint32_t endBit;
511  uint32_t xdlRow = 277;
512  uint32_t xdlCol = 225;
513  uint32_t primaryXdlCol = refBitstream.getPrimaryXdlColumn(xdlRow, xdlCol);
514  VirtexFrameBlocks frameBlocks = refBitstream.getXdlFrames(xdlRow, primaryXdlCol, beginBit,
515  endBit, 8);
516 
517  //for(xdlRow = 1; xdlRow < 365; xdlRow += 52) {
518  // for(xdlCol = 0; xdlCol < 267; xdlCol++) {
519  // //std::cout << "[" << xdlRow << "," << xdlCol << "]" << std::endl;
520  // VirtexFrameBlocks frameBlocks = refBitstream.getXdlFrames(xdlRow, xdlCol, beginBit,
521  // endBit, 8);
522  // }
523  //}
524 }
525 #endif
526 
527 BOOST_AUTO_TEST_SUITE_END()
528 
529 
530 } //namespace bitstream
531 }//namespace torc
Header for torc::bitstream output stream helpers.
Encapsulation of a device designator and its constituent elements.
Header for the DeviceInfoHelper class.
const EFamily & getFamily(void) const
Returns the device family.
static const DeviceVector & getArtix7Devices(void)
Returns the Artix7 devices.
Definition: Devices.hpp:199
Header for the DirectoryTree class.
std::map< Virtex7::FrameAddress, uint32_t > FrameAddressToIndex
Map from frame address to frame index.
Definition: Virtex7.hpp:391
Header for the DeviceDesignator class.
FrameSet< VirtexFrame > VirtexFrameSet
Virtex frame set type.
Definition: FrameSet.hpp:73
EFarBlockType
Frame Address Register block type constants.
Definition: Virtex7.hpp:84
std::string string
Header for Boost.Test helper functions.
static const DeviceVector & getZynq7000Devices(void)
Returns the Zynq7000 devices.
Definition: Devices.hpp:201
Encapsulation of filesystem paths that are used by the library.
static const char * sPacketTypeName[ePacketTypeCount]
Configuration controller registers.
Definition: Virtex7.hpp:114
static const char * sCommandName[eCommandCount]
Configuration Command names.
Definition: Virtex7.hpp:120
Header for the Devices class.
boost::filesystem::path path
void testVirtex7Device(const std::string &inDeviceName, const boost::filesystem::path &inWorkingPath)
static const boost::filesystem::path & getWorkingPath(void)
Returns the absolute path to the working directory.
Virtex7 bitstream.
Definition: Virtex7.hpp:40
boost::shared_ptr< VirtexFrame > VirtexFrameSharedPtr
Virtex frame type.
Definition: Frame.hpp:108
static const char * sRegisterName[eRegisterCount]
Configuration Register names.
Definition: Virtex7.hpp:118
Header for the DDB class.
FrameBlocks< VirtexFrame > VirtexFrameBlocks
Virtex frame blocks type.
Definition: FrameSet.hpp:91
static const char * sOpcodeName[eOpcodeCount]
Packet Opcode names.
Definition: Virtex7.hpp:116
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.
static const DeviceVector & getVirtex7Devices(void)
Returns the Virtex7 devices.
Definition: Devices.hpp:195
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.
uint32_t getHeader(void) const
WORD_TYPE word_t
Frame word type.
Definition: Frame.hpp:48
Header for the Virtex7 class.
static const DeviceVector & getKintex7Devices(void)
Returns the Virtex7L devices.
Definition: Devices.hpp:197