27 #include "../../../Common/str.h"
41 if(initializedResourceStringShortPartName ==
"")
42 throw runtime_error(
"The target device needs to be known, before you can manipulate any bitstream!");
43 if(initializedBitstreamParamsShortPartName != initializedResourceStringShortPartName){
44 initializedBitstreamParamsShortPartName = initializedResourceStringShortPartName;
46 for((numberOfCols[0] = 0, numberOfFramesBeforeCol[0][0] = 0, numberOfBRAMCols[0] = 0) ; resourceString[0][numberOfCols[0]] !=
'\0' ; numberOfCols[0]++){
47 numberOfFramesBeforeCol[0][numberOfCols[0] + 1] = numberOfFramesBeforeCol[0][numberOfCols[0]] + LUT_numberOfFramesForResourceLetter[(uint8_t)resourceString[0][numberOfCols[0]]];
48 numberOfBRAMsBeforeCol[0][numberOfCols[0]] = numberOfBRAMCols[0];
50 numberOfBRAMCols[0]++;
53 numberOfFramesBeforeCol[0][c] = numberOfFramesBeforeCol[0][c - 1];
56 numberOfBRAMsBeforeCol[0][c] = numberOfBRAMsBeforeCol[0][c - 1];
58 numberOfFramesPerRow[0] = numberOfFramesBeforeCol[0][numberOfCols[0] + 1];
61 maxNumberOfCols = numberOfCols[0];
62 maxNumberOfBRAMCols = numberOfBRAMCols[0];
63 for(
int r = 1 ; r < numberOfRows ; r++){
64 numberOfBRAMCols[r] = numberOfBRAMCols[0];
65 numberOfCols[r] = numberOfCols[0];
66 numberOfFramesPerRow[r] = numberOfFramesPerRow[0];
67 numberOfWordsPerRow[r] = numberOfWordsPerRow[0];
69 numberOfFramesBeforeCol[r][c] = numberOfFramesBeforeCol[0][c];
72 numberOfBRAMsBeforeCol[r][c] = numberOfBRAMsBeforeCol[0][c];
79 if(initializedResourceStringShortPartName ==
"")
80 throw runtime_error(
"The target device needs to be known, before you can manipulate any bitstream!");
81 if(initializedBitstreamShortPartName != initializedResourceStringShortPartName){
82 initializedBitstreamShortPartName = initializedResourceStringShortPartName;
83 if(bitstreamBegin !=
nullptr)
84 delete bitstreamBegin;
86 initializeResourceStringParameters();
88 int clbPlaneSize = numberOfRows * numberOfWordsPerRow[0];
91 bitstreamBegin =
new uint32_t[clbPlaneSize + bramPlaneSize + 100];
96 for(
int slr = 0 ; slr < numberOfSLRs ; slr++){
97 for(
int r = SLRinfo[slr].fromRow ; r <= SLRinfo[slr].toRow ; r++){
98 for(
int c = 0 ; c < numberOfCols[r] ; c++){
99 bitstreamCLB[r][c] = &bitstreamBegin[offset];
100 offset += LUT_numberOfFramesForResourceLetter[(uint8_t)resourceString[r][c]] *
XUSP_WORDS_PER_FRAME;
103 for(
int r = SLRinfo[slr].fromRow ; r <= SLRinfo[slr].toRow ; r++){
104 for(
int c = 0 ; c < numberOfBRAMCols[r] ; c++){
105 bitstreamBRAM[r][c] = &bitstreamBegin[offset];
108 bitstreamBRAM[r][numberOfBRAMCols[r]] = &bitstreamBegin[offset];
112 bitstreamEnd = &bitstreamBegin[offset];
113 bitstreamHasValidData =
false;
114 log(
"Reserved " +
to_string(clbPlaneSize + bramPlaneSize) +
" words for the bitstream buffers of device \"" + partName +
"\"");
120 return "BlockRAM Contents";
122 return LUT_typeOfFrameForResourceLetter[(uint8_t)resourceString[rowAddress][columnAddress]];
#define XUSP_WORDS_PER_FRAME
#define XUSP_EXTRA_FRAMES_PER_ROW
#define XUSP_FRAMES_PER_BRAM_CONTENT_COLUMN
#define XUSP_BLOCKTYPE_BLOCKRAM
#define XUSP_BLOCKTYPE_LOGIC
virtual ~XilinxUltraScalePlus()
void initializeResourceStringParameters() override
void ensureInitializedBitstreamArrays() override
std::string getFrameType(int, int, int) override
std::string to_string(Endianness e)
bool charIs(char checkedChar)
Returns false. End of recursion for template.