24 #include "../../../Common/FileIO.h"
25 #include "../../../Common/str.h"
45 uint32_t ctrl0 =
XCAP_getCTRL0value(0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0);
58 uint32_t ctrl0 =
XCAP_getCTRL0value(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0);
76 if((slr + 1) < numberOfSLRs) {
84 slrMagicInstrLocation[slr] = fout.tellp();
90 streamoff currentStreamHead = fout.tellp();
91 streamoff bypassSize = (currentStreamHead - slrMagicInstrLocation[slr])/4 - 1;
92 fout.seekp(slrMagicInstrLocation[slr]);
94 fout.seekp(currentStreamHead);
110 if((slr + 1) < numberOfSLRs) {
112 slrMagicInstrLocation[slr] = fout.tellp();
118 streamoff currentStreamHead = fout.tellp();
119 streamoff bypassSize = (currentStreamHead - slrMagicInstrLocation[slr])/4 - 1;
120 fout.seekp(slrMagicInstrLocation[slr]);
122 fout.seekp(currentStreamHead);
139 size_t dotpos = filename.rfind(
".");
140 if(dotpos == string::npos)
141 throw runtime_error(
string(
"Invalid file name: \"").append(filename).append(
"\"!\n"));
142 designName = filename.substr(0, dotpos);
144 log(
"Writing Xilinx UltraScale+ bitstream to file \"" + filename +
"\":");
148 if(selectedOptions.partialNotFull) {
150 throw runtime_error(
"Currently only full clock region height relocations are supported (use row numbers multiple of 60).");
152 throw runtime_error(
"Invalid output size dimentions.");
155 ofstream fout (filename, ofstream::binary | ofstream::trunc);
157 throw runtime_error(
string(
"Could not open file: \"").append(filename).append(
"\"!\n"));
163 throw runtime_error(
string(
"Unknown Xilinx UltraScale+ file format tried to be written.\n"));
165 log(
"Xilinx UltraScale+ bitstream file \"" + filename +
"\" written successfully.");
Endianness
< Endianness in byteman is represented not only by big/little endian, but also by potential bit swapp...
#define XUSP_CLB_PER_CLOCK_REGION
void outputBitstreamSLRFooterBitstreamSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamSLRHeaderAfterBitstreamSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamEmptySLRHeaderSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamGlobalHeaderSequence(std::ofstream &, bool, Endianness) override
Written by outputBitstreamSLRHeaderAfterBitstreamSequence(), outputBitstreamEmptySLRHeaderSequence() ...
void writeBitstream(std::string, std::string, Rect2D)
void outputBitstreamEmptySLRWrapUpSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamGlobalFooterSequence(std::ofstream &, bool, Endianness) override
void outputBitstreamSLRWrapUpSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamSLRHeaderBitstreamSequence(std::ofstream &, int, bool, Endianness) override
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.
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.
void XCAP_writeSYNQ(std::ofstream &fout, Endianness e)
Generate and write an SYNQ command.
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.
void XCAP_writeType2(std::ofstream &fout, int wordCount, Endianness e)
Generate and write only a type 2 FDRI command.
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.
void XCAP_writeNOP(std::ofstream &fout, int cnt, int payload, Endianness e)
Generate the encoding for NOP instructions and write them to file ofstream.
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.
uint32_t XCAP_getFarFarInstruction()
Generate and return the encoding for a Far FAR instruction.
void writeBitstreamBIT(std::ofstream &fout, Rect2D cmdRect)
void writeBitstreamBIN(std::ofstream &fout, Rect2D cmdRect)
void parseParams(std::string params)
void write32(std::ofstream &fout, uint32_t writeValue, Endianness e=Endianness::NATIVE)
bool stringEndsWith(std::string checkedString)
Returns false. End of recursion for template.