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

Go to the source code of this file.

Functions

void blankBuffers ()
 
void clearResourceStringArrays ()
 

Function Documentation

◆ blankBuffers()

void blankBuffers ( )
inline

Definition at line 23 of file inlineBlank.h.

24 {
25  uint8_t blankByte = selectedOptions.intParam % 256;
26  if(regionSelection.empty()) {
27  if(selectedOptions.clb && selectedOptions.clk) {
28  memset(&bitstreamBegin[0], blankByte, ((uint64_t)&bitstreamBRAM[0][0][0]-(uint64_t)&bitstreamBegin[0]));
29  }
30  else if(selectedOptions.clb || selectedOptions.clk){
31  for(int r = 0 ; r < numberOfRows ; r++){
32  for(int c = 0 ; c < numberOfCols[r] ; c++){
33  for(int m = 0 ; m < LUT_numberOfFramesForResourceLetter[(uint8_t)resourceString[r][c]] ; m++){
34  if(selectedOptions.clb){
35  memset(&bitstreamCLB[r][c][m*WORDS_PER_FRAME], blankByte, (WORDS_BEFORE_CLK * 4));
36  memset(&bitstreamCLB[r][c][m*WORDS_PER_FRAME+(WORDS_BEFORE_CLK+WORDS_AT_CLK)], blankByte, (WORDS_AFTER_CLK * 4));
37  }
38  if(selectedOptions.clk){
39  for(int w = 0 ; w < WORDS_AT_CLK ; w++){
40  bitstreamCLB[r][c][m*WORDS_PER_FRAME + WORDS_BEFORE_CLK + w] = ((blankByte << 24) | (blankByte << 16) | (blankByte << 8) | (blankByte));
41  }
42  }
43  }
44  }
45  }
46  }
47  if(selectedOptions.bram)
48  memset(&bitstreamBRAM[0][0][0], blankByte, ((uint64_t)&bitstreamEnd[0]-(uint64_t)&bitstreamBRAM[0][0][0]));
49  } else {
50  for (Rect2D &selRect : regionSelection) {
51  int fromRow = selRect.position.row / CLB_PER_CLOCK_REGION;
52  int toRow = (selRect.position.row + selRect.size.row) / CLB_PER_CLOCK_REGION;
53  int fromCol = selRect.position.col;
54  int toCol = selRect.position.col + selRect.size.col;
55  for(int r = fromRow ; r < toRow ; r++){
56  if(selectedOptions.clb && selectedOptions.clk){
57  int blankSize = numberOfFramesBeforeCol[r][toCol] - numberOfFramesBeforeCol[r][fromCol];
58  blankSize *= WORDS_PER_FRAME * 4;
59  memset(&bitstreamCLB[r][fromCol][0], blankByte, blankSize);
60  }
61  else if(selectedOptions.clb || selectedOptions.clk){
62  for(int c = fromCol ; c < toCol ; c++){
63  for(int m = 0 ; m < LUT_numberOfFramesForResourceLetter[(uint8_t)resourceString[r][c]] ; m++){
64  if(selectedOptions.clb){
65  memset(&bitstreamCLB[r][c][m*WORDS_PER_FRAME], blankByte, (WORDS_BEFORE_CLK * 4));
66  memset(&bitstreamCLB[r][c][m*WORDS_PER_FRAME+(WORDS_BEFORE_CLK+WORDS_AT_CLK)], blankByte, (WORDS_AFTER_CLK * 4));
67  }
68  if(selectedOptions.clk){
69  for(int w = 0 ; w < WORDS_AT_CLK ; w++){
70  bitstreamCLB[r][c][m*WORDS_PER_FRAME + WORDS_BEFORE_CLK + w] = ((blankByte << 24) | (blankByte << 16) | (blankByte << 8) | (blankByte));
71  }
72  }
73  }
74  }
75  }
76  if(selectedOptions.bram){
77  int blankSize = numberOfBRAMsBeforeCol[r][toCol] - numberOfBRAMsBeforeCol[r][fromCol];
78  blankSize *= FRAMES_PER_BRAM_CONTENT_COLUMN * WORDS_PER_FRAME * 4;
79  memset(&bitstreamCLB[r][numberOfBRAMsBeforeCol[r][fromCol]][0], blankByte, blankSize); //memset with size 0 is safe, no need to check anything
80  }
81  }
82  }
83  }
84  bitstreamHasValidData = true;
85 }
Definition: Coords.h:29

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

Here is the caller graph for this function:

◆ clearResourceStringArrays()

void clearResourceStringArrays ( )
inline

Definition at line 17 of file inlineBlank.h.

18 {
19  initializedResourceStringShortPartName = "";
20  memset(&resourceString, 0, MAX_ROWS * MAX_COLS * sizeof(char));
21 }

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

Here is the caller graph for this function: