byteman  1.3 (Build #225)
Bitstream relocation and manipulation tool
Macros | Enumerations | Functions
inlineCAP.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FABRIC_SYNC_WORD   0xAA995566
 

Enumerations

enum class  DONE_CYCLE {
  Phase1 = 0 , Phase2 = 1 , Phase3 = 2 , Phase4 = 3 ,
  Phase5 = 4 , Phase6 = 5
}
 
enum class  GTS_CYCLE {
  Phase1 = 0 , Phase2 = 1 , Phase3 = 2 , Phase4 = 3 ,
  Phase5 = 4 , Phase6 = 5 , GTS_DONE = 6
}
 
enum class  GWE_CYCLE {
  Phase1 = 0 , Phase2 = 1 , Phase3 = 2 , Phase4 = 3 ,
  Phase5 = 4 , Phase6 = 5 , GWE_DONE = 6
}
 
enum class  LOCK_CYCLE {
  Phase0 = 0 , Phase1 = 1 , Phase2 = 2 , Phase3 = 3 ,
  Phase4 = 4 , Phase5 = 5 , Phase6 = 6 , NoWait = 7
}
 
enum class  MATCH_CYCLE {
  Phase0 = 0 , Phase1 = 1 , Phase2 = 2 , Phase3 = 3 ,
  Phase4 = 4 , Phase5 = 5 , Phase6 = 6 , NoWait = 7
}
 

Functions

XCAP::Command getXCAPcommand (std::string s)
 
XCAP::Register getXCAPregister (std::string s)
 
void writeXCAPcommandName (std::ofstream &fout, XCAP::Command commandID)
 
void writeXCAPregisterName (std::ofstream &fout, XCAP::Register registerID)
 
uint32_t XCAP_getCOR0value (int Reserved_31_27, int ECLK_EN, int Reserved_25, int DRIVE_DONE, int Reserved_23, int OSCFSEL, int Reserved_16_15, DONE_CYCLE selDONE_CYCLE, MATCH_CYCLE selMATCH_CYCLE, LOCK_CYCLE selLOCK_CYCLE, GTS_CYCLE selGTS_CYCLE, GWE_CYCLE selGWE_CYCLE)
 Generate COR0 register write value. More...
 
uint32_t XCAP_getCTRL0value (int EFUSE_KEY, int ICAP_SELECT, int Reserved_29_13, int OverTempShutDown, int Reserved_11, int ConfigFallback, int Reserved_9, int GLUTMASK_B, int Reserved_7, int DEC, int SBITS, int PERSIST, int Reserved_2_1, int GTS_USR_B)
 Generate CTRL0 register write value. More...
 
uint32_t XCAP_getInstruction (int type, XCAP::Operation operation, XCAP::Register reg, int payload)
 Generate and return the encoding for an instruction. More...
 
XCAP::Operation XCAP_getInstructionOperation (uint32_t instruction)
 Parses and returns instruction operation. Most Xil instructions will NOP or write. More...
 
uint32_t XCAP_getInstructionPayload (uint32_t instruction)
 Parses and returns instruction payload. This is the immediate value after instruction type and operation encodings. More...
 
XCAP::Register XCAP_getInstructionRegister (uint32_t instruction)
 Parses and returns instruction register. This is the register being addressed if the instruction is of type 1. More...
 
uint32_t XCAP_getInstructionType (uint32_t instruction)
 Parses and returns instruction type. Valid Xil instructions will be of types 1 and 2. More...
 
uint32_t XCAP_getInstructionWordCount (uint32_t instruction)
 Parses and returns instruction word count. This is the number of words to be read/written if the instruction is of type 1. More...
 
uint32_t XCAP_getSyncInstruction ()
 Generate and return the encoding for a SYNC instruction. More...
 
uint32_t XCAP_getType1Instruction (XCAP::Operation operation, XCAP::Register reg, int payload)
 Generate and return the encoding for a type 1 instruction. More...
 
uint32_t XCAP_getType1NopInstruction (int payload)
 Generate and return the encoding for a type 1 NOP instruction. More...
 
uint32_t XCAP_getType1ReadInstruction (XCAP::Register reg, int payload)
 Generate and return the encoding for a type 1 Read instruction. More...
 
uint32_t XCAP_getType1ReservedInstruction (int payload)
 Generate and return the encoding for a type 1 Reserved instruction. More...
 
uint32_t XCAP_getType1WriteInstruction (XCAP::Register reg, int payload)
 Generate and return the encoding for a type 1 Write instruction. More...
 
uint32_t XCAP_getType2Instruction (XCAP::Operation operation, int payload)
 Generate and return the encoding for a type 2 instruction. More...
 
uint32_t XCAP_getType2NopInstruction (int payload)
 Generate and return the encoding for a type 2 NOP instruction. More...
 
uint32_t XCAP_getType2ReadInstruction (int payload)
 Generate and return the encoding for a type 2 Read instruction. More...
 
uint32_t XCAP_getType2ReservedInstruction (int payload)
 Generate and return the encoding for a type 2 Reserved instruction. More...
 
uint32_t XCAP_getType2WriteInstruction (int payload)
 Generate and return the encoding for a type 2 Write instruction. More...
 
uint32_t XCAP_IDCODEInstruction ()
 Generate and return the encoding for a IDCODE writing instruction. More...
 
void XCAP_writeCommand (std::ofstream &fout, XCAP::Command cmd, Endianness e)
 Generate the encoding for writing a CAP command and write it to file ofstream. More...
 
void XCAP_writeFDRI (std::ofstream &fout, int wordCount, Endianness e)
 Generate and write an FDRI command. Always uses type 2 command for simplicity. More...
 
void XCAP_writeFDRI1 (std::ofstream &fout, int wordCount, Endianness e)
 Generate and write only a type 1 FDRI command. More...
 
void XCAP_writeMaskAndRegister (std::ofstream &fout, XCAP::Register reg, int writeMask, int writeValue, Endianness e)
 Generate the encoding for writing a CAP register with a mask and write it to file ofstream. More...
 
void XCAP_writeNOP (std::ofstream &fout, int cnt, int payload, Endianness e)
 Generate the encoding for NOP instructions and write them to file ofstream. More...
 
void XCAP_writeReadRegister (std::ofstream &fout, XCAP::Register reg, int readLength, Endianness e)
 Generate the encoding for reading a CAP register and write it to file ofstream. More...
 
void XCAP_writeRegister (std::ofstream &fout, XCAP::Register reg, int writeValue, Endianness e)
 Generate the encoding for writing a CAP register and write it to file ofstream. More...
 
void XCAP_writeRESERVED (std::ofstream &fout, int cnt, int payload, Endianness e)
 Generate the encoding for Reserved instructions and write them to file ofstream. More...
 
void XCAP_writeSelectRegister (std::ofstream &fout, XCAP::Register reg, Endianness e)
 Generate the encoding for "selecting" a CAP register and write it to file ofstream. More...
 
void XCAP_writeSYNQ (std::ofstream &fout, Endianness e)
 Generate and write an SYNQ command. More...
 
void XCAP_writeType2 (std::ofstream &fout, int wordCount, Endianness e)
 Generate and write only a type 2 FDRI command. More...
 

Macro Definition Documentation

◆ FABRIC_SYNC_WORD

#define FABRIC_SYNC_WORD   0xAA995566

Definition at line 17 of file inlineCAP.h.

Enumeration Type Documentation

◆ DONE_CYCLE

enum DONE_CYCLE
strong
Enumerator
Phase1 
Phase2 
Phase3 
Phase4 
Phase5 
Phase6 

Definition at line 441 of file inlineCAP.h.

441  {
442  //Start-up cycle to release the DONE pin:
443  Phase1 = 0,
444  Phase2 = 1,
445  Phase3 = 2,
446  Phase4 = 3,
447  Phase5 = 4,
448  Phase6 = 5
449 };

◆ GTS_CYCLE

enum GTS_CYCLE
strong
Enumerator
Phase1 
Phase2 
Phase3 
Phase4 
Phase5 
Phase6 
GTS_DONE 

GTS tracks DONE pin. Bitstream property: GTS_CYCLE:DONE.

Definition at line 472 of file inlineCAP.h.

472  {
473  //Start-up cycle to deassert the Global 3-State (GTS) signal:
474  Phase1 = 0,
475  Phase2 = 1,
476  Phase3 = 2,
477  Phase4 = 3,
478  Phase5 = 4,
479  Phase6 = 5,
480  GTS_DONE = 6
481 };
@ GTS_DONE
GTS tracks DONE pin. Bitstream property: GTS_CYCLE:DONE.

◆ GWE_CYCLE

enum GWE_CYCLE
strong
Enumerator
Phase1 
Phase2 
Phase3 
Phase4 
Phase5 
Phase6 
GWE_DONE 

GWE tracks DONE pin. Bitstream property: GWE_CYCLE:DONE.

Definition at line 482 of file inlineCAP.h.

482  {
483  //Start-up phase to deassert the Global Write Enable (GWE) signal:
484  Phase1 = 0,
485  Phase2 = 1,
486  Phase3 = 2,
487  Phase4 = 3,
488  Phase5 = 4,
489  Phase6 = 5,
490  GWE_DONE = 6
491 };
@ GWE_DONE
GWE tracks DONE pin. Bitstream property: GWE_CYCLE:DONE.

◆ LOCK_CYCLE

enum LOCK_CYCLE
strong
Enumerator
Phase0 
Phase1 
Phase2 
Phase3 
Phase4 
Phase5 
Phase6 
NoWait 

Definition at line 461 of file inlineCAP.h.

461  {
462  //Start-up cycle to stall in until MMCMs lock:
463  Phase0 = 0,
464  Phase1 = 1,
465  Phase2 = 2,
466  Phase3 = 3,
467  Phase4 = 4,
468  Phase5 = 5,
469  Phase6 = 6,
470  NoWait = 7
471 };

◆ MATCH_CYCLE

enum MATCH_CYCLE
strong
Enumerator
Phase0 
Phase1 
Phase2 
Phase3 
Phase4 
Phase5 
Phase6 
NoWait 

Definition at line 450 of file inlineCAP.h.

450  {
451  //Start-up cycle to stall in until DCI matches:
452  Phase0 = 0,
453  Phase1 = 1,
454  Phase2 = 2,
455  Phase3 = 3,
456  Phase4 = 4,
457  Phase5 = 5,
458  Phase6 = 6,
459  NoWait = 7
460 };

Function Documentation

◆ getXCAPcommand()

XCAP::Command getXCAPcommand ( std::string  s)
inline

Definition at line 67 of file inlineCAP.h.

68 {
69  if(str::iff::stringContains(s, "NULL"))
71  else if(str::iff::stringContains(s, "WCFG", "WRITE CONFIG"))
72  return XCAP::Command::WCFG;
73  else if(str::iff::stringContains(s, "MFW", "MULTIPLE FRAME WRITE"))
74  return XCAP::Command::MFW;
75  else if(str::iff::stringContains(s, "DGHIGH", "DEASSERT GHIGH"))
76  return XCAP::Command::DGHIGH;
77  else if(str::iff::stringContains(s, "RCFG", "READ CONFIG"))
78  return XCAP::Command::RCFG;
79  else if(str::iff::stringContains(s, "START"))
80  return XCAP::Command::START;
81  else if(str::iff::stringContains(s, "URAM", "CLEAR URAM"))
82  return XCAP::Command::URAM;
83  else if(str::iff::stringContains(s, "RCRC", "RESET CRC"))
84  return XCAP::Command::RCRC;
85  else if(str::iff::stringContains(s, "AGHIGH", "ASSERT GHIGH"))
86  return XCAP::Command::AGHIGH;
87  else if(str::iff::stringContains(s, "SWITCH"))
88  return XCAP::Command::SWITCH;
89  else if(str::iff::stringContains(s, "GRESTORE"))
91  else if(str::iff::stringContains(s, "SHUTDOWN"))
93  else if(str::iff::stringContains(s, "DESYNC"))
94  return XCAP::Command::DESYNC;
95  else if(str::iff::stringContains(s, "IPROG"))
96  return XCAP::Command::IPROG;
97  else if(str::iff::stringContains(s, "CRCC"))
98  return XCAP::Command::CRCC;
99  else if(str::iff::stringContains(s, "LTIMER"))
100  return XCAP::Command::LTIMER;
101  else if(str::iff::stringContains(s, "BSPI_READ"))
103  else if(str::iff::stringContains(s, "FALL_EDGE"))
105  else if(str::iff::stringContains(s, "MAGIC2"))
106  return XCAP::Command::MAGIC2;
107 
109 }
bool stringContains(std::string checkedString)
Returns false. End of recursion for template.
Definition: iff.h:57

References XCAP::AGHIGH, XCAP::BSPI_READ, XCAP::CRCC, XCAP::DESYNC, XCAP::DGHIGH, XCAP::FALL_EDGE, XCAP::GRESTORE, XCAP::IPROG, XCAP::LTIMER, XCAP::MAGIC2, XCAP::MFW, XCAP::NULLCMD, XCAP::RCFG, XCAP::RCRC, XCAP::SHUTDOWN, XCAP::START, str::iff::stringContains(), XCAP::SWITCH, XCAP::UNDEFINED, XCAP::URAM, and XCAP::WCFG.

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), and XilinxUltraScalePlus::assemblerAsmTo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getXCAPregister()

XCAP::Register getXCAPregister ( std::string  s)
inline

Definition at line 19 of file inlineCAP.h.

20 {
21  if(str::iff::stringContains(s, "CRC"))
22  return XCAP::Register::CRC;
23  else if(str::iff::stringContains(s, "FAR"))
24  return XCAP::Register::FAR;
25  else if(str::iff::stringContains(s, "FDRI"))
26  return XCAP::Register::FDRI;
27  else if(str::iff::stringContains(s, "FDRO"))
28  return XCAP::Register::FDRO;
29  else if(str::iff::stringContains(s, "CTRL0"))
30  return XCAP::Register::CTRL0;
31  else if(str::iff::stringContains(s, "MASK"))
32  return XCAP::Register::MASK;
33  else if(str::iff::stringContains(s, "STAT"))
34  return XCAP::Register::STAT;
35  else if(str::iff::stringContains(s, "LOUT"))
36  return XCAP::Register::LOUT;
37  else if(str::iff::stringContains(s, "COR0"))
38  return XCAP::Register::COR0;
39  else if(str::iff::stringContains(s, "MFWR"))
40  return XCAP::Register::MFWR;
41  else if(str::iff::stringContains(s, "CBC"))
42  return XCAP::Register::CBC;
43  else if(str::iff::stringContains(s, "IDCODE"))
45  else if(str::iff::stringContains(s, "AXSS"))
46  return XCAP::Register::AXSS;
47  else if(str::iff::stringContains(s, "COR1"))
48  return XCAP::Register::COR1;
49  else if(str::iff::stringContains(s, "WBSTAR"))
51  else if(str::iff::stringContains(s, "TIMER"))
52  return XCAP::Register::TIMER;
53  else if(str::iff::stringContains(s, "MAGIC0"))
55  else if(str::iff::stringContains(s, "BOOTSTS"))
57  else if(str::iff::stringContains(s, "CTRL1"))
58  return XCAP::Register::CTRL1;
59  else if(str::iff::stringContains(s, "MAGIC1"))
61  else if(str::iff::stringContains(s, "BSPI"))
62  return XCAP::Register::BSPI;
63 
65 }

References XCAP::AXSS, XCAP::BOOTSTS, XCAP::BSPI, XCAP::CBC, XCAP::COR0, XCAP::COR1, XCAP::CRC, XCAP::CTRL0, XCAP::CTRL1, XCAP::FAR, XCAP::FDRI, XCAP::FDRO, XCAP::IDCODE, XCAP::LOUT, XCAP::MAGIC0, XCAP::MAGIC1, XCAP::MASK, XCAP::MFWR, XCAP::STAT, str::iff::stringContains(), XCAP::TIMER, XCAP::UNDEFINED, and XCAP::WBSTAR.

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), and XilinxUltraScalePlus::assemblerAsmTo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeXCAPcommandName()

void writeXCAPcommandName ( std::ofstream &  fout,
XCAP::Command  commandID 
)
inline

Definition at line 111 of file inlineCAP.h.

112 {
113  switch(commandID){
115  fout << "Null Command";
116  break;
117  case XCAP::Command::WCFG:
118  fout << "Write Config";
119  break;
120  case XCAP::Command::MFW:
121  fout << "Multiple Frame Write";
122  break;
124  fout << "Deassert GHIGH";
125  break;
126  case XCAP::Command::RCFG:
127  fout << "Read Config";
128  break;
130  fout << "Start";
131  break;
132  case XCAP::Command::URAM:
133  fout << "Clear URAM";
134  break;
135  case XCAP::Command::RCRC:
136  fout << "Reset CRC";
137  break;
139  fout << "Assert GHIGH";
140  break;
142  fout << "Switch";
143  break;
145  fout << "GRestore";
146  break;
148  fout << "Shutdown";
149  break;
151  fout << "Desync";
152  break;
154  fout << "IProg";
155  break;
156  case XCAP::Command::CRCC:
157  fout << "CRCC";
158  break;
160  fout << "LTimer";
161  break;
163  fout << "BSPI_Read";
164  break;
166  fout << "Fall_Edge";
167  break;
169  fout << "MAGIC2";
170  break;
171  default:
172  fout << std::string("UNKNOWN(").append(std::to_string(static_cast<int>(commandID))).append(")");
173  break;
174  }
175 }
std::string to_string(Endianness e)
Definition: Endianness.h:56

References XCAP::AGHIGH, XCAP::BSPI_READ, XCAP::CRCC, XCAP::DESYNC, XCAP::DGHIGH, XCAP::FALL_EDGE, XCAP::GRESTORE, XCAP::IPROG, XCAP::LTIMER, XCAP::MAGIC2, XCAP::MFW, XCAP::NULLCMD, XCAP::RCFG, XCAP::RCRC, XCAP::SHUTDOWN, XCAP::START, XCAP::SWITCH, Endian::to_string(), XCAP::URAM, and XCAP::WCFG.

Referenced by XilinxSeries7::disassemblerToAsm(), XilinxUltraScale::disassemblerToAsm(), and XilinxUltraScalePlus::disassemblerToAsm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeXCAPregisterName()

void writeXCAPregisterName ( std::ofstream &  fout,
XCAP::Register  registerID 
)
inline

Definition at line 177 of file inlineCAP.h.

178 {
179  switch(registerID){
180  case XCAP::Register::CRC:
181  fout << "CRC";
182  break;
183  case XCAP::Register::FAR:
184  fout << "FAR";
185  break;
187  fout << "FDRI";
188  break;
190  fout << "FDRO";
191  break;
192  case XCAP::Register::CMD:
193  fout << "CMD";
194  break;
196  fout << "CTRL0";
197  break;
199  fout << "MASK";
200  break;
202  fout << "STAT";
203  break;
205  fout << "LOUT";
206  break;
208  fout << "COR0";
209  break;
211  fout << "MFWR";
212  break;
213  case XCAP::Register::CBC:
214  fout << "CBC";
215  break;
217  fout << "IDCODE";
218  break;
220  fout << "AXSS";
221  break;
223  fout << "COR1";
224  break;
226  fout << "WBSTAR";
227  break;
229  fout << "TIMER";
230  break;
232  fout << "MAGIC0";
233  break;
235  fout << "BOOTSTS";
236  break;
238  fout << "CTRL1";
239  break;
241  fout << "MAGIC1";
242  break;
244  fout << "BSPI";
245  break;
246  default:
247  fout << std::string("UNKNOWN(").append(std::to_string(static_cast<int>(registerID))).append(")");
248  break;
249  }
250 }

References XCAP::AXSS, XCAP::BOOTSTS, XCAP::BSPI, XCAP::CBC, XCAP::CMD, XCAP::COR0, XCAP::COR1, XCAP::CRC, XCAP::CTRL0, XCAP::CTRL1, XCAP::FAR, XCAP::FDRI, XCAP::FDRO, XCAP::IDCODE, XCAP::LOUT, XCAP::MAGIC0, XCAP::MAGIC1, XCAP::MASK, XCAP::MFWR, XCAP::STAT, XCAP::TIMER, Endian::to_string(), and XCAP::WBSTAR.

Referenced by XilinxSeries7::disassemblerToAsm(), XilinxUltraScale::disassemblerToAsm(), and XilinxUltraScalePlus::disassemblerToAsm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_getCOR0value()

uint32_t XCAP_getCOR0value ( int  Reserved_31_27,
int  ECLK_EN,
int  Reserved_25,
int  DRIVE_DONE,
int  Reserved_23,
int  OSCFSEL,
int  Reserved_16_15,
DONE_CYCLE  selDONE_CYCLE,
MATCH_CYCLE  selMATCH_CYCLE,
LOCK_CYCLE  selLOCK_CYCLE,
GTS_CYCLE  selGTS_CYCLE,
GWE_CYCLE  selGWE_CYCLE 
)
inline

Generate COR0 register write value.

Definition at line 493 of file inlineCAP.h.

494 {
495  uint32_t retValue = 0;
496  retValue |= Reserved_31_27 << 27;
497  retValue |= ECLK_EN << 26;
498  retValue |= Reserved_25 << 25;
499  retValue |= DRIVE_DONE << 24;
500  retValue |= Reserved_23 << 23;
501  retValue |= OSCFSEL << 17;
502  retValue |= Reserved_16_15 << 15;
503  retValue |= static_cast<int>(selDONE_CYCLE) << 12;
504  retValue |= static_cast<int>(selMATCH_CYCLE) << 9;
505  retValue |= static_cast<int>(selLOCK_CYCLE) << 6;
506  retValue |= static_cast<int>(selGTS_CYCLE) << 3;
507  retValue |= static_cast<int>(selGWE_CYCLE);
508  return retValue;
509 }

Referenced by XilinxUltraScale::outputBitstreamEmptySLRHeaderSequence(), and XilinxUltraScale::outputBitstreamSLRHeaderBitstreamSequence().

Here is the caller graph for this function:

◆ XCAP_getCTRL0value()

uint32_t XCAP_getCTRL0value ( int  EFUSE_KEY,
int  ICAP_SELECT,
int  Reserved_29_13,
int  OverTempShutDown,
int  Reserved_11,
int  ConfigFallback,
int  Reserved_9,
int  GLUTMASK_B,
int  Reserved_7,
int  DEC,
int  SBITS,
int  PERSIST,
int  Reserved_2_1,
int  GTS_USR_B 
)
inline

Generate CTRL0 register write value.

Definition at line 513 of file inlineCAP.h.

514 {
515  uint32_t retValue = 0;
516  retValue |= EFUSE_KEY << 31; //Selects the AES key source: 0: Battery-backed RAM (default) 1: eFUSE
517  retValue |= ICAP_SELECT << 30; //ICAPE3 port select: 0: Top ICAPE3 port enabled (default) 1: Bottom ICAPE3 port enabled
518  retValue |= Reserved_29_13 << 13;
519  retValue |= OverTempShutDown << 12; //high-active: enables over-temperature shutdown (default:0)
520  retValue |= Reserved_11 << 11;
521  retValue |= ConfigFallback << 10; //Stops when configuration fails and disables fallback to the default bitstream. 0: Enables fallback (default)
522  retValue |= Reserved_9 << 9;
523  retValue |= GLUTMASK_B << 8; //Global LUT mask signal. Masks any changeable memory cell readback value. 0: Masks changeable memory cell readback value, such as distributed RAM or SRL 1: Does not mask changeable memory cell readback values(default)
524  retValue |= Reserved_7 << 7;
525  retValue |= DEC << 6; //AES decryptor enable bit: 0: Decryptor disabled (default) 1: Decryptor enabled
526  retValue |= SBITS << 4; //Security level. The FPGA security level is extended to encrypted bitstreams. It is applicable to the configuration port, not to ICAPE3. The security level takes affect at the end of the encrypted bitstream or after EOS for an unencrypted bitstream. 00: Read/write OK (default) 01: Readback disabled 1x: Both writes and reads disabled Only FAR and FDRI allow encrypt write access for security levels 00 and 01.
527  retValue |= PERSIST << 3; //The configuration interface defined by M2:M0 remains after configuration. Typically used only with the SelectMAP interface to allow reconfiguration and readback. See Chapter 5, SelectMAP Configuration Modes. 0: No (default) 1: Yes
528  retValue |= Reserved_2_1 << 1;
529  retValue |= GTS_USR_B; //Active-Low global 3-state I/Os. Turns off pull-ups if GTS_CFG_B is also asserted. 0: I/Os 3-stated 1: I/Os active (default)
530  return retValue;
531 }

Referenced by XilinxSeries7::outputBitstreamSLRFooterBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRFooterBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRFooterBitstreamSequence(), XilinxSeries7::outputBitstreamSLRHeaderBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRHeaderBitstreamSequence(), and XilinxUltraScalePlus::outputBitstreamSLRHeaderBitstreamSequence().

Here is the caller graph for this function:

◆ XCAP_getInstruction()

uint32_t XCAP_getInstruction ( int  type,
XCAP::Operation  operation,
XCAP::Register  reg,
int  payload 
)
inline

Generate and return the encoding for an instruction.

Definition at line 283 of file inlineCAP.h.

284 {
285  //type 1 instr: type@[31:29] ; operation@[28:27] ; reg@[17:13] ; payload@[10:0]
286  //type 2 instr: type@[31:29] ; operation@[28:27] ; payload@[26:0]
287  //This function works for both types, but is not safe for bad instructions
288  return (((type & 0x7) << 29) | ((static_cast<int>(operation) & 0x3) << 27) | ((static_cast<int>(reg) & 0x1F) << 13) | (payload & 0x07FFFFFF));
289 }

Referenced by XCAP_getType1Instruction(), and XCAP_getType2Instruction().

Here is the caller graph for this function:

◆ XCAP_getInstructionOperation()

XCAP::Operation XCAP_getInstructionOperation ( uint32_t  instruction)
inline

Parses and returns instruction operation. Most Xil instructions will NOP or write.

Definition at line 259 of file inlineCAP.h.

260 {
261  return static_cast<XCAP::Operation>((instruction>>27) & 0x3); //Operation is @ bits [28:27]
262 }
Operation
Definition: XCAP.h:69

Referenced by XilinxSeries7::disassemblerToAsm(), XilinxUltraScale::disassemblerToAsm(), XilinxUltraScalePlus::disassemblerToAsm(), and readBitstreamMain().

Here is the caller graph for this function:

◆ XCAP_getInstructionPayload()

uint32_t XCAP_getInstructionPayload ( uint32_t  instruction)
inline

Parses and returns instruction payload. This is the immediate value after instruction type and operation encodings.

Definition at line 265 of file inlineCAP.h.

266 {
267  return (instruction & 0x07FFFFFF); //Payload in type 2 instructions is @ bits [26:0]
268 }

Referenced by XilinxSeries7::disassemblerToAsm(), XilinxUltraScale::disassemblerToAsm(), XilinxUltraScalePlus::disassemblerToAsm(), and readBitstreamMain().

Here is the caller graph for this function:

◆ XCAP_getInstructionRegister()

XCAP::Register XCAP_getInstructionRegister ( uint32_t  instruction)
inline

Parses and returns instruction register. This is the register being addressed if the instruction is of type 1.

Definition at line 271 of file inlineCAP.h.

272 {
273  return static_cast<XCAP::Register>((instruction>>13) & 0x1F); //Register in type 1 instructions is @ bits [17:13]
274 }
Register
Definition: XCAP.h:20

Referenced by XilinxSeries7::disassemblerToAsm(), XilinxUltraScale::disassemblerToAsm(), XilinxUltraScalePlus::disassemblerToAsm(), and readBitstreamMain().

Here is the caller graph for this function:

◆ XCAP_getInstructionType()

uint32_t XCAP_getInstructionType ( uint32_t  instruction)
inline

Parses and returns instruction type. Valid Xil instructions will be of types 1 and 2.

Definition at line 253 of file inlineCAP.h.

254 {
255  return ((instruction>>29) & 0x7); // type is @ bits [31:29]
256 }

Referenced by XilinxSeries7::disassemblerToAsm(), XilinxUltraScale::disassemblerToAsm(), XilinxUltraScalePlus::disassemblerToAsm(), and readBitstreamMain().

Here is the caller graph for this function:

◆ XCAP_getInstructionWordCount()

uint32_t XCAP_getInstructionWordCount ( uint32_t  instruction)
inline

Parses and returns instruction word count. This is the number of words to be read/written if the instruction is of type 1.

Definition at line 277 of file inlineCAP.h.

278 {
279  return (instruction & 0x7FF); //WordCount in type 1 instructions is @ bits [10:0]
280 }

Referenced by XilinxSeries7::disassemblerToAsm(), XilinxUltraScale::disassemblerToAsm(), XilinxUltraScalePlus::disassemblerToAsm(), and readBitstreamMain().

Here is the caller graph for this function:

◆ XCAP_getSyncInstruction()

uint32_t XCAP_getSyncInstruction ( )
inline

Generate and return the encoding for a SYNC instruction.

Definition at line 430 of file inlineCAP.h.

431 {
432  return FABRIC_SYNC_WORD;
433 }
#define FABRIC_SYNC_WORD
Definition: inlineCAP.h:17

References FABRIC_SYNC_WORD.

Referenced by findBitstreamSyncSequence(), findBitstreamSyncWord(), outputCAPheaderConstant(), parseBitstreamEndianness(), and XCAP_writeSYNQ().

Here is the caller graph for this function:

◆ XCAP_getType1Instruction()

uint32_t XCAP_getType1Instruction ( XCAP::Operation  operation,
XCAP::Register  reg,
int  payload 
)
inline

Generate and return the encoding for a type 1 instruction.

Definition at line 292 of file inlineCAP.h.

293 {
294  return XCAP_getInstruction(1, operation, reg, (payload & 0x7FF));
295 }
uint32_t XCAP_getInstruction(int type, XCAP::Operation operation, XCAP::Register reg, int payload)
Generate and return the encoding for an instruction.
Definition: inlineCAP.h:283

References XCAP_getInstruction().

Referenced by XCAP_getType1NopInstruction(), XCAP_getType1ReadInstruction(), XCAP_getType1ReservedInstruction(), and XCAP_getType1WriteInstruction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_getType1NopInstruction()

uint32_t XCAP_getType1NopInstruction ( int  payload)
inline

Generate and return the encoding for a type 1 NOP instruction.

Definition at line 298 of file inlineCAP.h.

299 {
300  return XCAP_getType1Instruction(XCAP::Operation::NOP, static_cast<XCAP::Register>(0), payload);
301 }
uint32_t XCAP_getType1Instruction(XCAP::Operation operation, XCAP::Register reg, int payload)
Generate and return the encoding for a type 1 instruction.
Definition: inlineCAP.h:292

References XCAP::NOP, and XCAP_getType1Instruction().

Referenced by XCAP_writeNOP().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_getType1ReadInstruction()

uint32_t XCAP_getType1ReadInstruction ( XCAP::Register  reg,
int  payload 
)
inline

Generate and return the encoding for a type 1 Read instruction.

Definition at line 304 of file inlineCAP.h.

305 {
306  return XCAP_getType1Instruction(XCAP::Operation::READ, reg, (payload & 0x7FF));
307 }

References XCAP::READ, and XCAP_getType1Instruction().

Referenced by XCAP_writeReadRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_getType1ReservedInstruction()

uint32_t XCAP_getType1ReservedInstruction ( int  payload)
inline

Generate and return the encoding for a type 1 Reserved instruction.

Definition at line 316 of file inlineCAP.h.

317 {
318  return XCAP_getType1Instruction(XCAP::Operation::RESERVED, static_cast<XCAP::Register>(0), payload);
319 }

References XCAP::RESERVED, and XCAP_getType1Instruction().

Referenced by XCAP_writeRESERVED().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_getType1WriteInstruction()

uint32_t XCAP_getType1WriteInstruction ( XCAP::Register  reg,
int  payload 
)
inline

Generate and return the encoding for a type 1 Write instruction.

Definition at line 310 of file inlineCAP.h.

311 {
312  return XCAP_getType1Instruction(XCAP::Operation::WRITE, reg, (payload & 0x7FF));
313 }

References XCAP::WRITE, and XCAP_getType1Instruction().

Referenced by XCAP_IDCODEInstruction(), XCAP_writeFDRI1(), XCAP_writeRegister(), and XCAP_writeSelectRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_getType2Instruction()

uint32_t XCAP_getType2Instruction ( XCAP::Operation  operation,
int  payload 
)
inline

Generate and return the encoding for a type 2 instruction.

Definition at line 322 of file inlineCAP.h.

323 {
324  return XCAP_getInstruction(2, operation, static_cast<XCAP::Register>(0), payload);
325 }

References XCAP_getInstruction().

Referenced by XCAP_getType2NopInstruction(), XCAP_getType2ReadInstruction(), XCAP_getType2ReservedInstruction(), and XCAP_getType2WriteInstruction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_getType2NopInstruction()

uint32_t XCAP_getType2NopInstruction ( int  payload)
inline

Generate and return the encoding for a type 2 NOP instruction.

Definition at line 328 of file inlineCAP.h.

329 {
331 }
uint32_t XCAP_getType2Instruction(XCAP::Operation operation, int payload)
Generate and return the encoding for a type 2 instruction.
Definition: inlineCAP.h:322

References XCAP::NOP, and XCAP_getType2Instruction().

Here is the call graph for this function:

◆ XCAP_getType2ReadInstruction()

uint32_t XCAP_getType2ReadInstruction ( int  payload)
inline

Generate and return the encoding for a type 2 Read instruction.

Definition at line 334 of file inlineCAP.h.

335 {
336  return XCAP_getType2Instruction(XCAP::Operation::READ, (payload & 0x07FFFFFF));
337 }

References XCAP::READ, and XCAP_getType2Instruction().

Here is the call graph for this function:

◆ XCAP_getType2ReservedInstruction()

uint32_t XCAP_getType2ReservedInstruction ( int  payload)
inline

Generate and return the encoding for a type 2 Reserved instruction.

Definition at line 346 of file inlineCAP.h.

347 {
349 }

References XCAP::RESERVED, and XCAP_getType2Instruction().

Here is the call graph for this function:

◆ XCAP_getType2WriteInstruction()

uint32_t XCAP_getType2WriteInstruction ( int  payload)
inline

Generate and return the encoding for a type 2 Write instruction.

Definition at line 340 of file inlineCAP.h.

341 {
342  return XCAP_getType2Instruction(XCAP::Operation::WRITE, (payload & 0x07FFFFFF));
343 }

References XCAP::WRITE, and XCAP_getType2Instruction().

Referenced by XCAP_writeType2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_IDCODEInstruction()

uint32_t XCAP_IDCODEInstruction ( )
inline

Generate and return the encoding for a IDCODE writing instruction.

Definition at line 424 of file inlineCAP.h.

425 {
427 }
uint32_t XCAP_getType1WriteInstruction(XCAP::Register reg, int payload)
Generate and return the encoding for a type 1 Write instruction.
Definition: inlineCAP.h:310

References XCAP::IDCODE, and XCAP_getType1WriteInstruction().

Referenced by parseBitstreamIDCODE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeCommand()

void XCAP_writeCommand ( std::ofstream &  fout,
XCAP::Command  cmd,
Endianness  e 
)
inline

Generate the encoding for writing a CAP command and write it to file ofstream.

Definition at line 390 of file inlineCAP.h.

391 {
392  XCAP_writeRegister(fout, XCAP::Register::CMD, static_cast<int>(cmd), e);
393 }
void XCAP_writeRegister(std::ofstream &fout, XCAP::Register reg, int writeValue, Endianness e)
Generate the encoding for writing a CAP register and write it to file ofstream.
Definition: inlineCAP.h:382

References XCAP::CMD, and XCAP_writeRegister().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), XilinxUltraScalePlus::assemblerAsmTo(), XilinxSeries7::outputBitstreamEmptySLRHeaderSequence(), XilinxUltraScale::outputBitstreamEmptySLRHeaderSequence(), XilinxUltraScalePlus::outputBitstreamEmptySLRHeaderSequence(), XilinxSeries7::outputBitstreamEmptySLRWrapUpSequence(), XilinxUltraScale::outputBitstreamEmptySLRWrapUpSequence(), XilinxUltraScalePlus::outputBitstreamEmptySLRWrapUpSequence(), XilinxSeries7::outputBitstreamSLRFooterBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRFooterBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRFooterBitstreamSequence(), XilinxSeries7::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxSeries7::outputBitstreamSLRHeaderBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRHeaderBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRHeaderBitstreamSequence(), XilinxSeries7::outputBitstreamSLRWrapUpSequence(), XilinxUltraScale::outputBitstreamSLRWrapUpSequence(), XilinxUltraScalePlus::outputBitstreamSLRWrapUpSequence(), and writeBitstreamMainSingleRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeFDRI()

void XCAP_writeFDRI ( std::ofstream &  fout,
int  wordCount,
Endianness  e 
)
inline

Generate and write an FDRI command. Always uses type 2 command for simplicity.

Definition at line 417 of file inlineCAP.h.

418 {
419  XCAP_writeFDRI1(fout, 0, e);
420  XCAP_writeType2(fout, wordCount, e);
421 }
void XCAP_writeFDRI1(std::ofstream &fout, int wordCount, Endianness e)
Generate and write only a type 1 FDRI command.
Definition: inlineCAP.h:403
void XCAP_writeType2(std::ofstream &fout, int wordCount, Endianness e)
Generate and write only a type 2 FDRI command.
Definition: inlineCAP.h:410

References XCAP_writeFDRI1(), and XCAP_writeType2().

Referenced by writeBitstreamMainSingleRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeFDRI1()

void XCAP_writeFDRI1 ( std::ofstream &  fout,
int  wordCount,
Endianness  e 
)
inline

Generate and write only a type 1 FDRI command.

Definition at line 403 of file inlineCAP.h.

404 {
405  uint32_t instruction = XCAP_getType1WriteInstruction(XCAP::Register::FDRI, wordCount);
406  FileIO::write32(fout, instruction, e);
407 }
void write32(std::ofstream &fout, uint32_t writeValue, Endianness e=Endianness::NATIVE)
Definition: FileIO.h:419

References XCAP::FDRI, FileIO::write32(), and XCAP_getType1WriteInstruction().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), XilinxUltraScalePlus::assemblerAsmTo(), and XCAP_writeFDRI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeMaskAndRegister()

void XCAP_writeMaskAndRegister ( std::ofstream &  fout,
XCAP::Register  reg,
int  writeMask,
int  writeValue,
Endianness  e 
)
inline

Generate the encoding for writing a CAP register with a mask and write it to file ofstream.

Definition at line 396 of file inlineCAP.h.

397 {
398  XCAP_writeRegister(fout, XCAP::Register::MASK, writeMask, e);
399  XCAP_writeRegister(fout, reg, writeValue, e);
400 }

References XCAP::MASK, and XCAP_writeRegister().

Referenced by XilinxSeries7::outputBitstreamSLRFooterBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRFooterBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRFooterBitstreamSequence(), XilinxSeries7::outputBitstreamSLRHeaderBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRHeaderBitstreamSequence(), and XilinxUltraScalePlus::outputBitstreamSLRHeaderBitstreamSequence().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeNOP()

void XCAP_writeNOP ( std::ofstream &  fout,
int  cnt,
int  payload,
Endianness  e 
)
inline

Generate the encoding for NOP instructions and write them to file ofstream.

Definition at line 352 of file inlineCAP.h.

353 {
354  uint32_t instruction = XCAP_getType1NopInstruction(payload);
355  for(int i = 0 ; i < cnt ; i++)
356  FileIO::write32(fout, instruction, e);
357 }
uint32_t XCAP_getType1NopInstruction(int payload)
Generate and return the encoding for a type 1 NOP instruction.
Definition: inlineCAP.h:298

References FileIO::write32(), and XCAP_getType1NopInstruction().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), XilinxUltraScalePlus::assemblerAsmTo(), XilinxSeries7::outputBitstreamEmptySLRHeaderSequence(), XilinxUltraScale::outputBitstreamEmptySLRHeaderSequence(), XilinxUltraScalePlus::outputBitstreamEmptySLRHeaderSequence(), XilinxSeries7::outputBitstreamEmptySLRWrapUpSequence(), XilinxUltraScale::outputBitstreamEmptySLRWrapUpSequence(), XilinxUltraScalePlus::outputBitstreamEmptySLRWrapUpSequence(), XilinxSeries7::outputBitstreamGlobalFooterSequence(), XilinxUltraScale::outputBitstreamGlobalFooterSequence(), XilinxUltraScalePlus::outputBitstreamGlobalFooterSequence(), XilinxSeries7::outputBitstreamSLRFooterBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRFooterBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRFooterBitstreamSequence(), XilinxSeries7::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxSeries7::outputBitstreamSLRHeaderBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRHeaderBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRHeaderBitstreamSequence(), XilinxSeries7::outputBitstreamSLRWrapUpSequence(), XilinxUltraScale::outputBitstreamSLRWrapUpSequence(), XilinxUltraScalePlus::outputBitstreamSLRWrapUpSequence(), and writeBitstreamMainSingleRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeReadRegister()

void XCAP_writeReadRegister ( std::ofstream &  fout,
XCAP::Register  reg,
int  readLength,
Endianness  e 
)
inline

Generate the encoding for reading a CAP register and write it to file ofstream.

Definition at line 375 of file inlineCAP.h.

376 {
377  uint32_t instruction = XCAP_getType1ReadInstruction(reg, readLength);
378  FileIO::write32(fout, instruction, e);
379 }
uint32_t XCAP_getType1ReadInstruction(XCAP::Register reg, int payload)
Generate and return the encoding for a type 1 Read instruction.
Definition: inlineCAP.h:304

References FileIO::write32(), and XCAP_getType1ReadInstruction().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), and XilinxUltraScalePlus::assemblerAsmTo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeRegister()

void XCAP_writeRegister ( std::ofstream &  fout,
XCAP::Register  reg,
int  writeValue,
Endianness  e 
)
inline

◆ XCAP_writeRESERVED()

void XCAP_writeRESERVED ( std::ofstream &  fout,
int  cnt,
int  payload,
Endianness  e 
)
inline

Generate the encoding for Reserved instructions and write them to file ofstream.

Definition at line 360 of file inlineCAP.h.

361 {
362  uint32_t instruction = XCAP_getType1ReservedInstruction(payload);
363  for(int i = 0 ; i < cnt ; i++)
364  FileIO::write32(fout, instruction, e);
365 }
uint32_t XCAP_getType1ReservedInstruction(int payload)
Generate and return the encoding for a type 1 Reserved instruction.
Definition: inlineCAP.h:316

References FileIO::write32(), and XCAP_getType1ReservedInstruction().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), and XilinxUltraScalePlus::assemblerAsmTo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeSelectRegister()

void XCAP_writeSelectRegister ( std::ofstream &  fout,
XCAP::Register  reg,
Endianness  e 
)
inline

◆ XCAP_writeSYNQ()

void XCAP_writeSYNQ ( std::ofstream &  fout,
Endianness  e 
)
inline

Generate and write an SYNQ command.

Definition at line 436 of file inlineCAP.h.

437 {
439 }
uint32_t XCAP_getSyncInstruction()
Generate and return the encoding for a SYNC instruction.
Definition: inlineCAP.h:430

References FileIO::write32(), and XCAP_getSyncInstruction().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), XilinxUltraScalePlus::assemblerAsmTo(), XilinxSeries7::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRHeaderAfterBitstreamSequence(), and XilinxUltraScalePlus::outputBitstreamSLRHeaderAfterBitstreamSequence().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XCAP_writeType2()

void XCAP_writeType2 ( std::ofstream &  fout,
int  wordCount,
Endianness  e 
)
inline

Generate and write only a type 2 FDRI command.

Definition at line 410 of file inlineCAP.h.

411 {
412  uint32_t instruction = XCAP_getType2WriteInstruction(wordCount);
413  FileIO::write32(fout, instruction, e);
414 }
uint32_t XCAP_getType2WriteInstruction(int payload)
Generate and return the encoding for a type 2 Write instruction.
Definition: inlineCAP.h:340

References FileIO::write32(), and XCAP_getType2WriteInstruction().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), XilinxUltraScalePlus::assemblerAsmTo(), XilinxSeries7::outputBitstreamEmptySLRHeaderSequence(), XilinxUltraScale::outputBitstreamEmptySLRHeaderSequence(), XilinxUltraScalePlus::outputBitstreamEmptySLRHeaderSequence(), XilinxSeries7::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxUltraScale::outputBitstreamSLRHeaderAfterBitstreamSequence(), XilinxUltraScalePlus::outputBitstreamSLRHeaderAfterBitstreamSequence(), and XCAP_writeFDRI().

Here is the call graph for this function:
Here is the caller graph for this function: