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]));
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));
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));
47 if(selectedOptions.bram)
48 memset(&bitstreamBRAM[0][0][0], blankByte, ((uint64_t)&bitstreamEnd[0]-(uint64_t)&bitstreamBRAM[0][0][0]));
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);
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));
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));
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);
84 bitstreamHasValidData =
true;