torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bitstream/OutputStreamHelpers.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 Source for torc::bitstream output stream helpers.
18 
35 #include <iostream>
36 #include <iomanip>
37 
38 namespace torc {
39 namespace bitstream {
40 
41  std::ostream& operator <<(std::ostream& os, const Hex16& inWord) {
42  return os << std::hex << std::setfill('0') << std::setw(8) << inWord.mWord << std::dec;
43  }
44 
45  std::ostream& operator <<(std::ostream& os, const Hex32& inWord) {
46  return os << std::hex << std::setfill('0') << std::setw(8) << inWord.mWord << std::dec;
47  }
48 
49  std::ostream& operator <<(std::ostream& os, const Bitstream& rhs) {
50  // dispatch the various architectures
51  if(typeid(rhs) == typeid(Virtex)) {
52  os << dynamic_cast<const Virtex&>(rhs);
53  } else if(typeid(rhs) == typeid(VirtexE)) {
54  os << dynamic_cast<const VirtexE&>(rhs);
55  } else if(typeid(rhs) == typeid(Virtex2)) {
56  os << dynamic_cast<const Virtex2&>(rhs);
57  } else if(typeid(rhs) == typeid(Virtex2P)) {
58  os << dynamic_cast<const Virtex2P&>(rhs);
59  } else if(typeid(rhs) == typeid(Virtex4)) {
60  os << dynamic_cast<const Virtex4&>(rhs);
61  } else if(typeid(rhs) == typeid(Virtex5)) {
62  os << dynamic_cast<const Virtex5&>(rhs);
63  } else if(typeid(rhs) == typeid(Virtex6)) {
64  os << dynamic_cast<const Virtex6&>(rhs);
65  } else if(typeid(rhs) == typeid(Virtex7)) {
66  os << dynamic_cast<const Virtex7&>(rhs);
67  } else if(typeid(rhs) == typeid(Spartan3E)) {
68  os << dynamic_cast<const Spartan3E&>(rhs);
69  } else if(typeid(rhs) == typeid(Spartan6)) {
70  os << dynamic_cast<const Spartan6&>(rhs);
71 
72  // handle the generic bitstream header
73  } else {
74  os << "Design " << rhs.mDesignName << " (" << rhs.mDeviceName << ") @ "
75  << rhs.mDesignDate << " " << rhs.mDesignTime << ": " << rhs.mBitstreamByteLength
76  << " bytes (" << (rhs.mBitstreamByteLength >> 2) << " words)";
77  }
78  return os;
79  }
80 
81  std::ostream& operator <<(std::ostream& os, const Spartan6Bitstream& rhs) {
82  return os << "Design " << rhs.mDesignName << " (" << rhs.mDeviceName << ") @ "
83  << rhs.mDesignDate << " " << rhs.mDesignTime << ": " << rhs.mBitstreamByteLength
84  << " bytes (" << (rhs.mBitstreamByteLength >> 1) << " words)";
85  }
86 
87  // Spartan3E Output Stream
88  std::ostream& operator <<(std::ostream& os, const Spartan3E& rhs) {
89  // insert the bitstream header
90  os << static_cast<const Bitstream>(rhs) << std::endl;
91  uint32_t cumulativeWordLength = 0;
92  bool newColumn = false;
93  bool newBlock = false;
94  uint32_t oldColumnValue = 0;
95  uint32_t oldBlockValue = 0;
96  uint32_t currentColumnValue = 0;
97  uint32_t currentBlockValue = 0;
98 
99  // iterate over the packets
101  //SpartanPacketVector::const_iterator p = rhs.begin();
102  std::vector<SpartanPacket>::const_iterator p = rhs.begin();
103  //SpartanPacketVector::const_iterator e = rhs.end();
104  std::vector<SpartanPacket>::const_iterator e = rhs.end();
105  while(p < e) {
106 
107  // insert the byte address
108  os << " " << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2)) << ": ";
109  // look up the packet
110  const SpartanPacket& packet = *p++;
111  cumulativeWordLength += packet.getWordSize();
112 
113  // handle dummy words
114  if(packet.isDummyWord()) {
115  os << "DUMMY" << std::endl;
116 
117  // handle sync words
118  } else if(packet.isSyncWord()) {
119  os << "SYNC" << std::endl;
120 
121  // handle reserved packets
122  } else if(packet.isReserved()) {
123  os << Spartan3E::sOpcodeName[packet.getOpcode()] << std::endl;
124 
125  // handle NOP packets
126  } else if(packet.isNop()) {
127  int nops = 1;
128  while(p < e && p->isNop()) { nops++; p++; }
129  cumulativeWordLength += nops - 1;
130  os << "NOP x " << nops << std::endl;
131 
132  // handle regular type 1 or type 2 packets
133  } else {
134 
135  // look up the packet details
136  Spartan3E::EPacketType type = packet.getType();
137  Spartan3E::EOpcode opcode = packet.getOpcode();
138  uint32_t wordCount = packet.getWordCount();
139  const uint32_t word = packet[1];
140 
141  // account for the packet type
142  os << Spartan3E::sPacketTypeName[type];
143  switch(type) {
145  address = Spartan3E::ERegister(packet.getAddress());
146  break;
148  break;
149  default:
150  os << std::endl;
151  continue;
152  }
153 
154  // handle read packets
155  if(opcode == packet.isRead()) {
156  os << " READ " << Spartan3E::sRegisterName[address];
157 
158  // handle write packets
159  } else if(opcode == Spartan3E::eOpcodeWrite) {
160  os << " WRITE " << Spartan3E::sRegisterName[address];
161  // process according to register address
162  switch(address) {
164  os << ": " << Hex32(wordCount) << " words";
165  if(wordCount == 0) break;
166  // include the Auto CRC information
167  os << std::endl << " ";
168  os << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2))
169  << ": Auto CRC: " << Hex16(p->getHeader());
170  cumulativeWordLength += 1;
171  p++;
172  break;
174  os << " " << Spartan3E::sCommandName[word];
175  break;
177  os << ": " << Hex32(word);
179  break;
181  os << ": " << Hex32(word);
183  break;
185  os << ": " << Hex32(word);
187  break;
189  os << ": " << Hex32(word);
191  break;
192  // Added to make frame mapping debug easier
194  oldColumnValue = currentColumnValue;
195  oldBlockValue = currentBlockValue;
196  currentColumnValue = (word & Virtex::eFarMaskMajor);
197  currentBlockValue = (word & Virtex::eFarMaskBlockType);
198  newColumn = (currentColumnValue != oldColumnValue);
199  newBlock = (currentBlockValue != oldBlockValue);
200  os << ": " << Hex32(word);
201  if(newColumn) std::cout << "\t\t\t!!!New Column!!!";
202  if(newBlock) std::cout << "\t\t\t\t\t***New Block***" << Hex32(currentBlockValue);
203  break;
204  default:
205  // output the register contents
206  os << ": " << Hex32(word);
207  break;
208  }
209  os << std::endl;
210  }
211 
212  }
213 
214  }
215 
216  // return the stream reference
217  return os;
218  }
219 
220 
221  // Spartan6 Output Stream
222  std::ostream& operator <<(std::ostream& os, const Spartan6& rhs) {
223  // insert the bitstream header
224  // be careful to cast this as a Spartan6Bitstream, rather than an ordinary Bitstream
225  os << static_cast<const Spartan6Bitstream>(rhs) << std::endl;
226  uint32_t cumulativeWordLength = 0;
227 
228  // iterate over the packets
230  //SpartanPacketVector::const_iterator p = rhs.begin();
231  std::vector<Spartan6Packet>::const_iterator p = rhs.begin();
232  //SpartanPacketVector::const_iterator e = rhs.end();
233  std::vector<Spartan6Packet>::const_iterator e = rhs.end();
234  while(p < e) {
235 
236  // insert the byte address
237  os << " " << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 1)) << ": ";
238  // look up the packet
239  const Spartan6Packet& packet = *p++;
240  cumulativeWordLength += packet.getWordSize();
241 
242  // handle dummy words
243  if(packet.isDummyWord()) {
244  os << "DUMMY" << std::endl;
245 
246  // handle sync words
247  } else if(packet.isSyncWord0()) {
248  os << "SYNC0" << std::endl;
249 
250  // handle sync words
251  } else if(packet.isSyncWord1()) {
252  os << "SYNC1" << std::endl;
253 
254  // handle reserved packets
255  } else if(packet.isReserved()) {
256  os << Spartan6::sOpcodeName[packet.getOpcode()] << std::endl;
257 
258  // handle NOP packets
259  } else if(packet.isNop()) {
260  int nops = 1;
261  while(p < e && p->isNop()) { nops++; p++; }
262  cumulativeWordLength += nops - 1;
263  os << "NOP x " << nops << std::endl;
264 
265  // handle regular type 1 or type 2 packets
266  } else {
267 
268  // look up the packet details
269  Spartan6::EPacketType type = packet.getType();
270  Spartan6::EOpcode opcode = packet.getOpcode();
271  uint32_t wordCount = packet.getWordCount();
272  const uint16_t word = packet[1];
273  const uint32_t word32 = (packet[1] << 16) | packet[2];
274 
275  // account for the packet type
276  os << Spartan6::sPacketTypeName[type];
277  switch(type) {
280  address = Spartan6::ERegister(packet.getAddress());
281  break;
282  default:
283  os << std::endl;
284  continue;
285  }
286 
287  // handle read packets
288  if(opcode == packet.isRead()) {
289  os << " READ " << Spartan6::sRegisterName[address];
290 
291  // handle write packets
292  } else if(opcode == Spartan6::eOpcodeWrite) {
293  os << " WRITE " << Spartan6::sRegisterName[address];
294  // process according to register address
295  switch(address) {
297  os << " " << Spartan6::sCommandName[word];
298  break;
300  os << ": " << Hex16(word);
302  break;
304  os << ": " << Hex16(word);
306  break;
308  os << ": " << Hex16(word);
310  break;
312  os << ": " << Hex16(word);
313  Spartan6::writeSubfieldSettings(os, uint16_t(word), Spartan6::sCTL);
314  break;
316  os << ": " << Hex16(word);
318  break;
320  os << ": " << Hex16(word);
322  break;
324  os << ": " << Hex16(word);
326  break;
328  os << ": " << Hex16(word);
330  break;
332  os << ": " << Hex16(word);
334  break;
336  os << ": " << Hex16(word);
338  break;
340  os << ": " << Hex32(word32);
341  break;
343  os << ": " << Hex32(word32);
344  break;
346  os << ": " << Hex32(word32);
347  break;
349  os << ": " << Hex32(wordCount) << " words";
350  if(wordCount == 0) break;
351  // include the Auto CRC information
352  os << std::endl << " ";
353  os << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 1))
354  << ": Auto CRC: " << Hex32((uint32_t((*p)[0]) << 16) | (*p)[1]);
355  cumulativeWordLength += 2;
356  p++;
357  break;
359  // Only updates the FAR Major
360  if(wordCount == 1)
361  os << ": " << Hex16(packet[1]);
362  // Updates both the FAR Major and Minor address
363  // Word 1: FAR Major
364  // Word 2: FAR Minor
365  else if(wordCount == 2)
366  os << ": " << Hex32((uint32_t(packet[1]) << 16) | packet[2]);
367  break;
368  default:
369  // output the register contents
370  os << ": " << Hex16(word);
371  break;
372  }
373  os << std::endl;
374  }
375 
376  }
377 
378  }
379 
380  // return the stream reference
381  return os;
382  }
383 
384 
385  // Virtex Output Stream
386  std::ostream& operator <<(std::ostream& os, const Virtex& rhs) {
387  // insert the bitstream header
388  os << static_cast<const Bitstream>(rhs) << std::endl;
389  uint32_t cumulativeWordLength = 0;
390  bool newColumn = false;
391  bool newBlock = false;
392  uint32_t oldColumnValue = 0;
393  uint32_t oldBlockValue = 0;
394  uint32_t currentColumnValue = 0;
395  uint32_t currentBlockValue = 0;
396 
397  // iterate over the packets
399  VirtexPacketVector::const_iterator p = rhs.begin();
400  VirtexPacketVector::const_iterator e = rhs.end();
401  while(p < e) {
402 
403  // insert the byte address
404  os << " " << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2)) << ": ";
405  // look up the packet
406  const VirtexPacket& packet = *p++;
407  cumulativeWordLength += packet.getWordSize();
408 
409  // handle dummy words
410  if(packet.isDummyWord()) {
411  os << "DUMMY" << std::endl;
412 
413  // handle sync words
414  } else if(packet.isSyncWord()) {
415  os << "SYNC" << std::endl;
416 
417  // handle zero words
418  } else if(packet.getHeader() == 0) {
419  os << "ZERO" << std::endl;
420 
421  // handle reserved packets
422  } else if(packet.isReserved()) {
423  os << Virtex::sOpcodeName[packet.getOpcode()] << std::endl;
424 
425  /* Not used in Virtex
426  // handle NOP packets
427  } else if(packet.isNop()) {
428  int nops = 1;
429  while(p < e && p->isNop()) { nops++; p++; }
430  cumulativeWordLength += nops - 1;
431  os << "NOP x " << nops << std::endl;
432  */
433 
434  // handle regular type 1 or type 2 packets
435  } else {
436 
437  // look up the packet details
438  Virtex::EPacketType type = packet.getType();
439  Virtex::EOpcode opcode = packet.getOpcode();
440  uint32_t wordCount = packet.getWordCount();
441  const uint32_t word = packet[1];
442 
443  // account for the packet type
444  os << Virtex::sPacketTypeName[type];
445  switch(type) {
446  case Virtex::ePacketType1:
447  address = Virtex::ERegister(packet.getAddress());
448  break;
449  case Virtex::ePacketType2:
450  break;
451  default:
452  os << std::endl;
453  continue;
454  }
455 
456  // handle read packets
457  if(opcode == packet.isRead()) {
458  os << " READ " << Virtex::sRegisterName[address];
459 
460  // handle write packets
461  } else if(opcode == Virtex::eOpcodeWrite) {
462  os << " WRITE " << Virtex::sRegisterName[address];
463  // process according to register address
464  switch(address) {
466  os << ": " << Hex32(wordCount) << " words";
467  break;
468  case Virtex::eRegisterCMD:
469  os << " " << Virtex::sCommandName[word];
470  break;
472  os << ": " << Hex32(word);
473  Virtex::writeSubfieldSettings(os, uint32_t(word), Virtex::sCOR);
474  break;
476  os << ": " << Hex32(word);
477  Virtex::writeSubfieldSettings(os, uint32_t(word), Virtex::sSTAT);
478  break;
480  os << ": " << Hex32(word);
481  Virtex::writeSubfieldSettings(os, uint32_t(word), Virtex::sCTL);
482  break;
484  os << ": " << Hex32(word);
485  Virtex::writeSubfieldSettings(os, uint32_t(word), Virtex::sMASK);
486  break;
487  // Added to make frame mapping debug easier
489  oldColumnValue = currentColumnValue;
490  oldBlockValue = currentBlockValue;
491  currentColumnValue = (word & Virtex::eFarMaskMajor);
492  currentBlockValue = (word & Virtex::eFarMaskBlockType);
493  newColumn = (currentColumnValue != oldColumnValue);
494  newBlock = (currentBlockValue != oldBlockValue);
495  os << ": " << Hex32(word);
496  if(newColumn) std::cout << "\t\t\t!!!New Column!!!";
497  if(newBlock) std::cout << "\t\t\t\t\t***New Block***" << Hex32(currentBlockValue);
498  break;
499  default:
500  // output the register contents
501  os << ": " << Hex32(word);
502  break;
503  }
504  os << std::endl;
505  }
506 
507  }
508 
509  }
510 
511  // return the stream reference
512  return os;
513  }
514 
515 
516  // Virtex2 Output Stream
517  std::ostream& operator <<(std::ostream& os, const Virtex2& rhs) {
518  // insert the bitstream header
519  os << static_cast<const Bitstream>(rhs) << std::endl;
520  uint32_t cumulativeWordLength = 0;
521 
522  // iterate over the packets
524  VirtexPacketVector::const_iterator p = rhs.begin();
525  VirtexPacketVector::const_iterator e = rhs.end();
526  bool newColumn = false;
527  bool newBlock = false;
528  uint32_t oldColumnValue = 0;
529  uint32_t oldBlockValue = 0;
530  uint32_t currentColumnValue = 0;
531  uint32_t currentBlockValue = 0;
532  while(p < e) {
533 
534  // insert the byte address
535  os << " " << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2)) << ": ";
536  // look up the packet
537  const VirtexPacket& packet = *p++;
538  cumulativeWordLength += packet.getWordSize();
539 
540  // handle dummy words
541  if(packet.isDummyWord()) {
542  os << "DUMMY" << std::endl;
543 
544  // handle sync words
545  } else if(packet.isSyncWord()) {
546  os << "SYNC" << std::endl;
547 
548  // handle reserved packets
549  } else if(packet.isReserved()) {
550  os << Virtex2::sOpcodeName[packet.getOpcode()] << std::endl;
551 
552  // handle NOP packets
553  } else if(packet.isNop()) {
554  int nops = 1;
555  while(p < e && p->isNop()) { nops++; p++; }
556  cumulativeWordLength += nops - 1;
557  os << "NOP x " << nops << std::endl;
558 
559  // handle regular type 1 or type 2 packets
560  } else {
561 
562  // look up the packet details
563  Virtex2::EPacketType type = packet.getType();
564  Virtex2::EOpcode opcode = packet.getOpcode();
565  uint32_t wordCount = packet.getWordCount();
566  const uint32_t word = packet[1];
567 
568  // account for the packet type
569  os << Virtex2::sPacketTypeName[type];
570  switch(type) {
571  case Virtex2::ePacketType1:
572  address = Virtex2::ERegister(packet.getAddress());
573  break;
574  case Virtex2::ePacketType2:
575  break;
576  default:
577  os << std::endl;
578  continue;
579  }
580 
581  // handle read packets
582  if(opcode == packet.isRead()) {
583  os << " READ " << Virtex2::sRegisterName[address];
584 
585  // handle write packets
586  } else if(opcode == Virtex2::eOpcodeWrite) {
587  os << " WRITE " << Virtex2::sRegisterName[address];
588  // process according to register address
589  switch(address) {
591  os << ": " << Hex32(wordCount) << " words";
592  if(wordCount == 0) break;
593  // include the Auto CRC information
594  os << std::endl << " ";
595  os << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2))
596  << ": Auto CRC: " << Hex16(p->getHeader());
597  cumulativeWordLength += 1;
598  p++;
599  break;
600  case Virtex2::eRegisterCMD:
601  os << " " << Virtex2::sCommandName[word];
602  break;
604  os << ": " << Hex32(word);
605  Virtex2::writeSubfieldSettings(os, uint32_t(word), Virtex2::sCOR);
606  break;
608  os << ": " << Hex32(word);
609  Virtex2::writeSubfieldSettings(os, uint32_t(word), Virtex2::sSTAT);
610  break;
612  os << ": " << Hex32(word);
613  Virtex2::writeSubfieldSettings(os, uint32_t(word), Virtex2::sCTL);
614  break;
616  os << ": " << Hex32(word);
617  Virtex2::writeSubfieldSettings(os, uint32_t(word), Virtex2::sMASK);
618  break;
619  // Added to make frame mapping debug easier
621  oldColumnValue = currentColumnValue;
622  oldBlockValue = currentBlockValue;
623  currentColumnValue = (word & Virtex2::eFarMaskMajor);
624  currentBlockValue = (word & Virtex2::eFarMaskBlockType);
625  newColumn = (currentColumnValue != oldColumnValue);
626  newBlock = (currentBlockValue != oldBlockValue);
627  os << ": " << Hex32(word);
628  if(newColumn) std::cout << "\t\t\t!!!New Column!!!";
629  if(newBlock) std::cout << "\t\t\t\t\t***New Block***" << Hex32(currentBlockValue);
630  break;
631  default:
632  // output the register contents
633  os << ": " << Hex32(word);
634  break;
635  }
636  os << std::endl;
637  }
638 
639  }
640 
641  }
642 
643  // return the stream reference
644  return os;
645  }
646 
647 
648  // Virtex4 Output Stream
649  std::ostream& operator <<(std::ostream& os, const Virtex4& rhs) {
650  // insert the bitstream header
651  os << static_cast<const Bitstream>(rhs) << std::endl;
652  uint32_t cumulativeWordLength = 0;
653 
654  // iterate over the packets
656  VirtexPacketVector::const_iterator p = rhs.begin();
657  VirtexPacketVector::const_iterator e = rhs.end();
658  bool newColumn = false;
659  bool newRow = false;
660  bool newTop = false;
661  bool newBlock = false;
662  uint32_t oldColumnValue = 0;
663  uint32_t oldRowValue = 0;
664  uint32_t oldTopValue = 0;
665  uint32_t oldBlockValue = 0;
666  uint32_t currentColumnValue = 0;
667  uint32_t currentRowValue = 0;
668  uint32_t currentTopValue = 0;
669  uint32_t currentBlockValue = 0;
670  while(p < e) {
671 
672  // insert the byte address
673  os << " " << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2)) << ": ";
674  // look up the packet
675  const VirtexPacket& packet = *p++;
676  cumulativeWordLength += packet.getWordSize();
677 
678  // handle dummy words
679  if(packet.isDummyWord()) {
680  os << "DUMMY" << std::endl;
681 
682  // handle sync words
683  } else if(packet.isSyncWord()) {
684  os << "SYNC" << std::endl;
685 
686  // handle reserved packets
687  } else if(packet.isReserved()) {
688  os << Virtex4::sOpcodeName[packet.getOpcode()] << std::endl;
689 
690  // handle NOP packets
691  } else if(packet.isNop()) {
692  int nops = 1;
693  while(p < e && p->isNop()) { nops++; p++; }
694  cumulativeWordLength += nops - 1;
695  os << "NOP x " << nops << std::endl;
696 
697  // handle regular type 1 or type 2 packets
698  } else {
699 
700  // look up the packet details
701  Virtex4::EPacketType type = packet.getType();
702  Virtex4::EOpcode opcode = packet.getOpcode();
703  uint32_t wordCount = packet.getWordCount();
704  const uint32_t word = packet[1];
705 
706  // account for the packet type
707  os << Virtex4::sPacketTypeName[type];
708  switch(type) {
709  case Virtex4::ePacketType1:
710  address = Virtex4::ERegister(packet.getAddress());
711  break;
712  case Virtex4::ePacketType2:
713  break;
714  default:
715  os << std::endl;
716  continue;
717  }
718 
719  // handle read packets
720  if(opcode == packet.isRead()) {
721  os << " READ " << Virtex4::sRegisterName[address];
722 
723  // handle write packets
724  } else if(opcode == Virtex4::eOpcodeWrite) {
725  os << " WRITE " << Virtex4::sRegisterName[address];
726  // process according to register address
727  switch(address) {
729  os << ": " << Hex32(wordCount) << " words";
730  break;
731  case Virtex4::eRegisterCMD:
732  os << " " << Virtex4::sCommandName[word];
733  break;
735  os << ": " << Hex32(word);
736  Virtex4::writeSubfieldSettings(os, uint32_t(word), Virtex4::sCOR);
737  break;
739  os << ": " << Hex32(word);
740  Virtex4::writeSubfieldSettings(os, uint32_t(word), Virtex4::sSTAT);
741  break;
743  os << ": " << Hex32(word);
744  Virtex4::writeSubfieldSettings(os, uint32_t(word), Virtex4::sCTL);
745  break;
747  os << ": " << Hex32(word);
748  Virtex4::writeSubfieldSettings(os, uint32_t(word), Virtex4::sMASK);
749  break;
750  // Added to make frame mapping debug easier
752  oldColumnValue = currentColumnValue;
753  oldRowValue = currentRowValue;
754  oldTopValue = currentTopValue;
755  oldBlockValue = currentBlockValue;
756  currentColumnValue = (word & Virtex6::eFarMaskMajor);
757  currentRowValue = (word & Virtex6::eFarMaskRow);
758  currentTopValue = (word & Virtex6::eFarMaskTopBottom);
759  currentBlockValue = (word & Virtex6::eFarMaskBlockType);
760  newColumn = (currentColumnValue != oldColumnValue);
761  newRow = (currentRowValue != oldRowValue);
762  newTop = (currentTopValue != oldTopValue);
763  newBlock = (currentBlockValue != oldBlockValue);
764  os << ": " << Hex32(word);
765  if(newColumn) std::cout << "\t\t\t!!!New Column!!!";
766  if(newRow) std::cout << "\t\t\t$$$New Row$$$";
767  if(newTop) std::cout << "\t\t\t&&&New Top&&&";
768  if(newBlock) std::cout << "\t\t\t\t\t***New Block***" << Hex32(currentBlockValue);
769  break;
770  default:
771  // output the register contents
772  os << ": " << Hex32(word);
773  break;
774  }
775  os << std::endl;
776  }
777 
778  }
779 
780  }
781 
782  // return the stream reference
783  return os;
784  }
785 
786  // Virtex5 Output Stream
787  std::ostream& operator <<(std::ostream& os, const Virtex5& rhs) {
788  // insert the bitstream header
789  os << static_cast<const Bitstream>(rhs) << std::endl;
790  uint32_t cumulativeWordLength = 0;
791 
792  // iterate over the packets
794  VirtexPacketVector::const_iterator p = rhs.begin();
795  VirtexPacketVector::const_iterator e = rhs.end();
796  bool synchronized = false;
797  bool newColumn = false;
798  bool newRow = false;
799  bool newTop = false;
800  bool newBlock = false;
801  uint32_t oldColumnValue = 0;
802  uint32_t oldRowValue = 0;
803  uint32_t oldTopValue = 0;
804  uint32_t oldBlockValue = 0;
805  uint32_t currentColumnValue = 0;
806  uint32_t currentRowValue = 0;
807  uint32_t currentTopValue = 0;
808  uint32_t currentBlockValue = 0;
809  while(p < e) {
810 
811  // insert the byte address
812  os << " " << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2)) << ": ";
813  // look up the packet
814  const VirtexPacket& packet = *p++;
815  cumulativeWordLength += packet.getWordSize();
816 
817  // catch bus sync words
818  if(!synchronized) {
819  if(packet.isBusWidthSyncWord()) {
820  os << "BUS WIDTH SYNC" << std::endl;
821  continue;
822  } else if(packet.isBusWidthDetectWord()) {
823  os << "BUS WIDTH DETECT" << std::endl;
824  continue;
825  }
826  }
827 
828  // handle dummy words
829  if(packet.isDummyWord()) {
830  os << "DUMMY" << std::endl;
831 
832  // handle sync words
833  } else if(packet.isSyncWord()) {
834  os << "SYNC" << std::endl;
835 
836  // handle reserved packets
837  } else if(packet.isReserved()) {
838  os << Virtex5::sOpcodeName[packet.getOpcode()] << std::endl;
839 
840  // handle NOP packets
841  } else if(packet.isNop()) {
842  int nops = 1;
843  while(p < e && p->isNop()) { nops++; p++; }
844  cumulativeWordLength += nops - 1;
845  os << "NOP x " << nops << std::endl;
846 
847  // handle regular type 1 or type 2 packets
848  } else {
849 
850  // look up the packet details
851  Virtex5::EPacketType type = packet.getType();
852  Virtex5::EOpcode opcode = packet.getOpcode();
853  uint32_t wordCount = packet.getWordCount();
854  const uint32_t word = packet[1];
855  // account for the packet type
856  os << Virtex5::sPacketTypeName[type];
857  switch(type) {
858  case Virtex5::ePacketType1:
859  address = Virtex5::ERegister(packet.getAddress());
860  break;
861  case Virtex5::ePacketType2:
862  break;
863  default:
864  os << std::endl;
865  continue;
866  }
867 
868  // handle read packets
869  if(opcode == packet.isRead()) {
870  os << " READ " << Virtex5::sRegisterName[address];
871 
872  // handle write packets
873  } else if(opcode == Virtex5::eOpcodeWrite) {
874  os << " WRITE " << Virtex5::sRegisterName[address];
875  // process according to register address
876  switch(address) {
878  os << ": " << Hex32(wordCount) << " words";
879  break;
880  case Virtex5::eRegisterCMD:
881  os << " " << Virtex5::sCommandName[word];
882  break;
884  os << ": " << Hex32(word);
885  Virtex5::writeSubfieldSettings(os, (uint32_t) word, Virtex5::sCOR0);
886  break;
888  os << ": " << Hex32(word);
889  Virtex5::writeSubfieldSettings(os, (uint32_t) word, Virtex5::sCOR1);
890  break;
892  os << ": " << Hex32(word);
893  Virtex5::writeSubfieldSettings(os, (uint32_t) word, Virtex5::sSTAT);
894  break;
896  os << ": " << Hex32(word);
897  Virtex5::writeSubfieldSettings(os, (uint32_t) word, Virtex5::sCTL0);
898  break;
900  os << ": " << Hex32(word);
901  Virtex5::writeSubfieldSettings(os, (uint32_t) word, Virtex5::sCTL1);
902  break;
904  os << ": " << Hex32(word);
905  // we need to snoop the next packet, because the documented mask subfields
906  // apply to CTL0 only, and not to CTL1 which is completely undefined
907  if(p < e) {
908  const VirtexPacket& nextPacket = *p;
909  if(nextPacket.isType1() && nextPacket.isWrite()
910  && nextPacket.getAddress() == Virtex5::eRegisterCTL1) {
911  os << " ()";
912  break;
913  }
914  }
915  Virtex5::writeSubfieldSettings(os, (uint32_t) word, Virtex5::sMASK0);
916  break;
918  os << ": " << Hex32(word);
919  Virtex5::writeSubfieldSettings(os, (uint32_t) word, Virtex5::sWBSTAR);
920  break;
922  os << ": " << Hex32(word);
923  Virtex5::writeSubfieldSettings(os, (uint32_t) word, Virtex5::sTIMER);
924  break;
925  // Added to make frame mapping debug easier
927  oldColumnValue = currentColumnValue;
928  oldRowValue = currentRowValue;
929  oldTopValue = currentTopValue;
930  oldBlockValue = currentBlockValue;
931  currentColumnValue = (word & Virtex5::eFarMaskMajor);
932  currentRowValue = (word & Virtex5::eFarMaskRow);
933  currentTopValue = (word & Virtex5::eFarMaskTopBottom);
934  currentBlockValue = (word & Virtex5::eFarMaskBlockType);
935  newColumn = (currentColumnValue != oldColumnValue);
936  newRow = (currentRowValue != oldRowValue);
937  newTop = (currentTopValue != oldTopValue);
938  newBlock = (currentBlockValue != oldBlockValue);
939  os << ": " << Hex32(word);
940  if(newColumn) std::cout << "\t\t\t!!!New Column!!!";
941  if(newRow) std::cout << "\t\t\t$$$New Row$$$";
942  if(newTop) std::cout << "\t\t\t&&&New Top&&&";
943  if(newBlock) std::cout << "\t\t\t\t\t***New Block***" << Hex32(currentBlockValue);
944  break;
945  default:
946  // output the register contents
947  os << ": " << Hex32(word);
948  break;
949  }
950 
951  os << std::endl;
952  }
953 
954  }
955 
956  }
957 
958  // return the stream reference
959  return os;
960  }
961 
962  // Virtex6 Output Stream
963  std::ostream& operator <<(std::ostream& os, const Virtex6& rhs) {
964  // insert the bitstream header
965  os << static_cast<const Bitstream>(rhs) << std::endl;
966  uint32_t cumulativeWordLength = 0;
967 
968  // iterate over the packets
970  VirtexPacketVector::const_iterator p = rhs.begin();
971  VirtexPacketVector::const_iterator e = rhs.end();
972  bool newColumn = false;
973  bool newRow = false;
974  bool newTop = false;
975  bool newBlock = false;
976  uint32_t oldColumnValue = 0;
977  uint32_t oldRowValue = 0;
978  uint32_t oldTopValue = 0;
979  uint32_t oldBlockValue = 0;
980  uint32_t currentColumnValue = 0;
981  uint32_t currentRowValue = 0;
982  uint32_t currentTopValue = 0;
983  uint32_t currentBlockValue = 0;
984  bool synchronized = false;
985  while(p < e) {
986 
987  // insert the byte address
988  os << " " << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2)) << ": ";
989  // look up the packet
990  const VirtexPacket& packet = *p++;
991  cumulativeWordLength += packet.getWordSize();
992 
993  // catch bus sync words
994  if(!synchronized) {
995  if(packet.isBusWidthSyncWord()) {
996  os << "BUS WIDTH SYNC" << std::endl;
997  continue;
998  } else if(packet.isBusWidthDetectWord()) {
999  os << "BUS WIDTH DETECT" << std::endl;
1000  continue;
1001  }
1002  }
1003 
1004  // handle dummy words
1005  if(packet.isDummyWord()) {
1006  os << "DUMMY" << std::endl;
1007 
1008  // handle sync words
1009  } else if(packet.isSyncWord()) {
1010  os << "SYNC" << std::endl;
1011 
1012  // handle reserved packets
1013  } else if(packet.isReserved()) {
1014  os << Virtex6::sOpcodeName[packet.getOpcode()] << std::endl;
1015 
1016  // handle NOP packets
1017  } else if(packet.isNop()) {
1018  int nops = 1;
1019  while(p < e && p->isNop()) { nops++; p++; }
1020  cumulativeWordLength += nops - 1;
1021  os << "NOP x " << nops << std::endl;
1022 
1023  // handle regular type 1 or type 2 packets
1024  } else {
1025 
1026  // look up the packet details
1027  Virtex6::EPacketType type = packet.getType();
1028  Virtex6::EOpcode opcode = packet.getOpcode();
1029  uint32_t wordCount = packet.getWordCount();
1030  const uint32_t word = packet[1];
1031  // account for the packet type
1032  os << Virtex6::sPacketTypeName[type];
1033  switch(type) {
1034  case Virtex6::ePacketType1:
1035  address = Virtex6::ERegister(packet.getAddress());
1036  break;
1037  case Virtex6::ePacketType2:
1038  break;
1039  default:
1040  os << std::endl;
1041  continue;
1042  }
1043 
1044  // handle read packets
1045  if(opcode == packet.isRead()) {
1046  os << " READ " << Virtex6::sRegisterName[address];
1047 
1048  // handle write packets
1049  } else if(opcode == Virtex6::eOpcodeWrite) {
1050  os << " WRITE " << Virtex6::sRegisterName[address];
1051  // process according to register address
1052  switch(address) {
1054  os << ": " << Hex32(wordCount) << " words";
1055  break;
1056  case Virtex6::eRegisterCMD:
1057  os << " " << Virtex6::sCommandName[word];
1058  break;
1060  os << ": " << Hex32(word);
1061  Virtex6::writeSubfieldSettings(os, (uint32_t) word, Virtex6::sCOR0);
1062  break;
1064  os << ": " << Hex32(word);
1065  Virtex6::writeSubfieldSettings(os, (uint32_t) word, Virtex6::sCOR1);
1066  break;
1068  os << ": " << Hex32(word);
1069  Virtex6::writeSubfieldSettings(os, (uint32_t) word, Virtex6::sSTAT);
1070  break;
1072  os << ": " << Hex32(word);
1073  Virtex6::writeSubfieldSettings(os, (uint32_t) word, Virtex6::sCTL0);
1074  break;
1076  os << ": " << Hex32(word);
1077  Virtex6::writeSubfieldSettings(os, (uint32_t) word, Virtex6::sCTL1);
1078  break;
1080  os << ": " << Hex32(word);
1081  // we need to snoop the next packet, because the documented mask subfields
1082  // apply to CTL0 only, and not to CTL1 which is completely undefined
1083  if(p < e) {
1084  const VirtexPacket& nextPacket = *p;
1085  if(nextPacket.isType1() && nextPacket.isWrite()
1086  && nextPacket.getAddress() == Virtex6::eRegisterCTL1) {
1087  os << " ()";
1088  break;
1089  }
1090  }
1091  Virtex6::writeSubfieldSettings(os, (uint32_t) word, Virtex6::sMASK0);
1092  break;
1094  os << ": " << Hex32(word);
1095  Virtex6::writeSubfieldSettings(os, (uint32_t) word, Virtex6::sWBSTAR);
1096  break;
1098  os << ": " << Hex32(word);
1099  Virtex6::writeSubfieldSettings(os, (uint32_t) word, Virtex6::sTIMER);
1100  break;
1101  // Added to make frame mapping debug easier
1103  oldColumnValue = currentColumnValue;
1104  oldRowValue = currentRowValue;
1105  oldTopValue = currentTopValue;
1106  oldBlockValue = currentBlockValue;
1107  currentColumnValue = (word & Virtex6::eFarMaskMajor);
1108  currentRowValue = (word & Virtex6::eFarMaskRow);
1109  currentTopValue = (word & Virtex6::eFarMaskTopBottom);
1110  currentBlockValue = (word & Virtex6::eFarMaskBlockType);
1111  newColumn = (currentColumnValue != oldColumnValue);
1112  newRow = (currentRowValue != oldRowValue);
1113  newTop = (currentTopValue != oldTopValue);
1114  newBlock = (currentBlockValue != oldBlockValue);
1115  os << ": " << Hex32(word);
1116  if(newColumn) std::cout << "\t\t\t!!!New Column!!!";
1117  if(newRow) std::cout << "\t\t\t$$$New Row$$$";
1118  if(newTop) std::cout << "\t\t\t&&&New Top&&&";
1119  if(newBlock) std::cout << "\t\t\t\t\t***New Block***" << Hex32(currentBlockValue);
1120  break;
1121  default:
1122  // output the register contents
1123  os << ": " << Hex32(word);
1124  break;
1125  }
1126 
1127  os << std::endl;
1128  }
1129 
1130  }
1131 
1132  }
1133 
1134  // return the stream reference
1135  return os;
1136  }
1137 
1138  // Virtex7 Output Stream
1139  std::ostream& operator <<(std::ostream& os, const Virtex7& rhs) {
1140  // insert the bitstream header
1141  os << static_cast<const Bitstream>(rhs) << std::endl;
1142  uint32_t cumulativeWordLength = 0;
1143 
1144  // iterate over the packets
1146  VirtexPacketVector::const_iterator p = rhs.begin();
1147  VirtexPacketVector::const_iterator e = rhs.end();
1148  bool synchronized = false;
1149  bool newColumn = false;
1150  bool newRow = false;
1151  bool newTop = false;
1152  bool newBlock = false;
1153  uint32_t oldColumnValue = 0;
1154  uint32_t oldRowValue = 0;
1155  uint32_t oldTopValue = 0;
1156  uint32_t oldBlockValue = 0;
1157  uint32_t currentColumnValue = 0;
1158  uint32_t currentRowValue = 0;
1159  uint32_t currentTopValue = 0;
1160  uint32_t currentBlockValue = 0;
1161  while(p < e) {
1162 
1163  // insert the byte address
1164  os << " " << Hex32(rhs.getHeaderByteLength() + (cumulativeWordLength << 2)) << ": ";
1165  // look up the packet
1166  const VirtexPacket& packet = *p++;
1167  cumulativeWordLength += packet.getWordSize();
1168 
1169  // catch bus sync words
1170  if(!synchronized) {
1171  if(packet.isBusWidthSyncWord()) {
1172  os << "BUS WIDTH SYNC" << std::endl;
1173  continue;
1174  } else if(packet.isBusWidthDetectWord()) {
1175  os << "BUS WIDTH DETECT" << std::endl;
1176  continue;
1177  }
1178  }
1179 
1180  // handle dummy words
1181  if(packet.isDummyWord()) {
1182  os << "DUMMY" << std::endl;
1183 
1184  // handle sync words
1185  } else if(packet.isSyncWord()) {
1186  os << "SYNC" << std::endl;
1187 
1188  // handle reserved packets
1189  } else if(packet.isReserved()) {
1190  os << Virtex7::sOpcodeName[packet.getOpcode()] << std::endl;
1191 
1192  // handle NOP packets
1193  } else if(packet.isNop()) {
1194  int nops = 1;
1195  while(p < e && p->isNop()) { nops++; p++; }
1196  cumulativeWordLength += nops - 1;
1197  os << "NOP x " << nops << std::endl;
1198 
1199  // handle regular type 1 or type 2 packets
1200  } else {
1201 
1202  // look up the packet details
1203  Virtex7::EPacketType type = packet.getType();
1204  Virtex7::EOpcode opcode = packet.getOpcode();
1205  uint32_t wordCount = packet.getWordCount();
1206  const uint32_t word = packet[1];
1207  // account for the packet type
1208  os << Virtex7::sPacketTypeName[type];
1209  switch(type) {
1210  case Virtex7::ePacketType1:
1211  address = Virtex7::ERegister(packet.getAddress());
1212  break;
1213  case Virtex7::ePacketType2:
1214  break;
1215  default:
1216  os << std::endl;
1217  continue;
1218  }
1219 
1220  // handle read packets
1221  if(opcode == packet.isRead()) {
1222  os << " READ " << Virtex7::sRegisterName[address];
1223 
1224  // handle write packets
1225  } else if(opcode == Virtex7::eOpcodeWrite) {
1226  os << " WRITE " << Virtex7::sRegisterName[address];
1227  // process according to register address
1228  switch(address) {
1230  os << ": " << Hex32(wordCount) << " words";
1231  break;
1232  case Virtex7::eRegisterCMD:
1233  os << " " << Virtex7::sCommandName[word];
1234  break;
1236  os << ": " << Hex32(word);
1237  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sCOR0);
1238  break;
1240  os << ": " << Hex32(word);
1241  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sCOR1);
1242  break;
1244  os << ": " << Hex32(word);
1245  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sSTAT);
1246  break;
1248  os << ": " << Hex32(word);
1249  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sCTL0);
1250  break;
1252  os << ": " << Hex32(word);
1253  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sCTL1);
1254  break;
1256  os << ": " << Hex32(word);
1257  // we need to snoop the next packet, because the documented mask subfields
1258  // apply to CTL0 only, and not to CTL1 which is completely undefined
1259  if(p < e) {
1260  const VirtexPacket& nextPacket = *p;
1261  if(nextPacket.isType1() && nextPacket.isWrite()
1262  && nextPacket.getAddress() == Virtex7::eRegisterCTL1) {
1263  os << " ()";
1264  break;
1265  }
1266  }
1267  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sMASK0);
1268  break;
1270  os << ": " << Hex32(word);
1271  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sWBSTAR);
1272  break;
1274  os << ": " << Hex32(word);
1275  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sTIMER);
1276  break;
1278  os << ": " << Hex32(word);
1279  Virtex7::writeSubfieldSettings(os, (uint32_t) word, Virtex7::sBOOTSTS);
1280  break;
1281  // Added to make frame mapping debug easier
1283  oldColumnValue = currentColumnValue;
1284  oldRowValue = currentRowValue;
1285  oldTopValue = currentTopValue;
1286  oldBlockValue = currentBlockValue;
1287  currentColumnValue = (word & Virtex7::eFarMaskMajor);
1288  currentRowValue = (word & Virtex7::eFarMaskRow);
1289  currentTopValue = (word & Virtex7::eFarMaskTopBottom);
1290  currentBlockValue = (word & Virtex7::eFarMaskBlockType);
1291  newColumn = (currentColumnValue != oldColumnValue);
1292  newRow = (currentRowValue != oldRowValue);
1293  newTop = (currentTopValue != oldTopValue);
1294  newBlock = (currentBlockValue != oldBlockValue);
1295  os << ": " << Hex32(word);
1296  if(newColumn) std::cout << "\t\t\t!!!New Column!!!";
1297  if(newRow) std::cout << "\t\t\t$$$New Row$$$";
1298  if(newTop) std::cout << "\t\t\t&&&New Top&&&";
1299  if(newBlock) std::cout << "\t\t\t\t\t***New Block***" << Hex32(currentBlockValue);
1300  break;
1301  default:
1302  // output the register contents
1303  os << ": " << Hex32(word);
1304  break;
1305  }
1306 
1307  os << std::endl;
1308  }
1309 
1310  }
1311 
1312  }
1313 
1314  // return the stream reference
1315  return os;
1316  }
1317 
1318 
1319 } // namespace bitstream
1320 } // namespace torc
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Definition: Spartan3E.hpp:87
static const Subfield sMASK0[]
Control Mask Register (MASK) subfields.
Definition: Virtex5.hpp:134
Header for torc::bitstream output stream helpers.
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Definition: Virtex6.hpp:114
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Definition: Virtex4.hpp:101
static const Subfield sMASK[]
Control Mask Register (MASK) subfields.
Definition: Spartan3E.hpp:99
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Definition: Virtex2.hpp:88
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
Definition: Virtex6.hpp:112
Header for the SpartanPacket class.
Header for the VirtexE class.
ERegister
Configuration register enumeration.
Definition: Virtex.hpp:55
static const char * sRegisterName[eRegisterCount]
Configuration register names.
Definition: Spartan3E.hpp:89
static const char * sCommandName[eCommandCount]
Configuration command names.
Definition: Spartan6.hpp:94
Header for the Spartan6Bitstream class.
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Definition: Spartan6.hpp:90
ERegister
Configuration register enumeration.
Definition: Virtex4.hpp:56
EOpcode getOpcode(void) const
uint32_t getWordCount(void) const
Returns the number of payload words in the packet, excluding the header word.
Header for the Virtex4 class.
EPacketType getType(void) const
static const char * sRegisterName[eRegisterCount]
Configuration register names.
Definition: Virtex6.hpp:116
std::ostream & operator<<(std::ostream &os, const Hex16 &inWord)
16-bit word hex inserter.
string mDesignDate
Header design date.
Header for the Virtex2P class.
string mDesignTime
Header design time.
static const char * sCommandName[eCommandCount]
Configuration command names.
Definition: Spartan3E.hpp:91
static const Subfield sMASK[]
Control Mask Register (MASK) subfields.
Definition: Spartan6.hpp:104
static const Subfield sCTL[]
Control Register (CTL) subfields.
Definition: Spartan3E.hpp:97
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Definition: Virtex.hpp:87
static const char * sRegisterName[eRegisterCount]
Configuration register names.
Definition: Virtex5.hpp:120
Virtex6 bitstream.
Definition: Virtex6.hpp:41
EOpcode
Packet opcode enumeration.
static const Subfield sCOR2[]
Configuration Options Register 2 (COR2) subfields.
Definition: Spartan6.hpp:98
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
Definition: Spartan3E.hpp:85
Header for the Virtex6 class.
static const Subfield sCOR0[]
Configuration Options Register 0 (COR) subfields.
Definition: Virtex5.hpp:124
static const Subfield sTIMER[]
Watchdog Timer Register (TIMER) subfields.
Definition: Virtex5.hpp:138
string mDesignName
Header design name.
Bitstream packet for Spartan 16 bit class architectures.
Header for the Virtex5 class.
static const Subfield sCOR1[]
Configuration Options Register 1 (COR) subfields.
Definition: Virtex5.hpp:126
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
Definition: Virtex4.hpp:99
uint32_t getWordSize(void) const
Returns the total number of words in the packet, including the header word.
EPacketType getType(void) const
static const char * sRegisterName[eRegisterCount]
Configuration register names.
Definition: Virtex.hpp:89
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Definition: Virtex5.hpp:128
static const Subfield sCOR0[]
Configuration Options Register 0 (COR) subfields.
Definition: Virtex6.hpp:120
static const Subfield sCTL[]
Control Register 0 (CTL0) subfields.
Definition: Spartan6.hpp:102
static const Subfield sMASK0[]
Control Mask Register (MASK) subfields.
Definition: Virtex7.hpp:132
static const Subfield sMODE_REG[]
Mode Register (Mode) subfields.
Definition: Spartan6.hpp:110
static const Subfield sMASK0[]
Control Mask Register (MASK) subfields.
Definition: Virtex6.hpp:130
ERegister
Configuration register enumeration.
Definition: Virtex5.hpp:56
Virtex2 bitstream.
Definition: Virtex2.hpp:40
static const char * sCommandName[eCommandCount]
Configuration command names.
Definition: Virtex4.hpp:105
static const Subfield sCTL[]
Control Register (CTL) subfields.
Definition: Virtex4.hpp:111
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Definition: Virtex7.hpp:126
static const Subfield sBOOTSTS[]
Boot History Status Register (BOOTSTS) subfields.
Definition: Virtex7.hpp:138
uint32_t getWordCount(void) const
Returns the number of payload words in the packet, excluding the header word.
ERegister
Configuration register enumeration.
Definition: Virtex7.hpp:55
static const Subfield sTIMER[]
Watchdog Timer Register (TIMER) subfields.
Definition: Virtex7.hpp:136
static const Subfield sCOR1[]
Configuration Options Register 1 (COR) subfields.
Definition: Virtex6.hpp:122
ERegister
Configuration register enumeration.
Definition: Virtex2.hpp:55
static const char * sCommandName[eCommandCount]
Configuration command names.
Definition: Virtex6.hpp:118
static const char * sRegisterName[eRegisterCount]
Configuration register names.
Definition: Virtex4.hpp:103
Header for the Spartan6 class.
static const Subfield sCTL1[]
Control Register 1 (CTL) subfields.
Definition: Virtex5.hpp:132
Virtex5 bitstream.
Definition: Virtex5.hpp:41
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Definition: Virtex2.hpp:96
uint32_t getWordSize(void) const
Returns the total number of words in the packet, including the header word. In the case of Type 2 pa...
static const Subfield sCOR[]
Configuration Options Register (COR) subfields.
Definition: Spartan3E.hpp:93
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
Definition: Virtex5.hpp:116
Xilinx bitstream base class.
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Definition: Virtex4.hpp:109
EPacketType
Packet type enumeration.
EOpcode
Packet opcode enumeration.
static const Subfield sWBSTAR[]
Warm Boot Start Address Register (WBSTAR) subfields.
Definition: Virtex7.hpp:134
static const Subfield sCTL1[]
Control Register 1 (CTL) subfields.
Definition: Virtex6.hpp:128
string mDeviceName
Header device name.
static const char * sRegisterName[eRegisterCount]
Configuration register names.
Definition: Spartan6.hpp:92
static const Subfield sCOR1[]
Configurations Options Register 1 (COR) subfields.
Definition: Virtex7.hpp:124
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Definition: Virtex5.hpp:118
ERegister
Configuration register enumeration.
Definition: Virtex6.hpp:56
Header for the Bitstream class.
static void writeSubfieldSettings(std::ostream &inStream, uint32_t inWord, const Subfield *inSubfields)
Insert 32 bit subfield settings into an output stream.
Definition: Bitstream.cpp:26
static const Subfield sCOR[]
Configuration Options Register (COR) subfields.
Definition: Virtex.hpp:93
bool isBusWidthSyncWord(void) const
static const char * sCommandName[eCommandCount]
Configuration command names.
Definition: Virtex5.hpp:122
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
Definition: Spartan6.hpp:88
static const char * sPacketTypeName[ePacketTypeCount]
Configuration controller registers.
Definition: Virtex7.hpp:114
static const char * sCommandName[eCommandCount]
Configuration Command names.
Definition: Virtex7.hpp:120
static const Subfield sMASK[]
Control Mask Register (MASK) subfields.
Definition: Virtex.hpp:99
static const Subfield sHC_OPT_REG[]
HC_OPT_REG Register (PWRDN_REG) subfields.
Definition: Spartan6.hpp:108
uint32_t mBitstreamByteLength
Bitstream packet length in bytes.
static const Subfield sSEU_OPT[]
SEU_OPT Register (SEU_OPT) subfields.
Definition: Spartan6.hpp:114
Header for the Spartan6Packet class.
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Definition: Virtex6.hpp:124
static const Subfield sCOR1[]
Configuration Options Register 1 (COR1) subfields.
Definition: Spartan6.hpp:96
static const Subfield sMASK[]
Control Mask Register (MASK) subfields.
Definition: Virtex4.hpp:113
Spartan6 bitstream.
Definition: Spartan6.hpp:31
Virtex4 bitstream.
Definition: Virtex4.hpp:40
static const Subfield sCTL1[]
Control Register 1 (CTL) subfields.
Definition: Virtex7.hpp:130
ERegister
Configuration register enumeration.
Definition: Spartan6.hpp:43
static const Subfield sBOOSTS[]
BOOSTS Register (BOOSTS) subfields.
Definition: Spartan6.hpp:112
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Definition: Virtex.hpp:95
Header for the Virtex class.
static const Subfield sWBSTAR[]
Warm Boot Start Address Register (WBSTAR) subfields.
Definition: Virtex5.hpp:136
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Definition: Spartan6.hpp:100
Header for the VirtexPacket class.
Virtex bitstream.
Definition: Virtex.hpp:40
Virtex7 bitstream.
Definition: Virtex7.hpp:40
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Definition: Spartan3E.hpp:95
static const char * sCommandName[eCommandCount]
Configuration command names.
Definition: Virtex2.hpp:92
static const Subfield sCOR[]
Configuration Options Register (COR) subfields.
Definition: Virtex4.hpp:107
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
Definition: Virtex.hpp:85
static const char * sRegisterName[eRegisterCount]
Configuration Register names.
Definition: Virtex7.hpp:118
VirtexE bitstream inherited from Virtex bitstream.
Definition: VirtexE.hpp:37
EOpcode getOpcode(void) const
static const Subfield sCTL0[]
Control Register 0 (CTL) subfields.
Definition: Virtex7.hpp:128
static const char * sOpcodeName[eOpcodeCount]
Packet Opcode names.
Definition: Virtex7.hpp:116
Header for the Virtex2 class.
EPacketType
Packet type enumeration.
EPacketType getType(void) const
bool isBusWidthDetectWord(void) const
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
Definition: Virtex2.hpp:86
Header for the Spartan3E class.
Spartan3E bitstream.
Definition: Spartan3E.hpp:38
static const Subfield sCTL[]
Control Register (CTL) subfields.
Definition: Virtex.hpp:97
Bitstream packet for Spartan class architectures.
Bitstream packet for Virtex class architectures.
static const Subfield sCTL0[]
Control Register 0 (CTL) subfields.
Definition: Virtex6.hpp:126
uint32_t getWordSize(void) const
Returns the total number of words in the packet, including the header word.
static const Subfield sPWRDN_REG[]
Suspend Register (PWRDN_REG) subfields.
Definition: Spartan6.hpp:106
static const Subfield sWBSTAR[]
Warm Boot Start Address Register (WBSTAR) subfields.
Definition: Virtex6.hpp:132
static const char * sRegisterName[eRegisterCount]
Configuration register names.
Definition: Virtex2.hpp:90
ERegister
Configuration register enumeration.
Definition: Spartan3E.hpp:52
static const char * sCommandName[eCommandCount]
Configuration command names.
Definition: Virtex.hpp:91
Virtex2P bitstream inherited from Virtex2 bitstream.
Definition: Virtex2P.hpp:37
uint32_t getWordCount(void) const
Returns the number of payload words in the packet, excluding the header word.
static const Subfield sCTL[]
Control Register (CTL) subfields.
Definition: Virtex2.hpp:98
uint32_t getHeader(void) const
static const Subfield sCOR0[]
Configurations Options Register 0 (COR) subfields.
Definition: Virtex7.hpp:122
static const Subfield sCOR[]
Configuration Options Register (COR) subfields.
Definition: Virtex2.hpp:94
static const Subfield sMASK[]
Control Mask Register (MASK) subfields.
Definition: Virtex2.hpp:100
static const Subfield sTIMER[]
Watchdog Timer Register (TIMER) subfields.
Definition: Virtex6.hpp:134
Header for the Virtex7 class.
static const Subfield sCTL0[]
Control Register 0 (CTL) subfields.
Definition: Virtex5.hpp:130
uint32_t getHeaderByteLength(void) const
Return the bitstream header length in bytes.