byteman  1.3 (Build #225)
Bitstream relocation and manipulation tool
Public Member Functions | Public Attributes | List of all members
XilinxUltraScale Class Reference

#include "XilinxUltraScale.h"

Inheritance diagram for XilinxUltraScale:
Inheritance graph
[legend]
Collaboration diagram for XilinxUltraScale:
Collaboration graph
[legend]

Public Member Functions

void assembler (std::string, std::string)
 
void assemblerAsmTo (std::ifstream &, std::ofstream &)
 
void assemblerAsmToBin (std::ifstream &, std::ofstream &)
 
void assemblerAsmToBit (std::ifstream &, std::ofstream &)
 
void assemblerParseHeader (std::ifstream &)
 
void blank (std::string)
 
void change (std::string)
 
void deviceHelp ()
 
void disassemblerBinToAsm (std::string, std::ifstream &, std::ofstream &)
 
void disassemblerBitToAsm (std::ifstream &, std::ofstream &)
 
void disassemblerToAsm (std::ifstream &, std::ofstream &)
 
void disassemblerWriteHeader (std::ofstream &)
 
void ensureInitializedBitstreamArrays () override
 
int getDeviceByIDCODE (int) override
 
int getDeviceByIDCODEorThrow (int) override
 
int getDeviceByName (std::string) override
 
int getDeviceByNameOrThrow (std::string) override
 
std::string getFrameType (int, int, int) override
 
void initFabric ()
 
void initializeResourceStringParameters () override
 
void merge (XilinxUltraScale *, std::string, Rect2D, Coord2D)
 
void outputBitstreamEmptySLRHeaderSequence (std::ofstream &, int, bool, Endianness) override
 
void outputBitstreamEmptySLRWrapUpSequence (std::ofstream &, int, bool, Endianness) override
 
void outputBitstreamGlobalFooterSequence (std::ofstream &, bool, Endianness) override
 
void outputBitstreamGlobalHeaderSequence (std::ofstream &, bool, Endianness) override
 Written by outputBitstreamSLRHeaderAfterBitstreamSequence(), outputBitstreamEmptySLRHeaderSequence() and used by outputBitstreamSLRWrapUpSequence(), outputBitstreamEmptySLRWrapUpSequence() More...
 
void outputBitstreamSLRFooterBitstreamSequence (std::ofstream &, int, bool, Endianness) override
 
void outputBitstreamSLRHeaderAfterBitstreamSequence (std::ofstream &, int, bool, Endianness) override
 
void outputBitstreamSLRHeaderBitstreamSequence (std::ofstream &, int, bool, Endianness) override
 
void outputBitstreamSLRWrapUpSequence (std::ofstream &, int, bool, Endianness) override
 
void readBitstream (std::string)
 
void setDevice (int, std::string="") override
 
void setDeviceByIDCODEOrThrow (int) override
 
void setDeviceByNameOrThrow (std::string) override
 
void setDeviceByPartNameOrThrow () override
 
void test (bool, bool, uint32_t)
 
void writeBitstream (std::string, std::string, Rect2D)
 
 XilinxUltraScale ()
 
virtual ~XilinxUltraScale ()
 
- Public Member Functions inherited from CommonDevice2D
 CommonDevice2D ()
 
void region (std::string, Rect2D)
 
virtual ~CommonDevice2D ()
 
- Public Member Functions inherited from CommonDevice
 CommonDevice ()
 
void log (std::string message)
 
void printMessage (std::string message)
 
void warn (std::string message)
 
virtual ~CommonDevice ()
 
- Public Member Functions inherited from XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >
 XilinxConfigurationAccessPort ()
 
virtual ~XilinxConfigurationAccessPort ()
 

Public Attributes

std::streamoff slrMagicInstrLocation [3]
 
- Public Attributes inherited from CommonDevice2D
std::vector< Rect2DregionSelection
 
- Public Attributes inherited from CommonDevice
int enableLog
 
int enableWarn
 
std::string instanceName
 
- Public Attributes inherited from XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >
uint32_t * bitstreamBegin
 
uint32_t * bitstreamBRAM [MAX_ROWS][MAX_BRAM_COLS]
 
uint32_t * bitstreamCLB [MAX_ROWS][MAX_COLS]
 
uint32_t * bitstreamEnd
 
bool bitstreamHasValidData
 
std::string designName
 
std::string fileDate
 
std::string fileTime
 
int fromRow
 
std::streamoff headerLocationOfRemainingFileLength
 gets set by outputBITheader() and gets used by outputBITheaderLengthField(). More...
 
uint32_t IDCODE
 
std::string initializedBitstreamParamsShortPartName
 the partName of currently initialized resource string parameters More...
 
std::string initializedBitstreamShortPartName
 The partName of currently initialized bitstream buffers. More...
 
std::string initializedResourceStringShortPartName
 the partName of currently initialized resource string parameters More...
 
Endianness loadedBitstreamEndianness
 The endianess of the currently loaded bitstream. More...
 
bool LUT_isFrameUnusedForResourceLetter [256]
 
int LUT_numberOfFramesForResourceLetter [256]
 
std::string LUT_typeOfFrameForResourceLetter [256]
 
int maxNumberOfBRAMCols
 
int maxNumberOfCols
 
int numberOfBRAMCols [MAX_ROWS]
 
int numberOfBRAMsBeforeCol [MAX_ROWS][MAX_COLS]
 
int numberOfCols [MAX_ROWS]
 
int numberOfFramesBeforeCol [MAX_ROWS][MAX_COLS]
 
int numberOfFramesPerRow [MAX_ROWS]
 
int numberOfRows
 
int numberOfSLRs
 
int numberOfWordsPerRow [MAX_ROWS]
 
std::string partName
 
char resourceString [MAX_ROWS][MAX_COLS]
 
int rowsInBottomHalf
 
int rowsInTopHalf
 
struct XilinxConfigurationAccessPort::SelectedOptions selectedOptions
 
struct {
   int   fromRow
 
   uint32_t   IDCODE
 
   int   rowsInBottomHalf
 
   int   rowsInTopHalf
 
   int   toRow
 
SLRinfo [MAX_SLRS]
 
int toRow
 

Additional Inherited Members

- Public Types inherited from XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >
enum class  MergeOP
 

Detailed Description

Definition at line 31 of file XilinxUltraScale.h.

Constructor & Destructor Documentation

◆ XilinxUltraScale()

XilinxUltraScale::XilinxUltraScale ( )

Definition at line 31 of file XilinxUltraScale.cpp.

32 {
33  initFabric();
34 }

◆ ~XilinxUltraScale()

XilinxUltraScale::~XilinxUltraScale ( )
virtual

Definition at line 36 of file XilinxUltraScale.cpp.

37 {
38 }

Member Function Documentation

◆ assembler()

void XilinxUltraScale::assembler ( std::string  ,
std::string   
)

Definition at line 32 of file XUS_Assembler.cpp.

33 {
34  enum FILEFORMAT {FILE_NULL = 0, FILE_BIT, FILE_BIN, FILE_BIT_ASM};
35  FILEFORMAT fileformatIn = FILE_NULL, fileformatOut = FILE_NULL;
36 
37  if(str::iff::stringEndsWith(filenameIn, ".bit"))
38  fileformatIn = FILE_BIT;
39  if(str::iff::stringEndsWith(filenameIn, ".bin"))
40  fileformatIn = FILE_BIN;
41  if(str::iff::stringEndsWith(filenameIn, ".bitasm"))
42  fileformatIn = FILE_BIT_ASM;
43  if(str::iff::stringEndsWith(filenameOut, ".bit"))
44  fileformatOut = FILE_BIT;
45  if(str::iff::stringEndsWith(filenameOut, ".bin"))
46  fileformatOut = FILE_BIN;
47  if(str::iff::stringEndsWith(filenameOut, ".bitasm"))
48  fileformatOut = FILE_BIT_ASM;
49 
50  ifstream fin (filenameIn, ifstream::binary);
51  if(!fin.good())
52  throw runtime_error(string("Could not open file: \"").append(filenameIn).append("\" .\n"));
53 
54  ofstream fout (filenameOut, ofstream::binary | ofstream::trunc);
55  if(!fout.good())
56  throw runtime_error(string("Could not open file: \"").append(filenameOut).append("\"!\n"));
57 
58  if(fileformatIn == FILE_BIT && fileformatOut == FILE_BIT_ASM)
59  disassemblerBitToAsm(fin, fout);
60  else if(fileformatIn == FILE_BIN && fileformatOut == FILE_BIT_ASM)
61  disassemblerBinToAsm(filenameIn, fin, fout);
62  else if(fileformatIn == FILE_BIT_ASM && fileformatOut == FILE_BIT)
63  assemblerAsmToBit(fin, fout);
64  else if(fileformatIn == FILE_BIT_ASM && fileformatOut == FILE_BIN)
65  assemblerAsmToBin(fin, fout);
66  else
67  throw runtime_error(string("Unknown Xilinx US assembler operation between file formats. See \"byteman -h assembly\".\n"));
68  fin.close();
69  fout.close();
70 }
void assemblerAsmToBit(std::ifstream &, std::ofstream &)
void disassemblerBitToAsm(std::ifstream &, std::ofstream &)
void disassemblerBinToAsm(std::string, std::ifstream &, std::ofstream &)
void assemblerAsmToBin(std::ifstream &, std::ofstream &)
bool stringEndsWith(std::string checkedString)
Returns false. End of recursion for template.
Definition: iff.h:32

References str::iff::stringEndsWith().

Here is the call graph for this function:

◆ assemblerAsmTo()

void XilinxUltraScale::assemblerAsmTo ( std::ifstream &  ,
std::ofstream &   
)

Definition at line 125 of file XUS_Assembler.cpp.

126 {
128 
130  int frameCount = 0;
131  int slr = 0, b = 7, r = 0, c = 0, m = 0;
132  for (string line; getline(fin, line); ) {
133  if(line.at(line.find_first_not_of(" \t")) == '#')// if #, skip that line as comment
134  continue;
135  transform(line.begin(), line.end(), line.begin(), ::toupper);
136  replace(line.begin(), line.end(), '=',' ');
137  replace(line.begin(), line.end(), '#',' ');
138  replace(line.begin(), line.end(), ',', ' ');
139  if(str::iff::stringContains(line, "SYNC") && (!str::iff::stringContains(line, "DESYNC"))){
141  }
142  else if(str::iff::stringContains(line, ".WORD")){
143  uint32_t wordValue;
144  if(!str::parse::multipleUints(line, wordValue))wordValue = 0;
145  FileIO::write32(fout, wordValue, loadedBitstreamEndianness);
146  }
147  else if(str::iff::stringContains(line, ".BYTE")){
148  uint32_t value;
149  if(!str::parse::multipleUints(line, value))value = 0;
150  uint32_t byteValue = value % 256;
151  FileIO::write8(fout, byteValue, loadedBitstreamEndianness);
152  }
153  else if(str::iff::stringContains(line, "NOP")){
154  int nopHiddenValue;
155  if(!str::parse::multipleInts(line, nopHiddenValue))nopHiddenValue = 0;
156  XCAP_writeNOP(fout, 1, nopHiddenValue, loadedBitstreamEndianness);
157  }
158  else if(str::iff::stringContains(line, "RESERVED")){
159  int reservedHiddenValue;
160  if(!str::parse::multipleInts(line, reservedHiddenValue))reservedHiddenValue = 0;
161  XCAP_writeRESERVED(fout, 1, reservedHiddenValue, loadedBitstreamEndianness);
162  }
163  else if(str::iff::stringContains(line, "SELECT NEXT SLR")){
164  slr++;
165  int magic1size;
166  if(!str::parse::multipleInts(line, magic1size))magic1size = 0;
168  XCAP_writeType2(fout, magic1size, loadedBitstreamEndianness);
169  }
170  else if(str::iff::stringContains(line, "@")){
171  XCAP::Register newRegAddr = getXCAPregister(line);
172  if(str::iff::stringContains(line, "READ REG @")){
173  int readLength;
174  if(!str::parse::multipleInts(line, readLength)) readLength = 1; // default read length is 1 if unspecified
175  XCAP_writeReadRegister(fout, newRegAddr, readLength, loadedBitstreamEndianness);
176  } else {// must be a write then ¯\_(ツ)_/¯
177 
178  if(newRegAddr == XCAP::Register::UNDEFINED){
179  throw runtime_error(string("Couldn't parse assembly command: \"").append(line).append("\"!"));
180  } else if(str::iff::stringContains(line, "SELECT REGISTER")){
182  } else if(newRegAddr == XCAP::Register::FDRI){
183  if(!str::parse::multipleInts(line, frameCount))
184  throw runtime_error(string("FDRI command needs size: \"").append(line).append("\"!"));
185  int wordCount = frameCount * XUS_WORDS_PER_FRAME;
186  if(regAddr == XCAP::Register::FDRI) {
187  XCAP_writeType2(fout, wordCount, loadedBitstreamEndianness);
188  } else {
189  XCAP_writeFDRI1(fout, wordCount, loadedBitstreamEndianness);
190  }
191  if(frameCount > 0){
192  string frameLine;
193  for (string frameLine; getline(fin, frameLine); ) {
194  if(frameLine.at(frameLine.find_first_not_of(" \t")) == '#')// if #, skip that line as comment
195  continue;
196  uint32_t frameData[XUS_WORDS_PER_FRAME];
197  if(!str::parse::arrayOfUints(frameLine, XUS_WORDS_PER_FRAME, &frameData[0]))
198  throw runtime_error(string("Was expecting the data for a full frame on this line: \"").append(frameLine).append("\", because I think there are ").append(to_string(frameCount)).append(" frames left."));
199  //first 3 words are clk, next 90 are the 0-45 and 48-93 data words
200  for (int w = XUS_WORDS_AT_CLK; w < (XUS_WORDS_AT_CLK + XUS_WORDS_BEFORE_CLK) ; w++){
201  FileIO::write32(fout, frameData[w], loadedBitstreamEndianness);
202  }
203  for (int w = 0; w < XUS_WORDS_AT_CLK ; w++){
204  FileIO::write32(fout, frameData[w], loadedBitstreamEndianness);
205  }
206  for (int w = (XUS_WORDS_AT_CLK + XUS_WORDS_BEFORE_CLK); w < XUS_WORDS_PER_FRAME ; w++){
207  FileIO::write32(fout, frameData[w], loadedBitstreamEndianness);
208  }
209 
210  frameCount--;
211  if(frameCount == 0)
212  break;
213  }
214  if(frameCount != 0)
215  throw runtime_error(string("End of file reached while performing FDRI frame writes.!"));
216  }
217  } else if(newRegAddr == XCAP::Register::FAR){
218  if(!str::parse::multipleInts(line, b, r, c, m))
219  throw runtime_error(string("Could not parse the new FAR value: \"").append(line).append("\"!"));
220  r += SLRinfo[slr].fromRow;
221  uint32_t farValue = XCAP_getFAR(slr, b, r, c, m);
223  } else {
224  uint32_t newValue;
225  if(!str::parse::multipleUints(line, newValue))
226  throw runtime_error(string("Could not parse the new register value: \"").append(line).append("\"!"));
227  XCAP_writeRegister(fout, newRegAddr, newValue, loadedBitstreamEndianness);
228  }
229  }
230  regAddr = newRegAddr;
231  } else {// ! str::iff::stringContains(line, "@")
232  //must have been a command then
233  XCAP::Command cmdID = getXCAPcommand(line);
234  if(cmdID == XCAP::Command::UNDEFINED)
235  throw runtime_error(string("Couldn't parse assembly command: \"").append(line).append("\"!"));
237  }
238  }
240 }
#define XUS_WORDS_BEFORE_CLK
Definition: XUS_Fabric.h:37
#define XUS_WORDS_PER_FRAME
Definition: XUS_Fabric.h:40
#define XUS_WORDS_AT_CLK
Definition: XUS_Fabric.h:38
void XCAP_writeRegister(std::ofstream &fout, XCAP::Register reg, int writeValue, Endianness e)
Generate the encoding for writing a CAP register and write it to file ofstream.
Definition: inlineCAP.h:382
void XCAP_writeFDRI1(std::ofstream &fout, int wordCount, Endianness e)
Generate and write only a type 1 FDRI command.
Definition: inlineCAP.h:403
XCAP::Command getXCAPcommand(std::string s)
Definition: inlineCAP.h:67
void XCAP_writeCommand(std::ofstream &fout, XCAP::Command cmd, Endianness e)
Generate the encoding for writing a CAP command and write it to file ofstream.
Definition: inlineCAP.h:390
void XCAP_writeSYNQ(std::ofstream &fout, Endianness e)
Generate and write an SYNQ command.
Definition: inlineCAP.h:436
void XCAP_writeSelectRegister(std::ofstream &fout, XCAP::Register reg, Endianness e)
Generate the encoding for "selecting" a CAP register and write it to file ofstream.
Definition: inlineCAP.h:368
void XCAP_writeRESERVED(std::ofstream &fout, int cnt, int payload, Endianness e)
Generate the encoding for Reserved instructions and write them to file ofstream.
Definition: inlineCAP.h:360
void XCAP_writeType2(std::ofstream &fout, int wordCount, Endianness e)
Generate and write only a type 2 FDRI command.
Definition: inlineCAP.h:410
void XCAP_writeNOP(std::ofstream &fout, int cnt, int payload, Endianness e)
Generate the encoding for NOP instructions and write them to file ofstream.
Definition: inlineCAP.h:352
void XCAP_writeReadRegister(std::ofstream &fout, XCAP::Register reg, int readLength, Endianness e)
Generate the encoding for reading a CAP register and write it to file ofstream.
Definition: inlineCAP.h:375
XCAP::Register getXCAPregister(std::string s)
Definition: inlineCAP.h:19
uint32_t XCAP_getFAR(int slr, int blockType, int globalRowAddress, int columnAddress, int minorAddress)
Definition: inlineFAR.h:174
void outputCAPheaderConstant(std::ofstream &fout, Endianness e)
Definition: inlineOutput.h:60
void outputBITheaderLengthField(std::ofstream &fout, Endianness e)
Definition: inlineOutput.h:52
std::string to_string(Endianness e)
Definition: Endianness.h:56
void write8(std::ofstream &fout, uint8_t writeValue, Endianness e=Endianness::NATIVE)
Definition: FileIO.h:445
void write32(std::ofstream &fout, uint32_t writeValue, Endianness e=Endianness::NATIVE)
Definition: FileIO.h:419
Register
Definition: XCAP.h:20
Command
Definition: XCAP.h:46
bool stringContains(std::string checkedString)
Returns false. End of recursion for template.
Definition: iff.h:57
bool arrayOfUints(std::string s, int arrsize, uint32_t *arr)
Removes all string words from a given string s and returns the parsed arrsize number of integers into...
Definition: parse.h:160
bool multipleUints(std::stringstream &ss)
Definition: parse.h:229
bool multipleInts(std::stringstream &ss)
Definition: parse.h:192
std::string replace(std::string str, char oldChar, char newChar)
Replaces all instances of oldChar in string str with newChar and returns the resulting string.
Definition: str.h:41

References str::parse::arrayOfUints(), XCAP::FAR, XCAP::FDRI, getXCAPcommand(), getXCAPregister(), XCAP::MAGIC1, str::parse::multipleInts(), str::parse::multipleUints(), outputBITheaderLengthField(), outputCAPheaderConstant(), str::replace(), str::iff::stringContains(), Endian::to_string(), XCAP::UNDEFINED, FileIO::write32(), FileIO::write8(), XCAP_getFAR(), XCAP_writeCommand(), XCAP_writeFDRI1(), XCAP_writeNOP(), XCAP_writeReadRegister(), XCAP_writeRegister(), XCAP_writeRESERVED(), XCAP_writeSelectRegister(), XCAP_writeSYNQ(), XCAP_writeType2(), XUS_WORDS_AT_CLK, XUS_WORDS_BEFORE_CLK, and XUS_WORDS_PER_FRAME.

Here is the call graph for this function:

◆ assemblerAsmToBin()

void XilinxUltraScale::assemblerAsmToBin ( std::ifstream &  ,
std::ofstream &   
)

Definition at line 98 of file XUS_Assembler.cpp.

98  {
100 
103 
104  assemblerAsmTo(fin, fout);
105 }
void assemblerParseHeader(std::ifstream &)
void initializeResourceStringParameters() override
void setDeviceByPartNameOrThrow() override
Definition: XUS_Devices.cpp:44
void assemblerAsmTo(std::ifstream &, std::ofstream &)

◆ assemblerAsmToBit()

void XilinxUltraScale::assemblerAsmToBit ( std::ifstream &  ,
std::ofstream &   
)

Definition at line 89 of file XUS_Assembler.cpp.

89  {
91 
95 
96  assemblerAsmTo(fin, fout);
97 }
void outputBITheader(std::ofstream &fout, Endianness e)
Definition: inlineOutput.h:34

References outputBITheader().

Here is the call graph for this function:

◆ assemblerParseHeader()

void XilinxUltraScale::assemblerParseHeader ( std::ifstream &  )

Definition at line 107 of file XUS_Assembler.cpp.

108 {
109  for (string line; getline(fin, line); ) {
110  auto firstEqPos = line.find_first_of('=');
111  if(firstEqPos != string::npos)
112  line.replace(firstEqPos, 1, '=',' ');
113 
118  if(str::iff::stringContains(line, "HEADER END"))break;
119  }
120  log("Design name: " + designName);
121  log("FPGA: " + partName);
122  log("Date: " + fileDate);
123  log("Time: " + fileTime);
124 }
void log(std::string message)
Definition: CommonDevice.h:51
std::string lastStringWord(std::string s)
Parses a string s, removes all integers and returns the last of all string words.
Definition: parse.h:81

References str::parse::lastStringWord(), and str::iff::stringContains().

Here is the call graph for this function:

◆ blank()

void XilinxUltraScale::blank ( std::string  )

Definition at line 22 of file XUS_Blank.cpp.

22  {
24  parseParams(params);
25  blankBuffers();
26 }
void ensureInitializedBitstreamArrays() override
void blankBuffers()
Definition: inlineBlank.h:23
void parseParams(std::string params)

References blankBuffers(), and parseParams().

Here is the call graph for this function:

◆ change()

void XilinxUltraScale::change ( std::string  )

◆ deviceHelp()

void XilinxUltraScale::deviceHelp ( )

Definition at line 207 of file XUS_Devices.cpp.

208 {
209  if(initializedResourceStringShortPartName == "") {//if no device is initialized
210  cout << "A list of currently supported Xilinx UltraScale devices: " << endl;
211  #ifdef XUSKINTEX
212  cout << " UltraScale Kintex: " << endl;
213  cout << " XCKU025, XCKU035, XCKU040, XQKU040, XCKU060, XQKU060, XQRKU060, XCKU085, XCKU095, XQKU095, XCKU115, XQKU0115" << endl;
214  #endif
215  #ifdef XUSVIRTEX
216  cout << " UltraScale Virtex: " << endl;
217  cout << " XCVU065, XCVU080, XCVU095, XCVU125, XCVU160, XCVU190, XCVU440" << endl;
218  #endif
219  } else {
221  }
222 }
void printResourceStringInfo()

References printResourceStringInfo().

Here is the call graph for this function:

◆ disassemblerBinToAsm()

void XilinxUltraScale::disassemblerBinToAsm ( std::string  ,
std::ifstream &  ,
std::ofstream &   
)

Definition at line 72 of file XUS_Assembler.cpp.

72  {
74  uint32_t idcode = parseBitstreamIDCODE(fin, loadedBitstreamEndianness);
76  designName = filenameIn;
78 
79  disassemblerToAsm(fin, fout);
80 }
void disassemblerToAsm(std::ifstream &, std::ofstream &)
void setDeviceByIDCODEOrThrow(int) override
Definition: XUS_Devices.cpp:53
Endianness parseBitstreamEndianness(std::ifstream &fin)
Definition: inlineInput.h:83
uint32_t parseBitstreamIDCODE(std::ifstream &fin, Endianness e)
Definition: inlineInput.h:181
void updateDateAndTime()
Definition: inlineOutput.h:17

References parseBitstreamEndianness(), parseBitstreamIDCODE(), and updateDateAndTime().

Here is the call graph for this function:

◆ disassemblerBitToAsm()

void XilinxUltraScale::disassemblerBitToAsm ( std::ifstream &  ,
std::ofstream &   
)

Definition at line 82 of file XUS_Assembler.cpp.

82  {
86 
87  disassemblerToAsm(fin, fout);
88 }
void parseBITheader(std::ifstream &fin, Endianness e)
Definition: inlineInput.h:24

References parseBITheader(), and parseBitstreamEndianness().

Here is the call graph for this function:

◆ disassemblerToAsm()

void XilinxUltraScale::disassemblerToAsm ( std::ifstream &  ,
std::ofstream &   
)

Definition at line 252 of file XUS_Assembler.cpp.

252  {
255 
257  bool synched = false;
258  bool aligned = false;
259  int wordCount = 0;
260  int shadowFrameValid = 0;
261  int slr = 0, b = 7, r = 0, c = 0, m = 0;
262  //Parse bitstream
263  for( ; ; ){
264  if(!fin.good()){
265  break; // done with the bitstream
266  } else {
267  if(!synched){
268  streamoff startFileOffset = fin.tellg();
269  streamoff endFileOffset;
270  if(!aligned){
272  endFileOffset = fin.tellg() - (streamoff)4;
273  synched = true;
274  aligned = true;
275  } else {//end of bitstream
276  endFileOffset = fin.tellg();
277  }
278  } else { //already aligned
280  endFileOffset = fin.tellg() - (streamoff)4;
281  synched = true;
282  } else {//end of bitstream
283  endFileOffset = fin.tellg();
284  }
285  }
286  fin.seekg(startFileOffset, fin.beg);
287  assemblyOutputData(fin, fout, (endFileOffset - startFileOffset));
288  if(synched){
289  FileIO::read32(fin);//discard sync command
290  fout << "SYNC" << endl;
291  } else {
292  break; //if still not synched, then we reached end of file
293  }
294  } else {
295  uint32_t instruction = FileIO::read32(fin, loadedBitstreamEndianness);
296  int instructionType = XCAP_getInstructionType(instruction);
297  XCAP::Operation instructionOPCODE = XCAP_getInstructionOperation(instruction);
298  int instructionPayload = XCAP_getInstructionPayload(instruction);
299  if(instructionType == 1) {
300  wordCount = XCAP_getInstructionWordCount(instruction);
301  regAddr = XCAP_getInstructionRegister(instruction);
302  } else if(instructionType == 2) {
303  wordCount = instructionPayload;
304  } else {
305  fout << "0x" << uppercase << hex << setw(8) << setfill('0') << instruction << " (Invalid instruction [invalid type])" << endl;
306  continue;
307  }
308 
309  if(instructionOPCODE == XCAP::Operation::NOP) {
310  if(instructionPayload != 0)
311  fout << "NOP #" << instructionPayload << endl;
312  else
313  fout << "NOP" << endl;
314  } else if(instructionOPCODE == XCAP::Operation::RESERVED) {
315  if(instructionPayload != 0)
316  fout << "RESERVED #" << instructionPayload << endl;
317  else
318  fout << "RESERVED" << endl;
319  } else if(instructionOPCODE == XCAP::Operation::READ) {
320  fout << "Read Reg @";
321  writeXCAPregisterName(fout, regAddr);
322  fout << " for length #" << wordCount << endl;
323  } else { // XCAP::Operation::WRITE
324  if((regAddr == XCAP::Register::FDRI) && (wordCount > 0) && (wordCount % XUS_WORDS_PER_FRAME == 0)) {
325  if(shadowFrameValid) {
326  fout << dec << "# Shadow register contents are written to frame (BlockType=" << b << ", GlobalRowAddress=" << r << ", MajorAddress=" << c << ", MinorAddress=" << m << ") (Frame type: " << getFrameType(b, r, c) << ")." << endl;
327  XCAP_IncrementFAR(slr, b, r, c, m);
328  }
329  shadowFrameValid = 1;
330  int frameCount = (wordCount/XUS_WORDS_PER_FRAME);
331  fout << dec << "@FDRI for #" << frameCount << " frames:" << endl;
332  for(int i = 0 ; i < frameCount ; i++){
333  fout << "# ";
334  if(i == (frameCount-1)) fout << "(This frame data is written to shadow register!)";
335  fout << dec << "Writing frame #" << i << " (BlockType=" << b << ", GlobalRowAddress=" << r << ", MajorAddress=" << c << ", MinorAddress=" << m << ") (Frame type: " << getFrameType(b, r, c) << ") hex data:" << endl;
336  uint32_t frameData[XUS_WORDS_PER_FRAME];
337  for(int w = 0 ; w < XUS_WORDS_PER_FRAME ; w++){
338  frameData[w] = FileIO::read32(fin, loadedBitstreamEndianness);
339  }
340  fout << "CLOCK: ";
341  for(int w = XUS_WORDS_BEFORE_CLK ; w < (XUS_WORDS_BEFORE_CLK + XUS_WORDS_AT_CLK) ; w++){
342  fout << "0x" << uppercase << hex << setw(8) << setfill('0') << frameData[w] << " ";
343  }
344  fout << " ;DATA: ";
345  for(int w = 0 ; w < XUS_WORDS_BEFORE_CLK ; w++){
346  fout << "0x" << uppercase << hex << setw(8) << setfill('0') << frameData[w] << " ";
347  }
348  for(int w = (XUS_WORDS_BEFORE_CLK + XUS_WORDS_AT_CLK) ; w < XUS_WORDS_PER_FRAME ; w++){
349  fout << "0x" << uppercase << hex << setw(8) << setfill('0') << frameData[w] << " ";
350  }
351  fout << endl;
352  XCAP_IncrementFAR(slr, b, r, c, m);
353  }
354  } else if(regAddr == XCAP::Register::CMD && wordCount == 1){
355  uint32_t writeData = FileIO::read32(fin, loadedBitstreamEndianness);
356  writeXCAPcommandName(fout, static_cast<XCAP::Command>(writeData));
357  fout << ";";
358  if(XCAP::Command::DESYNC == static_cast<XCAP::Command>(writeData)){
359  shadowFrameValid = 0;
360  synched = false;
361  }
362  if(XCAP::Command::WCFG == static_cast<XCAP::Command>(writeData)){
363  shadowFrameValid = 0;
364  fout << " (also clears shadow register)";
365  }
366  fout << endl;
367  } else if(regAddr == XCAP::Register::MAGIC1){
368  uint32_t nextInstr = FileIO::read32(fin, loadedBitstreamEndianness);
369  int nextInstrType = XCAP_getInstructionType(nextInstr);
370  XCAP::Operation nextInstrOP = XCAP_getInstructionOperation(nextInstr);
371  int nextInstrPayload = XCAP_getInstructionPayload(nextInstr);
372  if(2 == nextInstrType && XCAP::Operation::WRITE == nextInstrOP && 0 < nextInstrPayload){
373  slr++;
374  synched = false;
375  aligned = false;
376  fout << "Select next SLR for the next #" << dec << nextInstrPayload << " words." << endl;
377  } else {
378  fout << "Bad MAGIC1 instruction" << endl;
379  fin.seekg(-4, ios::cur);//rewind next instruction if not
380  }
381  } else if((instructionType == 1) && (wordCount == 0)){
382  fout << "Select register @";
383  writeXCAPregisterName(fout, regAddr);
384  fout << endl;
385  } else if(wordCount == 1){
386  uint32_t writeData = FileIO::read32(fin, loadedBitstreamEndianness);
387  fout << "@";
388  writeXCAPregisterName(fout, regAddr);
389  if(regAddr == XCAP::Register::FAR) {
390  XCAP_parseFAR(writeData, slr, b, r, c, m);
391  fout << " = BlockType=" << dec << b << " RowAddress=" << (r-SLRinfo[slr].fromRow) << " MajorAddress=" << c << " MinorAddress=" << m << endl;
392  } else {
393  fout << " = 0x" << uppercase << hex << setw(8) << setfill('0') << writeData << endl;
394  }
395  } else {
396  fout << "0x" << uppercase << hex << setw(8) << setfill('0') << instruction << "(Bad instruction)" << endl;
397  }
398  } // OP_WRITE
399  }// if synched
400  } // if fin is still good
401  } // for(;;)
402 }
std::string getFrameType(int, int, int) override
void disassemblerWriteHeader(std::ofstream &)
void assemblyOutputData(std::ifstream &fin, std::ofstream &fout, std::streamoff sizeInBytes)
XCAP::Register XCAP_getInstructionRegister(uint32_t instruction)
Parses and returns instruction register. This is the register being addressed if the instruction is o...
Definition: inlineCAP.h:271
XCAP::Operation XCAP_getInstructionOperation(uint32_t instruction)
Parses and returns instruction operation. Most Xil instructions will NOP or write.
Definition: inlineCAP.h:259
uint32_t XCAP_getInstructionPayload(uint32_t instruction)
Parses and returns instruction payload. This is the immediate value after instruction type and operat...
Definition: inlineCAP.h:265
uint32_t XCAP_getInstructionWordCount(uint32_t instruction)
Parses and returns instruction word count. This is the number of words to be read/written if the inst...
Definition: inlineCAP.h:277
uint32_t XCAP_getInstructionType(uint32_t instruction)
Parses and returns instruction type. Valid Xil instructions will be of types 1 and 2.
Definition: inlineCAP.h:253
void writeXCAPcommandName(std::ofstream &fout, XCAP::Command commandID)
Definition: inlineCAP.h:111
void writeXCAPregisterName(std::ofstream &fout, XCAP::Register registerID)
Definition: inlineCAP.h:177
void XCAP_parseFAR(int farValue, int slr, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
Definition: inlineFAR.h:153
void XCAP_IncrementFAR(int slrID, int &blockType, int &globalRowAddress, int &columnAddress, int &minorAddress)
Definition: inlineFAR.h:144
bool findBitstreamSyncSequence(std::ifstream &fin, Endianness e)
Definition: inlineInput.h:154
bool findBitstreamSyncWord(std::ifstream &fin, Endianness e)
Definition: inlineInput.h:131
uint32_t read32(std::ifstream &fin, Endianness e=Endianness::NATIVE)
Definition: FileIO.h:131
Operation
Definition: XCAP.h:69

References assemblyOutputData(), XCAP::CMD, XCAP::DESYNC, XCAP::FAR, XCAP::FDRI, findBitstreamSyncSequence(), findBitstreamSyncWord(), XCAP::MAGIC1, XCAP::NOP, XCAP::READ, FileIO::read32(), XCAP::RESERVED, XCAP::UNDEFINED, XCAP::WCFG, XCAP::WRITE, writeXCAPcommandName(), writeXCAPregisterName(), XCAP_getInstructionOperation(), XCAP_getInstructionPayload(), XCAP_getInstructionRegister(), XCAP_getInstructionType(), XCAP_getInstructionWordCount(), XCAP_IncrementFAR(), XCAP_parseFAR(), XUS_WORDS_AT_CLK, XUS_WORDS_BEFORE_CLK, and XUS_WORDS_PER_FRAME.

Here is the call graph for this function:

◆ disassemblerWriteHeader()

void XilinxUltraScale::disassemblerWriteHeader ( std::ofstream &  )

Definition at line 242 of file XUS_Assembler.cpp.

243 {
244  fout << "--- HEADER BEGIN ---" << endl;
245  fout << "Name = \"" << designName << "\"" << endl;
246  fout << "FPGA = \"" << partName << "\"" << endl;
247  fout << "Date = \"" << fileDate << "\"" << endl;
248  fout << "Time = \"" << fileTime << "\"" << endl;
249  fout << "--- HEADER END ---" << endl;
250 }

◆ ensureInitializedBitstreamArrays()

void XilinxUltraScale::ensureInitializedBitstreamArrays ( )
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 77 of file XilinxUltraScale.cpp.

77  {
79  throw runtime_error("The target device needs to be known, before you can manipulate any bitstream!");
82  if(bitstreamBegin != nullptr)
83  delete bitstreamBegin;
85  //Allocate
86  int clbPlaneSize = numberOfRows * numberOfWordsPerRow[0];
88 
89  bitstreamBegin = new uint32_t[clbPlaneSize + bramPlaneSize];
90  //Calc pointers
91  int offset = 0;
92 
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];
98  }
99  }
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];
104  }
107  }
108  }
109  bitstreamEnd = &bitstreamBegin[offset];
110  bitstreamHasValidData = false;
111 
112  log("Reserved " + to_string(clbPlaneSize + bramPlaneSize) + " words for the bitstream buffers of device \"" + partName + "\"");
113  }
114 }
#define XUS_FRAMES_PER_BRAM_CONTENT_COLUMN
Definition: XUS_Fabric.h:41
#define XUS_EXTRA_FRAMES_PER_ROW
Definition: XUS_Fabric.h:45

References Endian::to_string(), XUS_EXTRA_FRAMES_PER_ROW, XUS_FRAMES_PER_BRAM_CONTENT_COLUMN, and XUS_WORDS_PER_FRAME.

Here is the call graph for this function:

◆ getDeviceByIDCODE()

int XilinxUltraScale::getDeviceByIDCODE ( int  IDCODE)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 58 of file XUS_Devices.cpp.

59 {
60  //US Kintex
61  #ifdef XUSKINTEX
62  if(IDCODE == XCKU025_IDCODE)
63  return XUS_DEVICE_XCKU025;
64  if(IDCODE == XCKU035_IDCODE)
65  return XUS_DEVICE_XCKU035;
66  if(IDCODE == XCKU040_IDCODE)
67  return XUS_DEVICE_XCKU040;
68  if(IDCODE == XCKU060_IDCODE)
69  return XUS_DEVICE_XCKU060;
70  if(IDCODE == XCKU085_IDCODE)
71  return XUS_DEVICE_XCKU085;
72  if(IDCODE == XCKU095_IDCODE)
73  return XUS_DEVICE_XCKU095;
74  if(IDCODE == XCKU115_IDCODE)
75  return XUS_DEVICE_XCKU115;
76  #endif
77  //US Virtex
78  #ifdef XUSVIRTEX
79  if(IDCODE == XCVU065_IDCODE)
80  return XUS_DEVICE_XCVU065;
81  if(IDCODE == XCVU080_IDCODE)
82  return XUS_DEVICE_XCVU080;
83  if(IDCODE == XCVU095_IDCODE)
84  return XUS_DEVICE_XCVU095;
85  if(IDCODE == XCVU125_IDCODE)
86  return XUS_DEVICE_XCVU125;
87  if(IDCODE == XCVU160_IDCODE)
88  return XUS_DEVICE_XCVU160;
89  if(IDCODE == XCVU190_IDCODE)
90  return XUS_DEVICE_XCVU190;
91  if(IDCODE == XCVU440_IDCODE)
92  return XUS_DEVICE_XCVU440;
93  #endif
94 
95  return XUS_DEVICE_NULL;
96 }
#define XCVU080_IDCODE
Definition: XUS_Devices.h:236
#define XCVU160_IDCODE
Definition: XUS_Devices.h:298
#define XCKU035_IDCODE
Definition: XUS_Devices.h:106
#define XCVU440_IDCODE
Definition: XUS_Devices.h:365
#define XCKU115_IDCODE
Definition: XUS_Devices.h:194
#define XCKU040_IDCODE
Definition: XUS_Devices.h:120
#define XCVU065_IDCODE
Definition: XUS_Devices.h:221
#define XCVU095_IDCODE
Definition: XUS_Devices.h:253
#define XCKU060_IDCODE
Definition: XUS_Devices.h:134
#define XCKU095_IDCODE
Definition: XUS_Devices.h:176
#define XCKU025_IDCODE
Definition: XUS_Devices.h:91
#define XCKU085_IDCODE
Definition: XUS_Devices.h:150
@ XUS_DEVICE_NULL
Definition: XUS_Devices.h:24
@ XUS_DEVICE_XCVU080
Definition: XUS_Devices.h:35
@ XUS_DEVICE_XCVU190
Definition: XUS_Devices.h:39
@ XUS_DEVICE_XCVU065
Definition: XUS_Devices.h:34
@ XUS_DEVICE_XCKU035
Definition: XUS_Devices.h:27
@ XUS_DEVICE_XCKU040
Definition: XUS_Devices.h:28
@ XUS_DEVICE_XCKU060
Definition: XUS_Devices.h:29
@ XUS_DEVICE_XCVU440
Definition: XUS_Devices.h:40
@ XUS_DEVICE_XCKU115
Definition: XUS_Devices.h:32
@ XUS_DEVICE_XCVU125
Definition: XUS_Devices.h:37
@ XUS_DEVICE_XCVU095
Definition: XUS_Devices.h:36
@ XUS_DEVICE_XCKU085
Definition: XUS_Devices.h:30
@ XUS_DEVICE_XCVU160
Definition: XUS_Devices.h:38
@ XUS_DEVICE_XCKU095
Definition: XUS_Devices.h:31
@ XUS_DEVICE_XCKU025
Definition: XUS_Devices.h:26
#define XCVU125_IDCODE
Definition: XUS_Devices.h:271
#define XCVU190_IDCODE
Definition: XUS_Devices.h:332

References XCKU025_IDCODE, XCKU035_IDCODE, XCKU040_IDCODE, XCKU060_IDCODE, XCKU085_IDCODE, XCKU095_IDCODE, XCKU115_IDCODE, XCVU065_IDCODE, XCVU080_IDCODE, XCVU095_IDCODE, XCVU125_IDCODE, XCVU160_IDCODE, XCVU190_IDCODE, XCVU440_IDCODE, XUS_DEVICE_NULL, XUS_DEVICE_XCKU025, XUS_DEVICE_XCKU035, XUS_DEVICE_XCKU040, XUS_DEVICE_XCKU060, XUS_DEVICE_XCKU085, XUS_DEVICE_XCKU095, XUS_DEVICE_XCKU115, XUS_DEVICE_XCVU065, XUS_DEVICE_XCVU080, XUS_DEVICE_XCVU095, XUS_DEVICE_XCVU125, XUS_DEVICE_XCVU160, XUS_DEVICE_XCVU190, and XUS_DEVICE_XCVU440.

◆ getDeviceByIDCODEorThrow()

int XilinxUltraScale::getDeviceByIDCODEorThrow ( int  IDCODE)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 28 of file XUS_Devices.cpp.

29 {
30  int deviceID = getDeviceByIDCODE(IDCODE);
31  if(deviceID == XUS_DEVICE_NULL)
32  throw runtime_error(string("Unknown device with IDCODE = ").append(to_string(IDCODE)).append(" . Maybe the device is not Xilinx UltraScale device?"));
33  return deviceID;
34 }
int getDeviceByIDCODE(int) override
Definition: XUS_Devices.cpp:58

References Endian::to_string(), and XUS_DEVICE_NULL.

Here is the call graph for this function:

◆ getDeviceByName()

int XilinxUltraScale::getDeviceByName ( std::string  )
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 97 of file XUS_Devices.cpp.

98 {
99  name = str::removeSpaces(name);
100  name = str::stringToLower(name);
101 
102  //US Kintex
103  #ifdef XUSKINTEX
105  return XUS_DEVICE_XCKU025;
107  return XUS_DEVICE_XCKU035;
108  if(str::iff::stringContains(name, XCKU040_NAME, "xqku040"))
109  return XUS_DEVICE_XCKU040;
110  if(str::iff::stringContains(name, XCKU060_NAME, "xqku060", "xqrku060"))
111  return XUS_DEVICE_XCKU060;
113  return XUS_DEVICE_XCKU085;
114  if(str::iff::stringContains(name, XCKU095_NAME, "xqku095"))
115  return XUS_DEVICE_XCKU095;
116  if(str::iff::stringContains(name, XCKU115_NAME, "xqku115"))
117  return XUS_DEVICE_XCKU115;
118  #endif
119  //US Virtex
120  #ifdef XUSVIRTEX
122  return XUS_DEVICE_XCVU065;
124  return XUS_DEVICE_XCVU080;
126  return XUS_DEVICE_XCVU095;
128  return XUS_DEVICE_XCVU125;
130  return XUS_DEVICE_XCVU160;
132  return XUS_DEVICE_XCVU190;
134  return XUS_DEVICE_XCVU440;
135  #endif
136 
137  return XUS_DEVICE_NULL;
138 }
#define XCKU085_NAME
Definition: XUS_Devices.h:147
#define XCKU035_NAME
Definition: XUS_Devices.h:103
#define XCVU095_NAME
Definition: XUS_Devices.h:250
#define XCKU095_NAME
Definition: XUS_Devices.h:173
#define XCVU125_NAME
Definition: XUS_Devices.h:268
#define XCVU440_NAME
Definition: XUS_Devices.h:362
#define XCKU060_NAME
Definition: XUS_Devices.h:131
#define XCVU190_NAME
Definition: XUS_Devices.h:329
#define XCKU025_NAME
Definition: XUS_Devices.h:88
#define XCVU080_NAME
Definition: XUS_Devices.h:233
#define XCKU040_NAME
Definition: XUS_Devices.h:117
#define XCVU065_NAME
Definition: XUS_Devices.h:218
#define XCVU160_NAME
Definition: XUS_Devices.h:295
#define XCKU115_NAME
Definition: XUS_Devices.h:191
std::string stringToLower(std::string str)
Replaces all uppercase characters in str with lowercase and returns the resulting string.
Definition: str.h:59
std::string removeSpaces(std::string str)
Removes all space chars of str returns the resulting string.
Definition: str.h:47

References str::removeSpaces(), str::iff::stringContains(), str::stringToLower(), XCKU025_NAME, XCKU035_NAME, XCKU040_NAME, XCKU060_NAME, XCKU085_NAME, XCKU095_NAME, XCKU115_NAME, XCVU065_NAME, XCVU080_NAME, XCVU095_NAME, XCVU125_NAME, XCVU160_NAME, XCVU190_NAME, XCVU440_NAME, XUS_DEVICE_NULL, XUS_DEVICE_XCKU025, XUS_DEVICE_XCKU035, XUS_DEVICE_XCKU040, XUS_DEVICE_XCKU060, XUS_DEVICE_XCKU085, XUS_DEVICE_XCKU095, XUS_DEVICE_XCKU115, XUS_DEVICE_XCVU065, XUS_DEVICE_XCVU080, XUS_DEVICE_XCVU095, XUS_DEVICE_XCVU125, XUS_DEVICE_XCVU160, XUS_DEVICE_XCVU190, and XUS_DEVICE_XCVU440.

Here is the call graph for this function:

◆ getDeviceByNameOrThrow()

int XilinxUltraScale::getDeviceByNameOrThrow ( std::string  )
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 36 of file XUS_Devices.cpp.

37 {
38  int deviceID = getDeviceByName(name);
39  if(deviceID == XUS_DEVICE_NULL)
40  throw runtime_error(string("Unknown device: ").append(name).append(". Maybe the device is not Xilinx UltraScale device?"));
41  return deviceID;
42 }
int getDeviceByName(std::string) override
Definition: XUS_Devices.cpp:97

References XUS_DEVICE_NULL.

◆ getFrameType()

string XilinxUltraScale::getFrameType ( int  blockType,
int  rowAddress,
int  columnAddress 
)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 116 of file XilinxUltraScale.cpp.

116  {
117  if(XUS_BLOCKTYPE_BLOCKRAM == blockType)
118  return "BlockRAM Contents";
119  else if(XUS_BLOCKTYPE_LOGIC == blockType)
120  return LUT_typeOfFrameForResourceLetter[(uint8_t)resourceString[rowAddress][columnAddress]];
121  else
122  return "Unknown";
123 }
#define XUS_BLOCKTYPE_BLOCKRAM
Definition: XUS_Fabric.h:35
#define XUS_BLOCKTYPE_LOGIC
Definition: XUS_Fabric.h:34

References XUS_BLOCKTYPE_BLOCKRAM, and XUS_BLOCKTYPE_LOGIC.

◆ initFabric()

void XilinxUltraScale::initFabric ( )

Definition at line 22 of file XUS_Fabric.cpp.

22  {
23  setFabricChar(char(0), 0, "EndedLine", true);
24  setFabricChar(char(1), XUS_EXTRA_FRAMES_PER_ROW, "EndOfLine", true);
25  //The Xilinx US fabric in byteman is encoded in the following letters:
26 
27  //A-D are brams
28  setFabricChar('A', 4, "BRAM/RCLK_RCLK_BRAM_L_BRAMCLMP_FT"); //"BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL/RCLK_RCLK_BR
29  setFabricChar('B', 4, "BRAM/RCLK_RCLK_BRAM_L_AUXCLMP_FT"); //"BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL/RCLK_RCLK_BR
30  setFabricChar('C', 4, "BRAM/RCLK_BRAM_L"); //"BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL/RCLK_BRAM_L"
31  setFabricChar('D', 4, "BRAM/RCLK_BRAM_R"); //"BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL + BRAM + NULL + NULL + NULL + NULL/RCLK_BRAM_R"
32 
33  //E-F, R are DSPs
34  setFabricChar('E', 4, "DSP/RCLK_DSP_L"); //"DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL/RCLK_DSP_L"
35  setFabricChar('F', 6, "DSP/RCLK_DSP_CLKBUF_L"); //"DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL + DSP + NULL + NULL + NULL + NULL/RCLK_DSP_CLKBUF_L"
36 
37  //G-H are interconnect cols with different clock resources
38  setFabricChar('G', 58, "INT/RCLK_INT_L"); //"INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT/RCLK_INT_L"
39  setFabricChar('H', 58, "INT/RCLK_INT_R"); //"INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT + INT/RCLK_INT_R"
40 
41  //I-J are CLEL_R tiles with different clock resources
42  setFabricChar('I', 12, "CLEL_R/RCLK_CLEL_R_L"); //"CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R/RCLK_CLEL_R_L"
43  setFabricChar('J', 12, "CLEL_R/RCLK_CLEL_R_R"); //"CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R + CLEL_R/RCLK_CLEL_R_R"
44 
45  //K-L are CLEL_L tiles with different clock resources
46  setFabricChar('K', 12, "CLEL_L/RCLK_CLEL_R"); //"CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L/RCLK_CLEL_R"
47  setFabricChar('L', 12, "CLEL_L/RCLK_CLEL_L"); //"CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L + CLEL_L/RCLK_CLEL_L"
48 
49  //M-N are CLE_M tiles with different clock resources
50  setFabricChar('M', 12, "CLE_M/RCLK_CLE_M_L"); //"CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M/RCLK_CLE_M_L"
51  setFabricChar('N', 12, "CLE_M/RCLK_CLEM_CLKBUF_L"); //"CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M + CLE_M/RCLK_CLEM_CLKBUF_L"
52 
53  //O = CLE_M_R
54  setFabricChar('O', 12, "CLE_M_R"); //"CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R + CLE_M_R/RCLK_CLE_M_R"
55 
56  //P-Q are laguna tiles with different clock resources
57  setFabricChar('P', 12, "LAGUNA_TILE/RCLK_RCLK_LAGUNA_L_FT"); //"LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE/RCLK_RCLK_LAGUNA_L_FT"
58  setFabricChar('Q', 12, "LAGUNA_TILE/RCLK_RCLK_LAGUNA_R_FT"); //"LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE + LAGUNA_TILE/RCLK_RCLK_LAGUNA_R_FT"
59 
60  //a-l are I/O and misc
61  setFabricChar('a', 10, "HPIO_L"); //"HPIO_L + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + HPIO_L + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/RCLK_HPIO_L"
62  setFabricChar('b', 16, "XIPHY_L"); //"XIPHY_L + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/NULL"
63  setFabricChar('c', 10, "HRIO_L"); //"HRIO_L + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + HRIO_L + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/RCLK_HRIO_L"
64  setFabricChar('d', 6, "INT_INTERFACE_PCIE_R"); //"INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R + INT_INTERFACE_PCIE_R/RCLK_INTF_PCIE_R_L"
65  setFabricChar('e', 2, "PCIE"); //"PCIE + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/NULL"
66  setFabricChar('f', 12, "GTH_R"); //"GTH_R + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/NULL"
67  setFabricChar('g', 2, "CFG_CFG"); //"CFG_CFG + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/NULL"
68  setFabricChar('h', 2, "CFGIO_IOB"); //"CFGIO_IOB + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + AMS + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/RCLK_AMS_CFGIO"
69  setFabricChar('i', 16, "GTH_QUAD_LEFT_FT"); //"GTH_QUAD_LEFT_FT + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/NULL"
70  setFabricChar('j', 12, "GTY_QUAD_LEFT_FT"); //"GTY_QUAD_LEFT_FT + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/NULL"
71  setFabricChar('k', 2, "ILMAC_ILMAC_FT"); //"ILMAC_ILMAC_FT + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/NULL"
72  setFabricChar('l', 2, "CMAC_CMAC_FT"); //"CMAC_CMAC_FT + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL + NULL/NULL"
73 
74  //Also in the fabric exist frames that are mapped in bitstreams, but do not physically exist on the device. We encode these as follows:
75  setFabricChar('0', 10, "EMPTY10", true);
76  setFabricChar('1', 2, "EMPTY2", true);
77  setFabricChar('2', 4, "EMPTY4/BRAM", true);
78  setFabricChar('3', 6, "EMPTY6", true);
79  setFabricChar('4', 12, "EMPTY12", true);
80  setFabricChar('5', 16, "EMPTY16", true);
81  setFabricChar('6', 58, "EMPTY58", true);
82  setFabricChar('7', 4, "EMPTY4", true);
83 }
void setFabricChar(char character, int frameNumber, std::string tileName, bool isUnused=false)

References setFabricChar(), and XUS_EXTRA_FRAMES_PER_ROW.

Here is the call graph for this function:

◆ initializeResourceStringParameters()

void XilinxUltraScale::initializeResourceStringParameters ( )
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 40 of file XilinxUltraScale.cpp.

40  {
42  throw runtime_error("The target device needs to be known, before you can manipulate any bitstream!");
45  for((numberOfCols[0] = 0, numberOfFramesBeforeCol[0][0] = 0, numberOfBRAMCols[0] = 0) ; (uint8_t)resourceString[0][numberOfCols[0]] ; numberOfCols[0]++){
48  if(str::iff::charIs(resourceString[0][numberOfCols[0]], 'A','B','C','D','2')) //A-D are BlockRAM columns, '2' is empty blockram column
49  numberOfBRAMCols[0]++;
50  }
51  for(int c = numberOfCols[0] + 1 ; c < XUS_MAX_COLS ; c++){
53  }
54  for(int c = numberOfCols[0] ; c < XUS_MAX_COLS ; c++){
56  }
59 
62  for(int r = 1 ; r < numberOfRows ; r++){
64  numberOfCols[r] = numberOfCols[0];
67  for(int c = 0 ; c < XUS_MAX_COLS ; c++){
69  }
70  for(int c = 0 ; c < XUS_MAX_COLS ; c++){
72  }
73  }
74  }
75 }
#define XUS_MAX_COLS
Definition: XUS_Fabric.h:27
bool charIs(char checkedChar)
Returns false. End of recursion for template.
Definition: iff.h:101

References str::iff::charIs(), XUS_MAX_COLS, and XUS_WORDS_PER_FRAME.

Here is the call graph for this function:

◆ merge()

void XilinxUltraScale::merge ( XilinxUltraScale ,
std::string  ,
Rect2D  ,
Coord2D   
)

Definition at line 24 of file XUS_Merge.cpp.

24  {
25  log("Merging bitstreams.");
26  //This function uses a pointer to the second XUSP instance, but this pointer should get optimized as it is statically provided in the main function
27  parseParams(params);
28 
30  log("Merging the whole FPGA");
31  src.position = {0, 0};
32  dst = {0, 0};
33  src.size.row = numberOfRows * XUS_CLB_PER_CLOCK_REGION;
34  src.size.col = maxNumberOfCols;
35  }
36 
37  ensureRegionCompatibility(src, dst);
38 
39  if(src.position.row%XUS_CLB_PER_CLOCK_REGION != 0)
40  throw runtime_error(string("Currently only full clock region height relocations are supported (use row numbers multiple of ").append(to_string(XUS_CLB_PER_CLOCK_REGION)).append(")."));
41  if(src.size.row%XUS_CLB_PER_CLOCK_REGION != 0)
42  throw runtime_error(string("Currently only full clock region height relocations are supported (use row numbers multiple of ").append(to_string(XUS_CLB_PER_CLOCK_REGION)).append(")."));
43  if(dst.row%XUS_CLB_PER_CLOCK_REGION != 0)
44  throw runtime_error(string("Currently only full clock region height relocations are supported (use row numbers multiple of ").append(to_string(XUS_CLB_PER_CLOCK_REGION)).append(")."));
45 
46  Endianness endianDifference = Endian::diff(loadedBitstreamEndianness, srcBitstream->loadedBitstreamEndianness);
47 
48  if((Endianness::NATIVE == endianDifference) && MergeOP::SET == selectedOptions.op)
49  fastMerge(srcBitstream, src, dst);
50  else
51  flexiMerge(srcBitstream, endianDifference, src, dst);
52  log("Merging bitstreams complete.");
53 }
Endianness
< Endianness in byteman is represented not only by big/little endian, but also by potential bit swapp...
Definition: Endianness.h:47
@ NATIVE
System native will always be the fastest endianess to process.
#define XUS_CLB_PER_CLOCK_REGION
Definition: XUS_Fabric.h:42
void ensureRegionCompatibility(Rect2D src, Coord2D dst)
Definition: inlineMerge.h:33
void fastMerge(XilinxConfigurationAccessPort *srcBitstream, Rect2D src, Coord2D dst)
Definition: inlineMerge.h:51
void flexiMerge(XilinxConfigurationAccessPort *srcBitstream, Endianness endianConversionNeeded, Rect2D src, Coord2D dst)
Definition: inlineMerge.h:86
Endianness diff(Endianness e1, Endianness e2)
Definition: Endianness.h:117

References Coord2D::col, Endian::diff(), ensureRegionCompatibility(), fastMerge(), flexiMerge(), XilinxConfigurationAccessPort< MAX_SLRS, MAX_ROWS, MAX_COLS, MAX_BRAM_COLS, BLOCKTYPE_MAX, BLOCKTYPE_LOGIC, BLOCKTYPE_BLOCKRAM, WORDS_BEFORE_CLK, WORDS_AT_CLK, WORDS_AFTER_CLK, WORDS_PER_FRAME, FRAMES_PER_BRAM_CONTENT_COLUMN, CLB_PER_CLOCK_REGION, BRAM_PER_CLOCK_REGION, EXTRA_FRAMES_PER_ROW, FAR_ENABLE_TOP_BOTTOM_BIT, FAR_TOP_BOTTOM_BIT_SHIFT, FAR_BLOCKTYPE_SHIFT, FAR_BLOCKTYPE_MASK, FAR_ROWADDRESS_SHIFT, FAR_ROWADDRESS_MASK, FAR_COLUMNADDRESS_SHIFT, FAR_COLUMNADDRESS_MASK, FAR_MINORADDRESS_SHIFT, FAR_MINORADDRESS_MASK >::loadedBitstreamEndianness, NATIVE, parseParams(), Rect2D::position, Coord2D::row, Rect2D::size, Endian::to_string(), and XUS_CLB_PER_CLOCK_REGION.

Here is the call graph for this function:

◆ outputBitstreamEmptySLRHeaderSequence()

void XilinxUltraScale::outputBitstreamEmptySLRHeaderSequence ( std::ofstream &  ,
int  ,
bool  ,
Endianness   
)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 121 of file XUS_Output.cpp.

122 {
123  XCAP_writeNOP(fout, 132, 0, e);
124  uint32_t cor0 = XCAP_getCOR0value(7, 0, 0, 0, 0, 0, 0, DONE_CYCLE::Phase4, MATCH_CYCLE::NoWait, LOCK_CYCLE::NoWait, GTS_CYCLE::Phase5, GWE_CYCLE::Phase6); // no clue where the '7' comes from (ask Vivado)
126  //Optional Shutdown + 1 NOP ?
128  XCAP_writeNOP(fout, 2, 0, e);
131 
132  if((slr + 1) < numberOfSLRs) { // If there are more SLRs, output the magic
134  slrMagicInstrLocation[slr] = fout.tellp();
135  XCAP_writeType2(fout, 0, e);
136  }
137 }
std::streamoff slrMagicInstrLocation[3]
uint32_t XCAP_getCOR0value(int Reserved_31_27, int ECLK_EN, int Reserved_25, int DRIVE_DONE, int Reserved_23, int OSCFSEL, int Reserved_16_15, DONE_CYCLE selDONE_CYCLE, MATCH_CYCLE selMATCH_CYCLE, LOCK_CYCLE selLOCK_CYCLE, GTS_CYCLE selGTS_CYCLE, GWE_CYCLE selGWE_CYCLE)
Generate COR0 register write value.
Definition: inlineCAP.h:493

References XCAP::COR0, XCAP::IDCODE, XCAP::MAGIC1, NoWait, XCAP::NULLCMD, Phase4, Phase5, Phase6, XCAP::RCRC, XCAP_getCOR0value(), XCAP_writeCommand(), XCAP_writeNOP(), XCAP_writeRegister(), XCAP_writeSelectRegister(), and XCAP_writeType2().

Here is the call graph for this function:

◆ outputBitstreamEmptySLRWrapUpSequence()

void XilinxUltraScale::outputBitstreamEmptySLRWrapUpSequence ( std::ofstream &  ,
int  ,
bool  ,
Endianness   
)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 139 of file XUS_Output.cpp.

140 {
141  streamoff currentStreamHead = fout.tellp();
142  streamoff bypassSize = (currentStreamHead - slrMagicInstrLocation[slr])/4 - 1;
143  fout.seekp(slrMagicInstrLocation[slr]);
144  FileIO::write32(fout, static_cast<uint32_t>(bypassSize), e);
145  fout.seekp(currentStreamHead);
151 }

References XCAP::DESYNC, XCAP::START, FileIO::write32(), XCAP_writeCommand(), and XCAP_writeNOP().

Here is the call graph for this function:

◆ outputBitstreamGlobalFooterSequence()

void XilinxUltraScale::outputBitstreamGlobalFooterSequence ( std::ofstream &  ,
bool  ,
Endianness   
)
overridevirtual

◆ outputBitstreamGlobalHeaderSequence()

void XilinxUltraScale::outputBitstreamGlobalHeaderSequence ( std::ofstream &  ,
bool  ,
Endianness   
)
overridevirtual

◆ outputBitstreamSLRFooterBitstreamSequence()

void XilinxUltraScale::outputBitstreamSLRFooterBitstreamSequence ( std::ofstream &  ,
int  ,
bool  ,
Endianness   
)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 62 of file XUS_Output.cpp.

63 {
64  if(fullBitstream) // Add GRESTORE since it is full device bitstream.
65  {
67  XCAP_writeNOP(fout, 2, 0, e);
69  XCAP_writeNOP(fout, 20, 0, e);
70  }
71 
72  XCAP_writeNOP(fout, 1, 0, e);
73  uint32_t ctrl0 = XCAP_getCTRL0value(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0);
74  XCAP_writeMaskAndRegister(fout, XCAP::Register::CTRL0, ctrl0, ctrl0, e);
75 
77  XCAP_writeNOP(fout, 20, 0, e);
78 
79 
81  XCAP_writeNOP(fout, 1, 0, e);
82 
84  XCAP_writeNOP(fout, 1, 0, e);
86  XCAP_writeNOP(fout, 2, 0, e);
88  XCAP_writeNOP(fout, 16, 0, e);
89 }
void XCAP_writeMaskAndRegister(std::ofstream &fout, XCAP::Register reg, int writeMask, int writeValue, Endianness e)
Generate the encoding for writing a CAP register with a mask and write it to file ofstream.
Definition: inlineCAP.h:396
uint32_t XCAP_getCTRL0value(int EFUSE_KEY, int ICAP_SELECT, int Reserved_29_13, int OverTempShutDown, int Reserved_11, int ConfigFallback, int Reserved_9, int GLUTMASK_B, int Reserved_7, int DEC, int SBITS, int PERSIST, int Reserved_2_1, int GTS_USR_B)
Generate CTRL0 register write value.
Definition: inlineCAP.h:513
uint32_t XCAP_getFarFarInstruction()
Generate and return the encoding for a Far FAR instruction.
Definition: inlineFAR.h:194

References XCAP::CTRL0, XCAP::DESYNC, XCAP::DGHIGH, XCAP::FAR, XCAP::GRESTORE, XCAP::MAGIC2, XCAP::RCRC, XCAP::START, XCAP_getCTRL0value(), XCAP_getFarFarInstruction(), XCAP_writeCommand(), XCAP_writeMaskAndRegister(), XCAP_writeNOP(), and XCAP_writeRegister().

Here is the call graph for this function:

◆ outputBitstreamSLRHeaderAfterBitstreamSequence()

void XilinxUltraScale::outputBitstreamSLRHeaderAfterBitstreamSequence ( std::ofstream &  ,
int  ,
bool  ,
Endianness   
)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 91 of file XUS_Output.cpp.

92 {
93  if((slr + 1) < numberOfSLRs) { // If there are more SLRs, output the magic
94  XCAP_writeNOP(fout, 400, 0, e);
95  XCAP_writeSYNQ(fout, e);
96  XCAP_writeNOP(fout, 1, 0, e);
97  //Optional Shutdown + 1 NOP ?
99  XCAP_writeNOP(fout, 2, 0, e);
100 
102  slrMagicInstrLocation[slr] = fout.tellp();
103  XCAP_writeType2(fout, 0, e);
104  }
105 }

References XCAP::MAGIC1, XCAP::RCRC, XCAP_writeCommand(), XCAP_writeNOP(), XCAP_writeSelectRegister(), XCAP_writeSYNQ(), and XCAP_writeType2().

Here is the call graph for this function:

◆ outputBitstreamSLRHeaderBitstreamSequence()

void XilinxUltraScale::outputBitstreamSLRHeaderBitstreamSequence ( std::ofstream &  ,
int  ,
bool  ,
Endianness   
)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 39 of file XUS_Output.cpp.

40 {
41  XCAP_writeNOP(fout, 132, 0, e);
43  XCAP_writeNOP(fout, 2, 0, e);
44  //XCAP_writeRegister(fout, XCAP::Register::MAGIC0, 0x00000000);
46  uint32_t cor0 = XCAP_getCOR0value(7, 0, 0, 0, 0, 0, 0, DONE_CYCLE::Phase4, MATCH_CYCLE::NoWait, LOCK_CYCLE::NoWait, GTS_CYCLE::Phase5, GWE_CYCLE::Phase6); // no clue where the '7' comes from (ask Vivado)
48  //XCAP_writeRegister(fout, XCAP::Register::COR1, 0x00400000);
49  //XCAP_writeCommand(fout, XCAP::Command::SWITCH, e);
50  //Optional Shutdown + 1 NOP ?
51  XCAP_writeNOP(fout, 1, 0, e);
53  XCAP_writeNOP(fout, 20, 0, e);
55  XCAP_writeNOP(fout, 100, 0, e);
57  uint32_t ctrl0 = XCAP_getCTRL0value(0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0); //disable fallback bitstream, enable overwriting of LUTs
58  XCAP_writeMaskAndRegister(fout, XCAP::Register::CTRL0, ctrl0, ctrl0, e);
59  //XCAP_writeMaskAndRegister(fout, XCAP::Register::CTRL1, 0x20000, 0, e);// TODO: why does vivado do that? : bit at 0x20000 is undocumented
60 }

References XCAP::AGHIGH, XCAP::COR0, XCAP::CTRL0, XCAP::IDCODE, NoWait, XCAP::NULLCMD, Phase4, Phase5, Phase6, XCAP::RCRC, XCAP_getCOR0value(), XCAP_getCTRL0value(), XCAP_writeCommand(), XCAP_writeMaskAndRegister(), XCAP_writeNOP(), and XCAP_writeRegister().

Here is the call graph for this function:

◆ outputBitstreamSLRWrapUpSequence()

void XilinxUltraScale::outputBitstreamSLRWrapUpSequence ( std::ofstream &  ,
int  ,
bool  ,
Endianness   
)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 107 of file XUS_Output.cpp.

108 {
109  streamoff currentStreamHead = fout.tellp();
110  streamoff bypassSize = (currentStreamHead - slrMagicInstrLocation[slr])/4 - 1;
111  fout.seekp(slrMagicInstrLocation[slr]);
112  FileIO::write32(fout, static_cast<uint32_t>(bypassSize), e);
113  fout.seekp(currentStreamHead);
119 }

References XCAP::DESYNC, XCAP::START, FileIO::write32(), XCAP_writeCommand(), and XCAP_writeNOP().

Here is the call graph for this function:

◆ readBitstream()

void XilinxUltraScale::readBitstream ( std::string  )

Definition at line 29 of file XUS_Input.cpp.

30 {
31  ifstream fin (filename, ifstream::binary);
32  if(!fin.good())
33  throw runtime_error(string("Could not open file: \"").append(filename).append("\" .\n"));
34  log("Reading Xilinx UltraScale bitstream from file \"" + filename + "\"");
35 
36  if(str::iff::stringEndsWith(filename, ".bit"))
37  readBitstreamBIT(fin);
38  else if(str::iff::stringEndsWith(filename, ".bin"))
39  readBitstreamBIN(fin);
40  else
41  throw runtime_error(string("Unknown Xilinx UltraScale file format tried to be read.\n"));
42  fin.close();
43  log("Xilinx UltraScale bitstream file \"" + filename + "\" read successfully.");
44 }
void readBitstreamBIN(std::ifstream &fin)
Definition: inlineInput.h:346
void readBitstreamBIT(std::ifstream &fin)
Definition: inlineInput.h:334

References readBitstreamBIN(), readBitstreamBIT(), and str::iff::stringEndsWith().

Here is the call graph for this function:

◆ setDevice()

void XilinxUltraScale::setDevice ( int  ,
std::string  = "" 
)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 142 of file XUS_Devices.cpp.

143 {
145  bool customNameSet = false;
146  #define setCustomPartName(x) {customNameSet = true; partName = x;}
147  switch(deviceID){
148  //US Kintex
149  #ifdef XUSKINTEX
150  case XUS_DEVICE_XCKU025:
151  XCKU025();
152  break;
153  case XUS_DEVICE_XCKU035:
154  XCKU035();
155  break;
156  case XUS_DEVICE_XCKU040:
157  XCKU040();
158  break;
159  case XUS_DEVICE_XCKU060:
160  XCKU060();
161  break;
162  case XUS_DEVICE_XCKU085:
163  XCKU085();
164  break;
165  case XUS_DEVICE_XCKU095:
166  XCKU095();
167  break;
168  case XUS_DEVICE_XCKU115:
169  XCKU115();
170  break;
171  #endif
172  //US Virtex
173  #ifdef XUSVIRTEX
174  case XUS_DEVICE_XCVU065:
175  XCVU065();
176  break;
177  case XUS_DEVICE_XCVU080:
178  XCVU080();
179  break;
180  case XUS_DEVICE_XCVU095:
181  XCVU095();
182  break;
183  case XUS_DEVICE_XCVU125:
184  XCVU125();
185  break;
186  case XUS_DEVICE_XCVU160:
187  XCVU160();
188  break;
189  case XUS_DEVICE_XCVU190:
190  XCVU190();
191  break;
192  case XUS_DEVICE_XCVU440:
193  XCVU440();
194  break;
195  #endif
196  default:throw runtime_error("Unknown device ID.");
197  }
198  #undef setCustomPartName
199  if(!customNameSet) // if we didn't set already a good full name
200  if(customPartName != "")// if not empty string
201  partName = customPartName;
202 
203 
204  log("Initialized device resource string for \"" + initializedResourceStringShortPartName + "\"");
205 }
#define XCVU440()
Definition: XUS_Devices.h:389
#define XCKU085()
Definition: XUS_Devices.h:166
#define XCKU095()
Definition: XUS_Devices.h:185
#define XCVU065()
Definition: XUS_Devices.h:227
#define XCVU160()
Definition: XUS_Devices.h:322
#define XCKU025()
Definition: XUS_Devices.h:97
#define XCKU040()
Definition: XUS_Devices.h:126
#define XCKU060()
Definition: XUS_Devices.h:140
#define XCKU115()
Definition: XUS_Devices.h:210
#define XCVU080()
Definition: XUS_Devices.h:245
#define XCVU095()
Definition: XUS_Devices.h:262
#define XCVU190()
Definition: XUS_Devices.h:356
#define XCVU125()
Definition: XUS_Devices.h:287
#define XCKU035()
Definition: XUS_Devices.h:112
void clearResourceStringArrays()
Definition: inlineBlank.h:17

References clearResourceStringArrays(), XCKU025, XCKU035, XCKU040, XCKU060, XCKU085, XCKU095, XCKU115, XCVU065, XCVU080, XCVU095, XCVU125, XCVU160, XCVU190, XCVU440, XUS_DEVICE_XCKU025, XUS_DEVICE_XCKU035, XUS_DEVICE_XCKU040, XUS_DEVICE_XCKU060, XUS_DEVICE_XCKU085, XUS_DEVICE_XCKU095, XUS_DEVICE_XCKU115, XUS_DEVICE_XCVU065, XUS_DEVICE_XCVU080, XUS_DEVICE_XCVU095, XUS_DEVICE_XCVU125, XUS_DEVICE_XCVU160, XUS_DEVICE_XCVU190, and XUS_DEVICE_XCVU440.

Here is the call graph for this function:

◆ setDeviceByIDCODEOrThrow()

void XilinxUltraScale::setDeviceByIDCODEOrThrow ( int  idcode)
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 53 of file XUS_Devices.cpp.

53  {
54  int deviceID = getDeviceByIDCODEorThrow(idcode);
55  setDevice(deviceID);
56 }
int getDeviceByIDCODEorThrow(int) override
Definition: XUS_Devices.cpp:28
void setDevice(int, std::string="") override

◆ setDeviceByNameOrThrow()

void XilinxUltraScale::setDeviceByNameOrThrow ( std::string  )
overridevirtual

Implements XilinxConfigurationAccessPort< 3, 15, 1024, 32, 2, 0, 1, 60, 3, 60,(60+3+60), 128, 60, 12, 2, 0, 0, 23, 0x7, 17, 0x3F, 7, 0x3FF, 0, 0x7F >.

Definition at line 48 of file XUS_Devices.cpp.

48  {
49  int deviceID = getDeviceByNameOrThrow(name);
50  setDevice(deviceID, name);
51 }
int getDeviceByNameOrThrow(std::string) override
Definition: XUS_Devices.cpp:36

◆ setDeviceByPartNameOrThrow()

void XilinxUltraScale::setDeviceByPartNameOrThrow ( )
overridevirtual

◆ test()

void XilinxUltraScale::test ( bool  usableFramesOnly,
bool  testValueEqual,
uint32_t  testValue 
)

Definition at line 23 of file XUS_Test.cpp.

23  {
24  log("Testing bitstream against value" + to_string(testValue) + ".");
26  ensureFramesAre(usableFramesOnly, testValueEqual, testValue);
27  log("Testing finished successfully.");
28 }
void ensureFramesAre(bool usableFramesOnly, bool testValueEqual, uint32_t testValue)
Definition: inlineTest.h:18

References ensureFramesAre(), and Endian::to_string().

Here is the call graph for this function:

◆ writeBitstream()

void XilinxUltraScale::writeBitstream ( std::string  ,
std::string  ,
Rect2D   
)

Creates a new bitstream file and writes the selected regions in it.

  • filename Name of the output file.
    Exceptions
    runtime_errorif args don't define a correct region.

Definition at line 160 of file XUS_Output.cpp.

161 {
162  size_t dotpos = filename.rfind(".");
163  if(dotpos == string::npos)
164  throw runtime_error(string("Invalid file name: \"").append(filename).append("\"!\n"));
165  designName = filename.substr(0, dotpos);
166 
167  log("Writing Xilinx UltraScale bitstream to file \"" + filename + "\":");
168 
169  parseParams(params);
170 
172  if((cmdRect.position.row % XUS_CLB_PER_CLOCK_REGION != 0) || (cmdRect.size.row % XUS_CLB_PER_CLOCK_REGION != 0))
173  throw runtime_error(string("Currently only full clock region height relocations are supported (use row numbers multiple of ").append(to_string(XUS_CLB_PER_CLOCK_REGION)).append("."));
174  if(cmdRect.size.row <= 0 || cmdRect.size.col <= 0)
175  throw runtime_error("Invalid output size dimentions.");
176  }
177 
178  ofstream fout (filename, ofstream::binary | ofstream::trunc);
179  if(!fout.good())
180  throw runtime_error(string("Could not open file: \"").append(filename).append("\"!\n"));
181  if(str::iff::stringEndsWith(filename, ".bit"))
182  writeBitstreamBIT(fout, cmdRect);
183  else if(str::iff::stringEndsWith(filename, ".bin"))
184  writeBitstreamBIN(fout, cmdRect);
185  else
186  throw runtime_error(string("Unknown Xilinx UltraScale file format tried to be written.\n"));
187  fout.close();
188  log("Xilinx UltraScale bitstream file \"" + filename + "\" written successfully.");
189 }
void writeBitstreamBIT(std::ofstream &fout, Rect2D cmdRect)
Definition: inlineOutput.h:189
void writeBitstreamBIN(std::ofstream &fout, Rect2D cmdRect)
Definition: inlineOutput.h:207

References Coord2D::col, parseParams(), Rect2D::position, Coord2D::row, Rect2D::size, str::iff::stringEndsWith(), Endian::to_string(), writeBitstreamBIN(), writeBitstreamBIT(), and XUS_CLB_PER_CLOCK_REGION.

Here is the call graph for this function:

Member Data Documentation

◆ slrMagicInstrLocation

std::streamoff XilinxUltraScale::slrMagicInstrLocation[3]

Definition at line 51 of file XilinxUltraScale.h.


The documentation for this class was generated from the following files: