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

Go to the source code of this file.

Functions

uint32_t XCAP_getFAR (int slr, int blockType, int globalRowAddress, int columnAddress, int minorAddress)
 
uint32_t XCAP_getFarFarInstruction ()
 Generate and return the encoding for a Far FAR instruction. More...
 
void XCAP_IncrementFAR (int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
 
void XCAP_IncrementFAR_BlockType0 (int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
 
void XCAP_IncrementFAR_BlockType0_new (int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
 
void XCAP_IncrementFAR_BlockType0_old (int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
 
void XCAP_IncrementFAR_BlockType1 (int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
 
void XCAP_IncrementFAR_BlockType1_new (int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
 
void XCAP_IncrementFAR_BlockType1_old (int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
 
void XCAP_parseFAR (int farValue, int slr, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
 

Function Documentation

◆ XCAP_getFAR()

uint32_t XCAP_getFAR ( int  slr,
int  blockType,
int  globalRowAddress,
int  columnAddress,
int  minorAddress 
)
inline

Definition at line 174 of file inlineFAR.h.

175 {
176  if(FAR_ENABLE_TOP_BOTTOM_BIT == 0){// US and newer devices
177  int rowAddress = (globalRowAddress - SLRinfo[slr].fromRow);
178  return (((blockType & FAR_BLOCKTYPE_MASK) << FAR_BLOCKTYPE_SHIFT) | ((rowAddress & FAR_ROWADDRESS_MASK) << FAR_ROWADDRESS_SHIFT) | ((columnAddress & FAR_COLUMNADDRESS_MASK) << FAR_COLUMNADDRESS_SHIFT) | ((minorAddress & FAR_MINORADDRESS_MASK) << FAR_MINORADDRESS_SHIFT));
179  }
180  //else Series 7 and older devices
181  int rowAddress = (globalRowAddress - SLRinfo[slr].fromRow);
182  int bottomAndNotTop;
183  if(rowAddress < SLRinfo[slr].rowsInBottomHalf) {
184  rowAddress = SLRinfo[slr].rowsInBottomHalf - 1 - rowAddress;
185  bottomAndNotTop = 1; // bottom
186  } else {
187  rowAddress -= SLRinfo[slr].rowsInBottomHalf;
188  bottomAndNotTop = 0; //top
189  }
190  return (((blockType & FAR_BLOCKTYPE_MASK) << FAR_BLOCKTYPE_SHIFT) | ((bottomAndNotTop & 0x1) << FAR_TOP_BOTTOM_BIT_SHIFT) | ((rowAddress & FAR_ROWADDRESS_MASK) << FAR_ROWADDRESS_SHIFT) | ((columnAddress & FAR_COLUMNADDRESS_MASK) << FAR_COLUMNADDRESS_SHIFT) | ((minorAddress & FAR_MINORADDRESS_MASK) << FAR_MINORADDRESS_SHIFT));
191 }

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

Here is the caller graph for this function:

◆ XCAP_getFarFarInstruction()

uint32_t XCAP_getFarFarInstruction ( )
inline

Generate and return the encoding for a Far FAR instruction.

Definition at line 194 of file inlineFAR.h.

195 {
196  return XCAP_getFAR(0, 7, 63, 0, 0);
197 }
uint32_t XCAP_getFAR(int slr, int blockType, int globalRowAddress, int columnAddress, int minorAddress)
Definition: inlineFAR.h:174

References XCAP_getFAR().

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

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

◆ XCAP_IncrementFAR()

void XCAP_IncrementFAR ( int  slrID,
int &  blockType,
int &  globalRowAddress,
int &  columnAddress,
int &  minorAddress 
)
inline

Definition at line 144 of file inlineFAR.h.

145 {
146  if(BLOCKTYPE_LOGIC == blockType){
147  XCAP_IncrementFAR_BlockType0(slrID, blockType, globalRowAddress, columnAddress, minorAddress);
148  } else if(BLOCKTYPE_BLOCKRAM == blockType){
149  XCAP_IncrementFAR_BlockType1(slrID, blockType, globalRowAddress, columnAddress, minorAddress);
150  }
151 }
void XCAP_IncrementFAR_BlockType1(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
Definition: inlineFAR.h:135
void XCAP_IncrementFAR_BlockType0(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
Definition: inlineFAR.h:72

References XCAP_IncrementFAR_BlockType0(), and XCAP_IncrementFAR_BlockType1().

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

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

◆ XCAP_IncrementFAR_BlockType0()

void XCAP_IncrementFAR_BlockType0 ( int  slrID,
int &  blockType,
int &  globalRowAddress,
int &  columnAddress,
int &  minorAddress 
)
inline

Definition at line 72 of file inlineFAR.h.

73 {
74  if(FAR_ENABLE_TOP_BOTTOM_BIT == 0){// US and newer devices
75  XCAP_IncrementFAR_BlockType0_new(slrID, blockType, globalRowAddress, columnAddress, minorAddress);
76  } else {// Series 7 and older devices
77  XCAP_IncrementFAR_BlockType0_old(slrID, blockType, globalRowAddress, columnAddress, minorAddress);
78  }
79 }
void XCAP_IncrementFAR_BlockType0_old(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
Definition: inlineFAR.h:36
void XCAP_IncrementFAR_BlockType0_new(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
Definition: inlineFAR.h:17

References XCAP_IncrementFAR_BlockType0_new(), and XCAP_IncrementFAR_BlockType0_old().

Referenced by XCAP_IncrementFAR().

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

◆ XCAP_IncrementFAR_BlockType0_new()

void XCAP_IncrementFAR_BlockType0_new ( int  slrID,
int &  blockType,
int &  globalRowAddress,
int &  columnAddress,
int &  minorAddress 
)
inline

Definition at line 17 of file inlineFAR.h.

18 {
19  uint8_t resourceLetter = (uint8_t)resourceString[globalRowAddress][columnAddress];
20  minorAddress++;
21  if(minorAddress == LUT_numberOfFramesForResourceLetter[resourceLetter]){
22  minorAddress = 0;
23  columnAddress++;
24  if(columnAddress == numberOfCols[0]){
25  columnAddress = 0;
26  if(globalRowAddress == SLRinfo[slrID].toRow){
27  globalRowAddress = SLRinfo[slrID].fromRow;
28  blockType++;
29  } else {
30  globalRowAddress++;
31  }
32  }
33  }
34 }

Referenced by XCAP_IncrementFAR_BlockType0().

Here is the caller graph for this function:

◆ XCAP_IncrementFAR_BlockType0_old()

void XCAP_IncrementFAR_BlockType0_old ( int  slrID,
int &  blockType,
int &  globalRowAddress,
int &  columnAddress,
int &  minorAddress 
)
inline

Definition at line 36 of file inlineFAR.h.

37 {
38  uint8_t resourceLetter = (uint8_t)resourceString[globalRowAddress][columnAddress];
39  minorAddress++;
40  if(minorAddress == LUT_numberOfFramesForResourceLetter[resourceLetter]){
41  minorAddress = 0;
42  columnAddress++;
43  if(columnAddress == numberOfCols[globalRowAddress]){
44  columnAddress = 0;
45  bool isInTopHalf = (globalRowAddress >= (SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf));
46  if(isInTopHalf){
47  bool isAtTheTopTop = (globalRowAddress == (SLRinfo[slrID].toRow));
48  if(isAtTheTopTop){
49  bool hasNoBottomHalf = (SLRinfo[slrID].rowsInBottomHalf == 0);
50  if(hasNoBottomHalf){ // go to blockram contents
51  globalRowAddress = SLRinfo[slrID].fromRow;
52  blockType++;
53  } else { //go to bottom half
54  globalRowAddress = SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf - 1;
55  }
56  } else {
57  globalRowAddress++;
58  }
59  } else { //is in bottom half
60  bool isAtTheBottomBottom = (globalRowAddress == (SLRinfo[slrID].fromRow));
61  if(isAtTheBottomBottom){
62  globalRowAddress = SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf;
63  blockType++;
64  } else {
65  globalRowAddress--;
66  }
67  }
68  }
69  }
70 }

Referenced by XCAP_IncrementFAR_BlockType0().

Here is the caller graph for this function:

◆ XCAP_IncrementFAR_BlockType1()

void XCAP_IncrementFAR_BlockType1 ( int  slrID,
int &  blockType,
int &  globalRowAddress,
int &  columnAddress,
int &  minorAddress 
)
inline

Definition at line 135 of file inlineFAR.h.

136 {
137  if(FAR_ENABLE_TOP_BOTTOM_BIT == 0){// US and newer devices
138  XCAP_IncrementFAR_BlockType1_new(slrID, blockType, globalRowAddress, columnAddress, minorAddress);
139  } else {// Series 7 and older devices
140  XCAP_IncrementFAR_BlockType1_old(slrID, blockType, globalRowAddress, columnAddress, minorAddress);
141  }
142 }
void XCAP_IncrementFAR_BlockType1_new(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
Definition: inlineFAR.h:81
void XCAP_IncrementFAR_BlockType1_old(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
Definition: inlineFAR.h:99

References XCAP_IncrementFAR_BlockType1_new(), and XCAP_IncrementFAR_BlockType1_old().

Referenced by XCAP_IncrementFAR().

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

◆ XCAP_IncrementFAR_BlockType1_new()

void XCAP_IncrementFAR_BlockType1_new ( int  slrID,
int &  blockType,
int &  globalRowAddress,
int &  columnAddress,
int &  minorAddress 
)
inline

Definition at line 81 of file inlineFAR.h.

82 {
83  minorAddress++;
84  if((columnAddress == numberOfBRAMCols[0])?(minorAddress == EXTRA_FRAMES_PER_ROW):(minorAddress == FRAMES_PER_BRAM_CONTENT_COLUMN)){
85  minorAddress = 0;
86  columnAddress++;
87  if(columnAddress == (numberOfBRAMCols[0] + 1)){
88  columnAddress = 0;
89  if(globalRowAddress == SLRinfo[slrID].toRow){
90  globalRowAddress = SLRinfo[slrID].fromRow;
91  blockType++;
92  } else {
93  globalRowAddress++;
94  }
95  }
96  }
97 }

Referenced by XCAP_IncrementFAR_BlockType1().

Here is the caller graph for this function:

◆ XCAP_IncrementFAR_BlockType1_old()

void XCAP_IncrementFAR_BlockType1_old ( int  slrID,
int &  blockType,
int &  globalRowAddress,
int &  columnAddress,
int &  minorAddress 
)
inline

Definition at line 99 of file inlineFAR.h.

100 {
101  minorAddress++;
102  if((columnAddress == numberOfBRAMCols[globalRowAddress])?(minorAddress == EXTRA_FRAMES_PER_ROW):(minorAddress == FRAMES_PER_BRAM_CONTENT_COLUMN)){
103  minorAddress = 0;
104  columnAddress++;
105  if(columnAddress == (numberOfBRAMCols[globalRowAddress] + 1)){
106  columnAddress = 0;
107 
108  bool isInTopHalf = (globalRowAddress >= (SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf));
109  if(isInTopHalf){
110  bool isAtTheTopTop = (globalRowAddress == (SLRinfo[slrID].toRow));
111  if(isAtTheTopTop){
112  bool hasNoBottomHalf = (SLRinfo[slrID].rowsInBottomHalf == 0);
113  if(hasNoBottomHalf){ // go to next blocktype
114  globalRowAddress = SLRinfo[slrID].fromRow;
115  blockType++;
116  } else { //go to bottom half
117  globalRowAddress = SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf - 1;
118  }
119  } else {
120  globalRowAddress++;
121  }
122  } else { //is in bottom half
123  bool isAtTheBottomBottom = (globalRowAddress == (SLRinfo[slrID].fromRow));
124  if(isAtTheBottomBottom){
125  globalRowAddress = SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf;
126  blockType++;
127  } else {
128  globalRowAddress--;
129  }
130  }
131  }
132  }
133 }

Referenced by XCAP_IncrementFAR_BlockType1().

Here is the caller graph for this function:

◆ XCAP_parseFAR()

void XCAP_parseFAR ( int  farValue,
int  slr,
int &  blockType,
int &  globalRowAddress,
int &  columnAddress,
int &  minorAddress 
)
inline

Definition at line 153 of file inlineFAR.h.

154 {
155  blockType = (farValue >> FAR_BLOCKTYPE_SHIFT) & FAR_BLOCKTYPE_MASK;
156  if(FAR_ENABLE_TOP_BOTTOM_BIT == 0){// US and newer devices
157  globalRowAddress = SLRinfo[slr].fromRow;
158  globalRowAddress += (farValue >> FAR_ROWADDRESS_SHIFT) & FAR_ROWADDRESS_MASK;
159  } else {//Series 7 and older devices
160  int bottomAndNotTop = (farValue >> FAR_TOP_BOTTOM_BIT_SHIFT) & 0x1;
161  globalRowAddress = SLRinfo[slr].fromRow;
162  globalRowAddress += SLRinfo[slr].rowsInBottomHalf;
163  int rowAddress = (farValue >> FAR_ROWADDRESS_SHIFT) & FAR_ROWADDRESS_MASK;
164  if(bottomAndNotTop){ //bottom
165  globalRowAddress -= (1 + rowAddress);
166  } else { //top
167  globalRowAddress += rowAddress;
168  }
169  }
170  columnAddress = (farValue >> FAR_COLUMNADDRESS_SHIFT) & FAR_COLUMNADDRESS_MASK;
171  minorAddress = (farValue >> FAR_MINORADDRESS_SHIFT) & FAR_MINORADDRESS_MASK;
172 }

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

Here is the caller graph for this function: