19 uint8_t resourceLetter = (uint8_t)resourceString[globalRowAddress][columnAddress];
21 if(minorAddress == LUT_numberOfFramesForResourceLetter[resourceLetter]){
24 if(columnAddress == numberOfCols[0]){
26 if(globalRowAddress == SLRinfo[slrID].toRow){
27 globalRowAddress = SLRinfo[slrID].fromRow;
38 uint8_t resourceLetter = (uint8_t)resourceString[globalRowAddress][columnAddress];
40 if(minorAddress == LUT_numberOfFramesForResourceLetter[resourceLetter]){
43 if(columnAddress == numberOfCols[globalRowAddress]){
45 bool isInTopHalf = (globalRowAddress >= (SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf));
47 bool isAtTheTopTop = (globalRowAddress == (SLRinfo[slrID].toRow));
49 bool hasNoBottomHalf = (SLRinfo[slrID].rowsInBottomHalf == 0);
51 globalRowAddress = SLRinfo[slrID].fromRow;
54 globalRowAddress = SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf - 1;
60 bool isAtTheBottomBottom = (globalRowAddress == (SLRinfo[slrID].fromRow));
61 if(isAtTheBottomBottom){
62 globalRowAddress = SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf;
74 if(FAR_ENABLE_TOP_BOTTOM_BIT == 0){
84 if((columnAddress == numberOfBRAMCols[0])?(minorAddress == EXTRA_FRAMES_PER_ROW):(minorAddress == FRAMES_PER_BRAM_CONTENT_COLUMN)){
87 if(columnAddress == (numberOfBRAMCols[0] + 1)){
89 if(globalRowAddress == SLRinfo[slrID].toRow){
90 globalRowAddress = SLRinfo[slrID].fromRow;
102 if((columnAddress == numberOfBRAMCols[globalRowAddress])?(minorAddress == EXTRA_FRAMES_PER_ROW):(minorAddress == FRAMES_PER_BRAM_CONTENT_COLUMN)){
105 if(columnAddress == (numberOfBRAMCols[globalRowAddress] + 1)){
108 bool isInTopHalf = (globalRowAddress >= (SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf));
110 bool isAtTheTopTop = (globalRowAddress == (SLRinfo[slrID].toRow));
112 bool hasNoBottomHalf = (SLRinfo[slrID].rowsInBottomHalf == 0);
114 globalRowAddress = SLRinfo[slrID].fromRow;
117 globalRowAddress = SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf - 1;
123 bool isAtTheBottomBottom = (globalRowAddress == (SLRinfo[slrID].fromRow));
124 if(isAtTheBottomBottom){
125 globalRowAddress = SLRinfo[slrID].fromRow + SLRinfo[slrID].rowsInBottomHalf;
137 if(FAR_ENABLE_TOP_BOTTOM_BIT == 0){
144 inline void XCAP_IncrementFAR(
int slrID,
int &blockType,
int &globalRowAddress,
int &columnAddress,
int &minorAddress)
146 if(BLOCKTYPE_LOGIC == blockType){
148 }
else if(BLOCKTYPE_BLOCKRAM == blockType){
153 inline void XCAP_parseFAR(
int farValue,
int slr,
int &blockType,
int &globalRowAddress,
int &columnAddress,
int &minorAddress)
155 blockType = (farValue >> FAR_BLOCKTYPE_SHIFT) & FAR_BLOCKTYPE_MASK;
156 if(FAR_ENABLE_TOP_BOTTOM_BIT == 0){
157 globalRowAddress = SLRinfo[slr].fromRow;
158 globalRowAddress += (farValue >> FAR_ROWADDRESS_SHIFT) & FAR_ROWADDRESS_MASK;
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;
165 globalRowAddress -= (1 + rowAddress);
167 globalRowAddress += rowAddress;
170 columnAddress = (farValue >> FAR_COLUMNADDRESS_SHIFT) & FAR_COLUMNADDRESS_MASK;
171 minorAddress = (farValue >> FAR_MINORADDRESS_SHIFT) & FAR_MINORADDRESS_MASK;
174 inline uint32_t
XCAP_getFAR(
int slr,
int blockType,
int globalRowAddress,
int columnAddress,
int minorAddress)
176 if(FAR_ENABLE_TOP_BOTTOM_BIT == 0){
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));
181 int rowAddress = (globalRowAddress - SLRinfo[slr].fromRow);
183 if(rowAddress < SLRinfo[slr].rowsInBottomHalf) {
184 rowAddress = SLRinfo[slr].rowsInBottomHalf - 1 - rowAddress;
187 rowAddress -= SLRinfo[slr].rowsInBottomHalf;
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));
void XCAP_IncrementFAR_BlockType1(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
void XCAP_IncrementFAR_BlockType0(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
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.
void XCAP_IncrementFAR_BlockType0_old(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_parseFAR(int farValue, int slr, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
void XCAP_IncrementFAR(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_BlockType1_old(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)