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;
45 for((numberOfCols[0] = 0, numberOfFramesBeforeCol[0][0] = 0, numberOfBRAMCols[0] = 0) ; (uint8_t)resourceString[0][numberOfCols[0]] ; numberOfCols[0]++){
46 numberOfFramesBeforeCol[0][numberOfCols[0] + 1] = numberOfFramesBeforeCol[0][numberOfCols[0]] + LUT_numberOfFramesForResourceLetter[(uint8_t)resourceString[0][numberOfCols[0]]];
47 numberOfBRAMsBeforeCol[0][numberOfCols[0]] = numberOfBRAMCols[0];
48 if(
str::iff::charIs(resourceString[0][numberOfCols[0]],
'A',
'B',
'C',
'D',
'2'))
49 numberOfBRAMCols[0]++;
51 for(
int c = numberOfCols[0] + 1 ; c <
XUS_MAX_COLS ; c++){
52 numberOfFramesBeforeCol[0][c] = numberOfFramesBeforeCol[0][c - 1];
55 numberOfBRAMsBeforeCol[0][c] = numberOfBRAMsBeforeCol[0][c - 1];
57 numberOfFramesPerRow[0] = numberOfFramesBeforeCol[0][numberOfCols[0]];
60 maxNumberOfCols = numberOfCols[0];
61 maxNumberOfBRAMCols = numberOfBRAMCols[0];
62 for(
int r = 1 ; r < numberOfRows ; r++){
63 numberOfBRAMCols[r] = numberOfBRAMCols[0];
64 numberOfCols[r] = numberOfCols[0];
65 numberOfFramesPerRow[r] = numberOfFramesPerRow[0];
66 numberOfWordsPerRow[r] = numberOfWordsPerRow[0];
68 numberOfFramesBeforeCol[r][c] = numberOfFramesBeforeCol[0][c];
71 numberOfBRAMsBeforeCol[r][c] = numberOfBRAMsBeforeCol[0][c];
78 if(initializedResourceStringShortPartName ==
"")
79 throw runtime_error(
"The target device needs to be known, before you can manipulate any bitstream!");
80 if(initializedBitstreamShortPartName != initializedResourceStringShortPartName){
81 initializedBitstreamShortPartName = initializedResourceStringShortPartName;
82 if(bitstreamBegin !=
nullptr)
83 delete bitstreamBegin;
84 initializeResourceStringParameters();
86 int clbPlaneSize = numberOfRows * numberOfWordsPerRow[0];
89 bitstreamBegin =
new uint32_t[clbPlaneSize + bramPlaneSize];
93 for(
int slr = 0 ; slr < numberOfSLRs ; slr++){
94 for(
int r = SLRinfo[slr].fromRow ; r <= SLRinfo[slr].toRow ; r++){
95 for(
int c = 0 ; c < numberOfCols[r] ; c++){
96 bitstreamCLB[r][c] = &bitstreamBegin[offset];
97 offset += LUT_numberOfFramesForResourceLetter[(uint8_t)resourceString[r][c]] *
XUS_WORDS_PER_FRAME;
100 for(
int r = SLRinfo[slr].fromRow ; r <= SLRinfo[slr].toRow ; r++){
101 for(
int c = 0 ; c < numberOfBRAMCols[r] ; c++){
102 bitstreamBRAM[r][c] = &bitstreamBegin[offset];
105 bitstreamBRAM[r][numberOfBRAMCols[r]] = &bitstreamBegin[offset];
109 bitstreamEnd = &bitstreamBegin[offset];
110 bitstreamHasValidData =
false;
112 log(
"Reserved " +
to_string(clbPlaneSize + bramPlaneSize) +
" words for the bitstream buffers of device \"" + partName +
"\"");
118 return "BlockRAM Contents";
120 return LUT_typeOfFrameForResourceLetter[(uint8_t)resourceString[rowAddress][columnAddress]];
#define XUS_FRAMES_PER_BRAM_CONTENT_COLUMN
#define XUS_BLOCKTYPE_BLOCKRAM
#define XUS_WORDS_PER_FRAME
#define XUS_EXTRA_FRAMES_PER_ROW
#define XUS_BLOCKTYPE_LOGIC
virtual ~XilinxUltraScale()
std::string getFrameType(int, int, int) override
void initializeResourceStringParameters() override
void ensureInitializedBitstreamArrays() override
std::string to_string(Endianness e)
bool charIs(char checkedChar)
Returns false. End of recursion for template.