17 #define FABRIC_SYNC_WORD 0xAA995566
115 fout <<
"Null Command";
118 fout <<
"Write Config";
121 fout <<
"Multiple Frame Write";
124 fout <<
"Deassert GHIGH";
127 fout <<
"Read Config";
133 fout <<
"Clear URAM";
139 fout <<
"Assert GHIGH";
172 fout << std::string(
"UNKNOWN(").append(
std::to_string(
static_cast<int>(commandID))).append(
")");
247 fout << std::string(
"UNKNOWN(").append(
std::to_string(
static_cast<int>(registerID))).append(
")");
255 return ((instruction>>29) & 0x7);
267 return (instruction & 0x07FFFFFF);
279 return (instruction & 0x7FF);
288 return (((type & 0x7) << 29) | ((
static_cast<int>(operation) & 0x3) << 27) | ((
static_cast<int>(reg) & 0x1F) << 13) | (payload & 0x07FFFFFF));
355 for(
int i = 0 ; i < cnt ; i++)
363 for(
int i = 0 ; i < cnt ; i++)
493 inline 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)
495 uint32_t retValue = 0;
496 retValue |= Reserved_31_27 << 27;
497 retValue |= ECLK_EN << 26;
498 retValue |= Reserved_25 << 25;
499 retValue |= DRIVE_DONE << 24;
500 retValue |= Reserved_23 << 23;
501 retValue |= OSCFSEL << 17;
502 retValue |= Reserved_16_15 << 15;
503 retValue |=
static_cast<int>(selDONE_CYCLE) << 12;
504 retValue |=
static_cast<int>(selMATCH_CYCLE) << 9;
505 retValue |=
static_cast<int>(selLOCK_CYCLE) << 6;
506 retValue |=
static_cast<int>(selGTS_CYCLE) << 3;
507 retValue |=
static_cast<int>(selGWE_CYCLE);
513 inline 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)
515 uint32_t retValue = 0;
516 retValue |= EFUSE_KEY << 31;
517 retValue |= ICAP_SELECT << 30;
518 retValue |= Reserved_29_13 << 13;
519 retValue |= OverTempShutDown << 12;
520 retValue |= Reserved_11 << 11;
521 retValue |= ConfigFallback << 10;
522 retValue |= Reserved_9 << 9;
523 retValue |= GLUTMASK_B << 8;
524 retValue |= Reserved_7 << 7;
525 retValue |= DEC << 6;
526 retValue |= SBITS << 4;
527 retValue |= PERSIST << 3;
528 retValue |= Reserved_2_1 << 1;
529 retValue |= GTS_USR_B;
Endianness
< Endianness in byteman is represented not only by big/little endian, but also by potential bit swapp...
@ GTS_DONE
GTS tracks DONE pin. Bitstream property: GTS_CYCLE:DONE.
XCAP::Register XCAP_getInstructionRegister(uint32_t instruction)
Parses and returns instruction register. This is the register being addressed if the instruction is o...
XCAP::Operation XCAP_getInstructionOperation(uint32_t instruction)
Parses and returns instruction operation. Most Xil instructions will NOP or write.
uint32_t XCAP_getInstructionPayload(uint32_t instruction)
Parses and returns instruction payload. This is the immediate value after instruction type and operat...
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.
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...
uint32_t XCAP_getSyncInstruction()
Generate and return the encoding for a SYNC instruction.
void XCAP_writeFDRI1(std::ofstream &fout, int wordCount, Endianness e)
Generate and write only a type 1 FDRI command.
XCAP::Command getXCAPcommand(std::string s)
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_writeFDRI(std::ofstream &fout, int wordCount, Endianness e)
Generate and write an FDRI command. Always uses type 2 command for simplicity.
uint32_t XCAP_getType1NopInstruction(int payload)
Generate and return the encoding for a type 1 NOP instruction.
uint32_t XCAP_getType1WriteInstruction(XCAP::Register reg, int payload)
Generate and return the encoding for a type 1 Write instruction.
uint32_t XCAP_IDCODEInstruction()
Generate and return the encoding for a IDCODE writing instruction.
uint32_t XCAP_getType2WriteInstruction(int payload)
Generate and return the encoding for a type 2 Write instruction.
void XCAP_writeSYNQ(std::ofstream &fout, Endianness e)
Generate and write an SYNQ command.
uint32_t XCAP_getType1ReadInstruction(XCAP::Register reg, int payload)
Generate and return the encoding for a type 1 Read instruction.
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_writeRESERVED(std::ofstream &fout, int cnt, int payload, Endianness e)
Generate the encoding for Reserved instructions and write them to file ofstream.
uint32_t XCAP_getType1ReservedInstruction(int payload)
Generate and return the encoding for a type 1 Reserved instruction.
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.
uint32_t XCAP_getType2NopInstruction(int payload)
Generate and return the encoding for a type 2 NOP instruction.
uint32_t XCAP_getType2Instruction(XCAP::Operation operation, int payload)
Generate and return the encoding for a type 2 instruction.
uint32_t XCAP_getInstructionType(uint32_t instruction)
Parses and returns instruction type. Valid Xil instructions will be of types 1 and 2.
uint32_t XCAP_getType1Instruction(XCAP::Operation operation, XCAP::Register reg, int payload)
Generate and return the encoding for a type 1 instruction.
void writeXCAPcommandName(std::ofstream &fout, XCAP::Command commandID)
uint32_t XCAP_getType2ReadInstruction(int payload)
Generate and return the encoding for a type 2 Read instruction.
@ GWE_DONE
GWE tracks DONE pin. Bitstream property: GWE_CYCLE:DONE.
uint32_t XCAP_getType2ReservedInstruction(int payload)
Generate and return the encoding for a type 2 Reserved instruction.
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.
void writeXCAPregisterName(std::ofstream &fout, XCAP::Register registerID)
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.
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.
XCAP::Register getXCAPregister(std::string s)
uint32_t XCAP_getInstruction(int type, XCAP::Operation operation, XCAP::Register reg, int payload)
Generate and return the encoding for an instruction.
std::string to_string(Endianness e)
void write32(std::ofstream &fout, uint32_t writeValue, Endianness e=Endianness::NATIVE)
bool stringContains(std::string checkedString)
Returns false. End of recursion for template.