24 #include "../../../Common/FileIO.h"
25 #include "../../../Common/str.h"
47 uint32_t ctrl0 =
XCAP_getCTRL0value(0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0);
61 uint32_t ctrl0 =
XCAP_getCTRL0value(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0);
80 if((slr + 1) < numberOfSLRs) {
88 slrMagicInstrLocation[slr] = fout.tellp();
95 streamoff currentStreamHead = fout.tellp();
96 streamoff bypassSize = (currentStreamHead - slrMagicInstrLocation[slr])/4 - 1;
97 fout.seekp(slrMagicInstrLocation[slr]);
99 fout.seekp(currentStreamHead);
116 if((slr + 1) < numberOfSLRs) {
118 slrMagicInstrLocation[slr] = fout.tellp();
125 streamoff currentStreamHead = fout.tellp();
126 streamoff bypassSize = (currentStreamHead - slrMagicInstrLocation[slr])/4 - 1;
127 fout.seekp(slrMagicInstrLocation[slr]);
129 fout.seekp(currentStreamHead);
146 size_t dotpos = filename.rfind(
".");
147 if(dotpos == string::npos)
148 throw runtime_error(
string(
"Invalid file name: \"").append(filename).append(
"\"!\n"));
149 designName = filename.substr(0, dotpos);
151 log(
"Writing Xilinx Series 7 bitstream to file \"" + filename +
"\":");
155 if(selectedOptions.partialNotFull) {
157 throw runtime_error(
"Currently only full clock region height relocations are supported (use row numbers multiple of 60).");
159 throw runtime_error(
"Invalid output size dimentions.");
162 ofstream fout (filename, ofstream::binary | ofstream::trunc);
164 throw runtime_error(
string(
"Could not open file: \"").append(filename).append(
"\"!\n"));
170 throw runtime_error(
string(
"Unknown Xilinx Series 7 file format tried to be written.\n"));
172 log(
"Xilinx Series 7 bitstream file \"" + filename +
"\" written successfully.");
Endianness
< Endianness in byteman is represented not only by big/little endian, but also by potential bit swapp...
#define XS7_CLB_PER_CLOCK_REGION
void outputBitstreamSLRHeaderAfterBitstreamSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamSLRWrapUpSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamGlobalHeaderSequence(std::ofstream &, bool, Endianness) override
Written by outputBitstreamSLRHeaderAfterBitstreamSequence(), outputBitstreamEmptySLRHeaderSequence() ...
void outputBitstreamSLRFooterBitstreamSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamEmptySLRWrapUpSequence(std::ofstream &, int, bool, Endianness) override
void writeBitstream(std::string, std::string, Rect2D)
void outputBitstreamEmptySLRHeaderSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamSLRHeaderBitstreamSequence(std::ofstream &, int, bool, Endianness) override
void outputBitstreamGlobalFooterSequence(std::ofstream &, 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.