byteman  1.3 (Build #225)
Bitstream relocation and manipulation tool
Functions
FileIO Namespace Reference

Functions

uint16_t read16 (std::ifstream &fin, Endianness e=Endianness::NATIVE)
 
uint32_t read32 (std::ifstream &fin, Endianness e=Endianness::NATIVE)
 
uint64_t read64 (std::ifstream &fin, Endianness e=Endianness::NATIVE)
 
uint8_t read8 (std::ifstream &fin, Endianness e=Endianness::NATIVE)
 
uint16_t readBigEndian16 (std::ifstream &fin)
 
uint32_t readBigEndian32 (std::ifstream &fin)
 
uint64_t readBigEndian64 (std::ifstream &fin)
 
uint8_t readBigEndian8 (std::ifstream &fin)
 
uint16_t readBitSwappedBigEndian16 (std::ifstream &fin)
 
uint32_t readBitSwappedBigEndian32 (std::ifstream &fin)
 
uint64_t readBitSwappedBigEndian64 (std::ifstream &fin)
 
uint8_t readBitSwappedBigEndian8 (std::ifstream &fin)
 
uint16_t readBitSwappedLittleEndian16 (std::ifstream &fin)
 
uint32_t readBitSwappedLittleEndian32 (std::ifstream &fin)
 
uint64_t readBitSwappedLittleEndian64 (std::ifstream &fin)
 
uint8_t readBitSwappedLittleEndian8 (std::ifstream &fin)
 
std::string readBitSwappedString (std::ifstream &fin, int stringSize)
 
char * readBitSwappedStringIntoCharArray (std::ifstream &fin, int stringSize)
 
uint16_t readLittleEndian16 (std::ifstream &fin)
 
uint32_t readLittleEndian32 (std::ifstream &fin)
 
uint64_t readLittleEndian64 (std::ifstream &fin)
 
uint8_t readLittleEndian8 (std::ifstream &fin)
 
uint16_t readNative16 (std::ifstream &fin)
 
uint32_t readNative32 (std::ifstream &fin)
 
uint64_t readNative64 (std::ifstream &fin)
 
uint8_t readNative8 (std::ifstream &fin)
 
std::string readString (std::ifstream &fin, int stringSize)
 
std::string readString (std::ifstream &fin, int stringSize, Endianness e)
 
char * readStringIntoCharArray (std::ifstream &fin, int stringSize)
 
char * readStringIntoCharArray (std::ifstream &fin, int stringSize, Endianness e)
 
void write16 (std::ofstream &fout, uint16_t writeValue, Endianness e=Endianness::NATIVE)
 
void write32 (std::ofstream &fout, uint32_t writeValue, Endianness e=Endianness::NATIVE)
 
void write64 (std::ofstream &fout, uint64_t writeValue, Endianness e=Endianness::NATIVE)
 
void write8 (std::ofstream &fout, uint8_t writeValue, Endianness e=Endianness::NATIVE)
 
void writeBigEndian16 (std::ofstream &fout, uint16_t writeValue)
 
void writeBigEndian32 (std::ofstream &fout, uint32_t writeValue)
 
void writeBigEndian64 (std::ofstream &fout, uint64_t writeValue)
 
void writeBigEndian8 (std::ofstream &fout, uint8_t writeValue)
 
void writeBitSwappedBigEndian16 (std::ofstream &fout, uint16_t writeValue)
 
void writeBitSwappedBigEndian32 (std::ofstream &fout, uint32_t writeValue)
 
void writeBitSwappedBigEndian64 (std::ofstream &fout, uint64_t writeValue)
 
void writeBitSwappedBigEndian8 (std::ofstream &fout, uint8_t writeValue)
 
void writeBitSwappedCharArray (std::ofstream &fout, char *writeCharArray, size_t outputSize=0)
 
void writeBitSwappedLittleEndian16 (std::ofstream &fout, uint16_t writeValue)
 
void writeBitSwappedLittleEndian32 (std::ofstream &fout, uint32_t writeValue)
 
void writeBitSwappedLittleEndian64 (std::ofstream &fout, uint64_t writeValue)
 
void writeBitSwappedLittleEndian8 (std::ofstream &fout, uint8_t writeValue)
 
void writeBitSwappedString (std::ofstream &fout, std::string writeString, size_t outputSize=0)
 
void writeCharArray (std::ofstream &fout, char *writeCharArray, Endianness e)
 
void writeCharArray (std::ofstream &fout, char *writeCharArray, size_t outputSize, Endianness e)
 
void writeCharArray (std::ofstream &fout, char *writeCharArray, size_t outputSize=0)
 
void writeLittleEndian16 (std::ofstream &fout, uint16_t writeValue)
 
void writeLittleEndian32 (std::ofstream &fout, uint32_t writeValue)
 
void writeLittleEndian64 (std::ofstream &fout, uint64_t writeValue)
 
void writeLittleEndian8 (std::ofstream &fout, uint8_t writeValue)
 
void writeNative16 (std::ofstream &fout, uint16_t writeValue)
 
void writeNative32 (std::ofstream &fout, uint32_t writeValue)
 
void writeNative64 (std::ofstream &fout, uint64_t writeValue)
 
void writeNative8 (std::ofstream &fout, uint8_t writeValue)
 
void writeString (std::ofstream &fout, std::string writeString, Endianness e)
 
void writeString (std::ofstream &fout, std::string writeString, size_t outputSize, Endianness e)
 
void writeString (std::ofstream &fout, std::string writeString, size_t outputSize=0)
 

Function Documentation

◆ read16()

uint16_t FileIO::read16 ( std::ifstream &  fin,
Endianness  e = Endianness::NATIVE 
)
inline

Definition at line 143 of file FileIO.h.

144  {
145  if(e == Endianness::BE)
146  return FileIO::readBigEndian16(fin);
147  else if(e == Endianness::LE)
148  return FileIO::readLittleEndian16(fin);
149  else if(e == Endianness::BE_BS)
151  else if(e == Endianness::LE_BS)
153  return FileIO::readNative16(fin);
154  }
@ BE_BS
Big endian with bit swaps inside each byte.
@ LE_BS
Little endian with bit swaps inside each byte.
@ LE
Little endian ("LE" instead of full-er name, so it does not conflict with linux's reserved endianess ...
@ BE
Big endian ("BE" instead of full-er name, so it does not conflict with linux's reserved endianess wor...
uint16_t readBigEndian16(std::ifstream &fin)
Definition: FileIO.h:60
uint16_t readBitSwappedLittleEndian16(std::ifstream &fin)
Definition: FileIO.h:111
uint16_t readNative16(std::ifstream &fin)
Definition: FileIO.h:40
uint16_t readBitSwappedBigEndian16(std::ifstream &fin)
Definition: FileIO.h:94
uint16_t readLittleEndian16(std::ifstream &fin)
Definition: FileIO.h:77

References BE, BE_BS, LE, LE_BS, readBigEndian16(), readBitSwappedBigEndian16(), readBitSwappedLittleEndian16(), readLittleEndian16(), and readNative16().

Referenced by parseBITheader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read32()

uint32_t FileIO::read32 ( std::ifstream &  fin,
Endianness  e = Endianness::NATIVE 
)
inline

Definition at line 131 of file FileIO.h.

132  {
133  if(e == Endianness::BE)
134  return FileIO::readBigEndian32(fin);
135  else if(e == Endianness::LE)
136  return FileIO::readLittleEndian32(fin);
137  else if(e == Endianness::BE_BS)
139  else if(e == Endianness::LE_BS)
141  return FileIO::readNative32(fin);
142  }
uint32_t readBigEndian32(std::ifstream &fin)
Definition: FileIO.h:56
uint32_t readNative32(std::ifstream &fin)
Definition: FileIO.h:34
uint32_t readLittleEndian32(std::ifstream &fin)
Definition: FileIO.h:73
uint32_t readBitSwappedLittleEndian32(std::ifstream &fin)
Definition: FileIO.h:107
uint32_t readBitSwappedBigEndian32(std::ifstream &fin)
Definition: FileIO.h:90

References BE, BE_BS, LE, LE_BS, readBigEndian32(), readBitSwappedBigEndian32(), readBitSwappedLittleEndian32(), readLittleEndian32(), and readNative32().

Referenced by assemblyOutputData(), XilinxSeries7::disassemblerToAsm(), XilinxUltraScale::disassemblerToAsm(), XilinxUltraScalePlus::disassemblerToAsm(), findBitstreamSyncSequence(), findBitstreamSyncWord(), parseBITheader(), parseBitstreamEndianness(), parseBitstreamIDCODE(), and readBitstreamMain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read64()

uint64_t FileIO::read64 ( std::ifstream &  fin,
Endianness  e = Endianness::NATIVE 
)
inline

Definition at line 119 of file FileIO.h.

120  {
121  if(e == Endianness::BE)
122  return FileIO::readBigEndian64(fin);
123  else if(e == Endianness::LE)
124  return FileIO::readLittleEndian64(fin);
125  else if(e == Endianness::BE_BS)
127  else if(e == Endianness::LE_BS)
129  return FileIO::readNative64(fin);
130  }
uint64_t readBitSwappedLittleEndian64(std::ifstream &fin)
Definition: FileIO.h:103
uint64_t readBitSwappedBigEndian64(std::ifstream &fin)
Definition: FileIO.h:86
uint64_t readLittleEndian64(std::ifstream &fin)
Definition: FileIO.h:69
uint64_t readBigEndian64(std::ifstream &fin)
Definition: FileIO.h:52
uint64_t readNative64(std::ifstream &fin)
Definition: FileIO.h:28

References BE, BE_BS, LE, LE_BS, readBigEndian64(), readBitSwappedBigEndian64(), readBitSwappedLittleEndian64(), readLittleEndian64(), and readNative64().

Here is the call graph for this function:

◆ read8()

uint8_t FileIO::read8 ( std::ifstream &  fin,
Endianness  e = Endianness::NATIVE 
)
inline

Definition at line 155 of file FileIO.h.

156  {
157  if(e == Endianness::BE)
158  return FileIO::readBigEndian8(fin);
159  else if(e == Endianness::LE)
160  return FileIO::readLittleEndian8(fin);
161  else if(e == Endianness::BE_BS)
163  else if(e == Endianness::LE_BS)
165  return FileIO::readNative8(fin);
166  }
uint8_t readNative8(std::ifstream &fin)
Definition: FileIO.h:46
uint8_t readBitSwappedLittleEndian8(std::ifstream &fin)
Definition: FileIO.h:115
uint8_t readBitSwappedBigEndian8(std::ifstream &fin)
Definition: FileIO.h:98
uint8_t readBigEndian8(std::ifstream &fin)
Definition: FileIO.h:64
uint8_t readLittleEndian8(std::ifstream &fin)
Definition: FileIO.h:81

References BE, BE_BS, LE, LE_BS, readBigEndian8(), readBitSwappedBigEndian8(), readBitSwappedLittleEndian8(), readLittleEndian8(), and readNative8().

Here is the call graph for this function:

◆ readBigEndian16()

uint16_t FileIO::readBigEndian16 ( std::ifstream &  fin)
inline

Definition at line 60 of file FileIO.h.

61  {
63  }
uint16_t NativeToBigEndian16(uint16_t x)
Definition: Endianness.h:148

References Endian::NativeToBigEndian16(), and readNative16().

Referenced by read16(), and readBitSwappedBigEndian16().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBigEndian32()

uint32_t FileIO::readBigEndian32 ( std::ifstream &  fin)
inline

Definition at line 56 of file FileIO.h.

57  {
59  }
uint32_t NativeToBigEndian32(uint32_t x)
Definition: Endianness.h:152

References Endian::NativeToBigEndian32(), and readNative32().

Referenced by read32(), and readBitSwappedBigEndian32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBigEndian64()

uint64_t FileIO::readBigEndian64 ( std::ifstream &  fin)
inline

Definition at line 52 of file FileIO.h.

53  {
55  }
uint64_t NativeToBigEndian64(uint64_t x)
Definition: Endianness.h:156

References Endian::NativeToBigEndian64(), and readNative64().

Referenced by read64(), and readBitSwappedBigEndian64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBigEndian8()

uint8_t FileIO::readBigEndian8 ( std::ifstream &  fin)
inline

Definition at line 64 of file FileIO.h.

65  {
66  return readNative8(fin);
67  }

References readNative8().

Referenced by read8(), and readBitSwappedBigEndian8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedBigEndian16()

uint16_t FileIO::readBitSwappedBigEndian16 ( std::ifstream &  fin)
inline

Definition at line 94 of file FileIO.h.

95  {
97  }
uint16_t BitSwap16(uint16_t x)
Definition: Endianness.h:216

References Endian::BitSwap16(), and readBigEndian16().

Referenced by read16().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedBigEndian32()

uint32_t FileIO::readBitSwappedBigEndian32 ( std::ifstream &  fin)
inline

Definition at line 90 of file FileIO.h.

91  {
93  }
uint32_t BitSwap32(uint32_t x)
Definition: Endianness.h:220

References Endian::BitSwap32(), and readBigEndian32().

Referenced by read32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedBigEndian64()

uint64_t FileIO::readBitSwappedBigEndian64 ( std::ifstream &  fin)
inline

Definition at line 86 of file FileIO.h.

87  {
89  }
uint64_t BitSwap64(uint64_t x)
Definition: Endianness.h:224

References Endian::BitSwap64(), and readBigEndian64().

Referenced by read64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedBigEndian8()

uint8_t FileIO::readBitSwappedBigEndian8 ( std::ifstream &  fin)
inline

Definition at line 98 of file FileIO.h.

99  {
101  }
uint8_t BitSwap8(uint8_t x)
Definition: Endianness.h:212

References Endian::BitSwap8(), and readBigEndian8().

Referenced by read8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedLittleEndian16()

uint16_t FileIO::readBitSwappedLittleEndian16 ( std::ifstream &  fin)
inline

Definition at line 111 of file FileIO.h.

112  {
114  }

References Endian::BitSwap16(), and readLittleEndian16().

Referenced by read16().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedLittleEndian32()

uint32_t FileIO::readBitSwappedLittleEndian32 ( std::ifstream &  fin)
inline

Definition at line 107 of file FileIO.h.

108  {
110  }

References Endian::BitSwap32(), and readLittleEndian32().

Referenced by read32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedLittleEndian64()

uint64_t FileIO::readBitSwappedLittleEndian64 ( std::ifstream &  fin)
inline

Definition at line 103 of file FileIO.h.

104  {
106  }

References Endian::BitSwap64(), and readLittleEndian64().

Referenced by read64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedLittleEndian8()

uint8_t FileIO::readBitSwappedLittleEndian8 ( std::ifstream &  fin)
inline

Definition at line 115 of file FileIO.h.

116  {
118  }

References Endian::BitSwap8(), and readLittleEndian8().

Referenced by read8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedString()

std::string FileIO::readBitSwappedString ( std::ifstream &  fin,
int  stringSize 
)
inline

Definition at line 191 of file FileIO.h.

192  {
193  char* readCharArray = readBitSwappedStringIntoCharArray(fin, stringSize);
194  std::string returnString = std::string(readCharArray);
195  delete readCharArray;
196  return returnString;
197  }
char * readBitSwappedStringIntoCharArray(std::ifstream &fin, int stringSize)
Definition: FileIO.h:184

References readBitSwappedStringIntoCharArray().

Referenced by readString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitSwappedStringIntoCharArray()

char* FileIO::readBitSwappedStringIntoCharArray ( std::ifstream &  fin,
int  stringSize 
)
inline

Definition at line 184 of file FileIO.h.

185  {
186  char* readCharArray = FileIO::readStringIntoCharArray(fin, stringSize);
187  for(int i = 0 ; i < stringSize ; i++)
188  readCharArray[i] = Endian::BitSwap8(readCharArray[i]);
189  return readCharArray;
190  }
char * readStringIntoCharArray(std::ifstream &fin, int stringSize)
Definition: FileIO.h:169

References Endian::BitSwap8(), and readStringIntoCharArray().

Referenced by readBitSwappedString(), and readStringIntoCharArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readLittleEndian16()

uint16_t FileIO::readLittleEndian16 ( std::ifstream &  fin)
inline

Definition at line 77 of file FileIO.h.

78  {
80  }
uint16_t NativeToLittleEndian16(uint16_t x)
Definition: Endianness.h:165

References Endian::NativeToLittleEndian16(), and readNative16().

Referenced by read16(), and readBitSwappedLittleEndian16().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readLittleEndian32()

uint32_t FileIO::readLittleEndian32 ( std::ifstream &  fin)
inline

Definition at line 73 of file FileIO.h.

74  {
76  }
uint32_t NativeToLittleEndian32(uint32_t x)
Definition: Endianness.h:169

References Endian::NativeToLittleEndian32(), and readNative32().

Referenced by read32(), and readBitSwappedLittleEndian32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readLittleEndian64()

uint64_t FileIO::readLittleEndian64 ( std::ifstream &  fin)
inline

Definition at line 69 of file FileIO.h.

70  {
72  }
uint64_t NativeToLittleEndian64(uint64_t x)
Definition: Endianness.h:173

References Endian::NativeToLittleEndian64(), and readNative64().

Referenced by read64(), and readBitSwappedLittleEndian64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readLittleEndian8()

uint8_t FileIO::readLittleEndian8 ( std::ifstream &  fin)
inline

Definition at line 81 of file FileIO.h.

82  {
83  return readNative8(fin);
84  }

References readNative8().

Referenced by read8(), and readBitSwappedLittleEndian8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readNative16()

uint16_t FileIO::readNative16 ( std::ifstream &  fin)
inline

Definition at line 40 of file FileIO.h.

41  {
42  uint16_t readValue;
43  fin.read(reinterpret_cast<char*>(&readValue), 2);
44  return readValue;
45  }

Referenced by read16(), readBigEndian16(), and readLittleEndian16().

Here is the caller graph for this function:

◆ readNative32()

uint32_t FileIO::readNative32 ( std::ifstream &  fin)
inline

Definition at line 34 of file FileIO.h.

35  {
36  uint32_t readValue;
37  fin.read(reinterpret_cast<char*>(&readValue), 4);
38  return readValue;
39  }

Referenced by read32(), readBigEndian32(), and readLittleEndian32().

Here is the caller graph for this function:

◆ readNative64()

uint64_t FileIO::readNative64 ( std::ifstream &  fin)
inline

Definition at line 28 of file FileIO.h.

29  {
30  uint64_t readValue;
31  fin.read(reinterpret_cast<char*>(&readValue), 8);
32  return readValue;
33  }

Referenced by read64(), readBigEndian64(), and readLittleEndian64().

Here is the caller graph for this function:

◆ readNative8()

uint8_t FileIO::readNative8 ( std::ifstream &  fin)
inline

Definition at line 46 of file FileIO.h.

47  {
48  uint8_t readValue;
49  fin.read(reinterpret_cast<char*>(&readValue), 1);
50  return readValue;
51  }

Referenced by parseBITheader(), read8(), readBigEndian8(), and readLittleEndian8().

Here is the caller graph for this function:

◆ readString() [1/2]

std::string FileIO::readString ( std::ifstream &  fin,
int  stringSize 
)
inline

Definition at line 176 of file FileIO.h.

177  {
178  char* readCharArray = readStringIntoCharArray(fin, stringSize);
179  std::string returnString = std::string(readCharArray);
180  delete readCharArray;
181  return returnString;
182  }
char * readStringIntoCharArray(std::ifstream &fin, int stringSize, Endianness e)
Definition: FileIO.h:199

References readStringIntoCharArray().

Referenced by parseBITheader(), and readString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readString() [2/2]

std::string FileIO::readString ( std::ifstream &  fin,
int  stringSize,
Endianness  e 
)
inline

Definition at line 206 of file FileIO.h.

207  {
208  if(e == Endianness::BE_BS || e == Endianness::LE_BS)
209  return FileIO::readBitSwappedString(fin, stringSize);
210  else
211  return FileIO::readString(fin, stringSize);
212  }
std::string readString(std::ifstream &fin, int stringSize)
Definition: FileIO.h:176
std::string readBitSwappedString(std::ifstream &fin, int stringSize)
Definition: FileIO.h:191

References BE_BS, LE_BS, readBitSwappedString(), and readString().

Here is the call graph for this function:

◆ readStringIntoCharArray() [1/2]

char* FileIO::readStringIntoCharArray ( std::ifstream &  fin,
int  stringSize 
)
inline

Definition at line 169 of file FileIO.h.

170  {
171  char* readCharArray = new char[stringSize + 1];
172  fin.read(readCharArray, stringSize);
173  readCharArray[stringSize]='\0';
174  return readCharArray;
175  }

Referenced by readBitSwappedStringIntoCharArray(), readString(), and readStringIntoCharArray().

Here is the caller graph for this function:

◆ readStringIntoCharArray() [2/2]

char* FileIO::readStringIntoCharArray ( std::ifstream &  fin,
int  stringSize,
Endianness  e 
)
inline

Definition at line 199 of file FileIO.h.

200  {
201  if(e == Endianness::BE_BS || e == Endianness::LE_BS)
202  return FileIO::readBitSwappedStringIntoCharArray(fin, stringSize);
203  else
204  return FileIO::readStringIntoCharArray(fin, stringSize);
205  }

References BE_BS, LE_BS, readBitSwappedStringIntoCharArray(), and readStringIntoCharArray().

Here is the call graph for this function:

◆ write16()

void FileIO::write16 ( std::ofstream &  fout,
uint16_t  writeValue,
Endianness  e = Endianness::NATIVE 
)
inline

Definition at line 432 of file FileIO.h.

433  {
434  if(e == Endianness::NATIVE)
435  FileIO::writeNative16(fout, writeValue);
436  else if(e == Endianness::BE)
437  FileIO::writeBigEndian16(fout, writeValue);
438  else if(e == Endianness::LE)
439  FileIO::writeLittleEndian16(fout, writeValue);
440  else if(e == Endianness::BE_BS)
441  FileIO::writeBitSwappedBigEndian16(fout, writeValue);
442  else if(e == Endianness::LE_BS)
443  FileIO::writeBitSwappedLittleEndian16(fout, writeValue);
444  }
@ NATIVE
System native will always be the fastest endianess to process.
void writeBitSwappedBigEndian16(std::ofstream &fout, uint16_t writeValue)
Definition: FileIO.h:285
void writeBigEndian16(std::ofstream &fout, uint16_t writeValue)
Definition: FileIO.h:241
void writeNative16(std::ofstream &fout, uint16_t writeValue)
Definition: FileIO.h:222
void writeLittleEndian16(std::ofstream &fout, uint16_t writeValue)
Definition: FileIO.h:262
void writeBitSwappedLittleEndian16(std::ofstream &fout, uint16_t writeValue)
Definition: FileIO.h:310

References BE, BE_BS, LE, LE_BS, NATIVE, writeBigEndian16(), writeBitSwappedBigEndian16(), writeBitSwappedLittleEndian16(), writeLittleEndian16(), and writeNative16().

Referenced by outputBITheader(), and outputBITheader16bString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write32()

void FileIO::write32 ( std::ofstream &  fout,
uint32_t  writeValue,
Endianness  e = Endianness::NATIVE 
)
inline

Definition at line 419 of file FileIO.h.

420  {
421  if(e == Endianness::NATIVE)
422  FileIO::writeNative32(fout, writeValue);
423  else if(e == Endianness::BE)
424  FileIO::writeBigEndian32(fout, writeValue);
425  else if(e == Endianness::LE)
426  FileIO::writeLittleEndian32(fout, writeValue);
427  else if(e == Endianness::BE_BS)
428  FileIO::writeBitSwappedBigEndian32(fout, writeValue);
429  else if(e == Endianness::LE_BS)
430  FileIO::writeBitSwappedLittleEndian32(fout, writeValue);
431  }
void writeBitSwappedLittleEndian32(std::ofstream &fout, uint32_t writeValue)
Definition: FileIO.h:304
void writeBigEndian32(std::ofstream &fout, uint32_t writeValue)
Definition: FileIO.h:236
void writeLittleEndian32(std::ofstream &fout, uint32_t writeValue)
Definition: FileIO.h:257
void writeNative32(std::ofstream &fout, uint32_t writeValue)
Definition: FileIO.h:218
void writeBitSwappedBigEndian32(std::ofstream &fout, uint32_t writeValue)
Definition: FileIO.h:279

References BE, BE_BS, LE, LE_BS, NATIVE, writeBigEndian32(), writeBitSwappedBigEndian32(), writeBitSwappedLittleEndian32(), writeLittleEndian32(), and writeNative32().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), XilinxUltraScalePlus::assemblerAsmTo(), outputBITheader(), outputBITheaderLengthField(), XilinxSeries7::outputBitstreamEmptySLRWrapUpSequence(), XilinxUltraScale::outputBitstreamEmptySLRWrapUpSequence(), XilinxUltraScalePlus::outputBitstreamEmptySLRWrapUpSequence(), XilinxSeries7::outputBitstreamSLRWrapUpSequence(), XilinxUltraScale::outputBitstreamSLRWrapUpSequence(), XilinxUltraScalePlus::outputBitstreamSLRWrapUpSequence(), outputCAPheaderConstant(), XCAP_writeFDRI1(), XCAP_writeNOP(), XCAP_writeReadRegister(), XCAP_writeRegister(), XCAP_writeRESERVED(), XCAP_writeSelectRegister(), XCAP_writeSYNQ(), and XCAP_writeType2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write64()

void FileIO::write64 ( std::ofstream &  fout,
uint64_t  writeValue,
Endianness  e = Endianness::NATIVE 
)
inline

Definition at line 406 of file FileIO.h.

407  {
408  if(e == Endianness::NATIVE)
409  FileIO::writeNative64(fout, writeValue);
410  else if(e == Endianness::BE)
411  FileIO::writeBigEndian64(fout, writeValue);
412  else if(e == Endianness::LE)
413  FileIO::writeLittleEndian64(fout, writeValue);
414  else if(e == Endianness::BE_BS)
415  FileIO::writeBitSwappedBigEndian64(fout, writeValue);
416  else if(e == Endianness::LE_BS)
417  FileIO::writeBitSwappedLittleEndian64(fout, writeValue);
418  }
void writeBitSwappedLittleEndian64(std::ofstream &fout, uint64_t writeValue)
Definition: FileIO.h:298
void writeNative64(std::ofstream &fout, uint64_t writeValue)
Definition: FileIO.h:214
void writeLittleEndian64(std::ofstream &fout, uint64_t writeValue)
Definition: FileIO.h:252
void writeBigEndian64(std::ofstream &fout, uint64_t writeValue)
Definition: FileIO.h:231
void writeBitSwappedBigEndian64(std::ofstream &fout, uint64_t writeValue)
Definition: FileIO.h:273

References BE, BE_BS, LE, LE_BS, NATIVE, writeBigEndian64(), writeBitSwappedBigEndian64(), writeBitSwappedLittleEndian64(), writeLittleEndian64(), and writeNative64().

Here is the call graph for this function:

◆ write8()

void FileIO::write8 ( std::ofstream &  fout,
uint8_t  writeValue,
Endianness  e = Endianness::NATIVE 
)
inline

Definition at line 445 of file FileIO.h.

446  {
447  if(e == Endianness::NATIVE)
448  FileIO::writeNative8(fout, writeValue);
449  else if(e == Endianness::BE)
450  FileIO::writeBigEndian8(fout, writeValue);
451  else if(e == Endianness::LE)
452  FileIO::writeLittleEndian8(fout, writeValue);
453  else if(e == Endianness::BE_BS)
454  FileIO::writeBitSwappedBigEndian8(fout, writeValue);
455  else if(e == Endianness::LE_BS)
456  FileIO::writeBitSwappedLittleEndian8(fout, writeValue);
457  }
void writeBitSwappedLittleEndian8(std::ofstream &fout, uint8_t writeValue)
Definition: FileIO.h:316
void writeLittleEndian8(std::ofstream &fout, uint8_t writeValue)
Definition: FileIO.h:267
void writeBigEndian8(std::ofstream &fout, uint8_t writeValue)
Definition: FileIO.h:246
void writeBitSwappedBigEndian8(std::ofstream &fout, uint8_t writeValue)
Definition: FileIO.h:291
void writeNative8(std::ofstream &fout, uint8_t writeValue)
Definition: FileIO.h:226

References BE, BE_BS, LE, LE_BS, NATIVE, writeBigEndian8(), writeBitSwappedBigEndian8(), writeBitSwappedLittleEndian8(), writeLittleEndian8(), and writeNative8().

Referenced by XilinxSeries7::assemblerAsmTo(), XilinxUltraScale::assemblerAsmTo(), XilinxUltraScalePlus::assemblerAsmTo(), and outputBITheader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBigEndian16()

void FileIO::writeBigEndian16 ( std::ofstream &  fout,
uint16_t  writeValue 
)
inline

Definition at line 241 of file FileIO.h.

242  {
243  uint16_t writeValueBigEndian = Endian::BigEndianToNative16(writeValue);
244  fout.write(reinterpret_cast<char*>(&writeValueBigEndian), sizeof(writeValueBigEndian));
245  }
uint16_t BigEndianToNative16(uint16_t x)
Definition: Endianness.h:182

References Endian::BigEndianToNative16().

Referenced by write16().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBigEndian32()

void FileIO::writeBigEndian32 ( std::ofstream &  fout,
uint32_t  writeValue 
)
inline

Definition at line 236 of file FileIO.h.

237  {
238  uint32_t writeValueBigEndian = Endian::BigEndianToNative32(writeValue);
239  fout.write(reinterpret_cast<char*>(&writeValueBigEndian), sizeof(writeValueBigEndian));
240  }
uint32_t BigEndianToNative32(uint32_t x)
Definition: Endianness.h:186

References Endian::BigEndianToNative32().

Referenced by write32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBigEndian64()

void FileIO::writeBigEndian64 ( std::ofstream &  fout,
uint64_t  writeValue 
)
inline

Definition at line 231 of file FileIO.h.

232  {
233  uint64_t writeValueBigEndian = Endian::BigEndianToNative64(writeValue);
234  fout.write(reinterpret_cast<char*>(&writeValueBigEndian), sizeof(writeValueBigEndian));
235  }
uint64_t BigEndianToNative64(uint64_t x)
Definition: Endianness.h:190

References Endian::BigEndianToNative64().

Referenced by write64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBigEndian8()

void FileIO::writeBigEndian8 ( std::ofstream &  fout,
uint8_t  writeValue 
)
inline

Definition at line 246 of file FileIO.h.

247  {
248  uint8_t writeValueBigEndian = Endian::BigEndianToNative8(writeValue);
249  fout.write(reinterpret_cast<char*>(&writeValueBigEndian), sizeof(writeValueBigEndian));
250  }
uint8_t BigEndianToNative8(uint8_t x)
Definition: Endianness.h:178

References Endian::BigEndianToNative8().

Referenced by write8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedBigEndian16()

void FileIO::writeBitSwappedBigEndian16 ( std::ofstream &  fout,
uint16_t  writeValue 
)
inline

Definition at line 285 of file FileIO.h.

286  {
287  uint16_t writeValueByteSwapped = Endian::BitSwap16(writeValue);
288  uint16_t writeValueByteSwappedBigEndian = Endian::BigEndianToNative16(writeValueByteSwapped);
289  fout.write(reinterpret_cast<char*>(&writeValueByteSwappedBigEndian), sizeof(writeValueByteSwappedBigEndian));
290  }

References Endian::BigEndianToNative16(), and Endian::BitSwap16().

Referenced by write16().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedBigEndian32()

void FileIO::writeBitSwappedBigEndian32 ( std::ofstream &  fout,
uint32_t  writeValue 
)
inline

Definition at line 279 of file FileIO.h.

280  {
281  uint32_t writeValueByteSwapped = Endian::BitSwap32(writeValue);
282  uint32_t writeValueByteSwappedBigEndian = Endian::BigEndianToNative32(writeValueByteSwapped);
283  fout.write(reinterpret_cast<char*>(&writeValueByteSwappedBigEndian), sizeof(writeValueByteSwappedBigEndian));
284  }

References Endian::BigEndianToNative32(), and Endian::BitSwap32().

Referenced by write32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedBigEndian64()

void FileIO::writeBitSwappedBigEndian64 ( std::ofstream &  fout,
uint64_t  writeValue 
)
inline

Definition at line 273 of file FileIO.h.

274  {
275  uint64_t writeValueByteSwapped = Endian::BitSwap64(writeValue);
276  uint64_t writeValueByteSwappedBigEndian = Endian::BigEndianToNative64(writeValueByteSwapped);
277  fout.write(reinterpret_cast<char*>(&writeValueByteSwappedBigEndian), sizeof(writeValueByteSwappedBigEndian));
278  }

References Endian::BigEndianToNative64(), and Endian::BitSwap64().

Referenced by write64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedBigEndian8()

void FileIO::writeBitSwappedBigEndian8 ( std::ofstream &  fout,
uint8_t  writeValue 
)
inline

Definition at line 291 of file FileIO.h.

292  {
293  uint8_t writeValueByteSwapped = Endian::BitSwap8(writeValue);
294  uint8_t writeValueByteSwappedBigEndian = Endian::BigEndianToNative8(writeValueByteSwapped);
295  fout.write(reinterpret_cast<char*>(&writeValueByteSwappedBigEndian), sizeof(writeValueByteSwappedBigEndian));
296  }

References Endian::BigEndianToNative8(), and Endian::BitSwap8().

Referenced by write8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedCharArray()

void FileIO::writeBitSwappedCharArray ( std::ofstream &  fout,
char *  writeCharArray,
size_t  outputSize = 0 
)
inline

Definition at line 344 of file FileIO.h.

345  {
346  uint8_t nextChar = 0;
347  size_t charArraySize = 1;
348  for( ; (0 != writeCharArray[charArraySize-1] && charArraySize != outputSize); charArraySize++);
349  for(size_t i = 0 ; i < charArraySize ; i++){
350  nextChar = Endian::BitSwap8(writeCharArray[i]);
351  fout.write(reinterpret_cast<char*>(&nextChar), 1);
352  }
353  nextChar = 0;
354  for( ; charArraySize < outputSize ; charArraySize++)
355  fout.write(reinterpret_cast<char*>(&nextChar), 1);
356  }
void writeCharArray(std::ofstream &fout, char *writeCharArray, Endianness e)
Definition: FileIO.h:391

References Endian::BitSwap8(), and writeCharArray().

Referenced by writeCharArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedLittleEndian16()

void FileIO::writeBitSwappedLittleEndian16 ( std::ofstream &  fout,
uint16_t  writeValue 
)
inline

Definition at line 310 of file FileIO.h.

311  {
312  uint16_t writeValueByteSwapped = Endian::BitSwap16(writeValue);
313  uint16_t writeValueByteSwappedLittleEndian = Endian::LittleEndianToNative16(writeValueByteSwapped);
314  fout.write(reinterpret_cast<char*>(&writeValueByteSwappedLittleEndian), sizeof(writeValueByteSwappedLittleEndian));
315  }
uint16_t LittleEndianToNative16(uint16_t x)
Definition: Endianness.h:198

References Endian::BitSwap16(), and Endian::LittleEndianToNative16().

Referenced by write16().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedLittleEndian32()

void FileIO::writeBitSwappedLittleEndian32 ( std::ofstream &  fout,
uint32_t  writeValue 
)
inline

Definition at line 304 of file FileIO.h.

305  {
306  uint32_t writeValueByteSwapped = Endian::BitSwap32(writeValue);
307  uint32_t writeValueByteSwappedLittleEndian = Endian::LittleEndianToNative32(writeValueByteSwapped);
308  fout.write(reinterpret_cast<char*>(&writeValueByteSwappedLittleEndian), sizeof(writeValueByteSwappedLittleEndian));
309  }
uint32_t LittleEndianToNative32(uint32_t x)
Definition: Endianness.h:202

References Endian::BitSwap32(), and Endian::LittleEndianToNative32().

Referenced by write32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedLittleEndian64()

void FileIO::writeBitSwappedLittleEndian64 ( std::ofstream &  fout,
uint64_t  writeValue 
)
inline

Definition at line 298 of file FileIO.h.

299  {
300  uint64_t writeValueByteSwapped = Endian::BitSwap64(writeValue);
301  uint64_t writeValueByteSwappedLittleEndian = Endian::LittleEndianToNative64(writeValueByteSwapped);
302  fout.write(reinterpret_cast<char*>(&writeValueByteSwappedLittleEndian), sizeof(writeValueByteSwappedLittleEndian));
303  }
uint64_t LittleEndianToNative64(uint64_t x)
Definition: Endianness.h:206

References Endian::BitSwap64(), and Endian::LittleEndianToNative64().

Referenced by write64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedLittleEndian8()

void FileIO::writeBitSwappedLittleEndian8 ( std::ofstream &  fout,
uint8_t  writeValue 
)
inline

Definition at line 316 of file FileIO.h.

317  {
318  uint8_t writeValueByteSwapped = Endian::BitSwap8(writeValue);
319  uint8_t writeValueByteSwappedLittleEndian = Endian::LittleEndianToNative8(writeValueByteSwapped);
320  fout.write(reinterpret_cast<char*>(&writeValueByteSwappedLittleEndian), sizeof(writeValueByteSwappedLittleEndian));
321  }
uint8_t LittleEndianToNative8(uint8_t x)
Definition: Endianness.h:194

References Endian::BitSwap8(), and Endian::LittleEndianToNative8().

Referenced by write8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitSwappedString()

void FileIO::writeBitSwappedString ( std::ofstream &  fout,
std::string  writeString,
size_t  outputSize = 0 
)
inline

Definition at line 357 of file FileIO.h.

358  {
359  uint8_t nextChar = 0;
360  size_t stringSize = writeString.size() + 1;
361  if((0 == outputSize) || (outputSize >= stringSize)) {
362  for(size_t i = 0 ; i < stringSize ; i++){
363  nextChar = Endian::BitSwap8(writeString.at(i));
364  fout.write(reinterpret_cast<char*>(&nextChar), 1);
365  }
366  } else {
367  for(size_t i = 0 ; i < outputSize ; i++){
368  nextChar = Endian::BitSwap8(writeString.at(i));
369  fout.write(reinterpret_cast<char*>(&nextChar), 1);
370  }
371  }
372  nextChar = 0;
373  for( ; stringSize < outputSize ; stringSize++)
374  fout.write(reinterpret_cast<char*>(&nextChar), 1);
375  }
void writeString(std::ofstream &fout, std::string writeString, Endianness e)
Definition: FileIO.h:398

References Endian::BitSwap8(), and writeString().

Referenced by writeString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeCharArray() [1/3]

void FileIO::writeCharArray ( std::ofstream &  fout,
char *  writeCharArray,
Endianness  e 
)
inline

Definition at line 391 of file FileIO.h.

392  {
393  if(e == Endianness::BE_BS || e == Endianness::LE_BS)
395  else
396  return FileIO::writeCharArray(fout, writeCharArray, 0);
397  }
void writeCharArray(std::ofstream &fout, char *writeCharArray, size_t outputSize=0)
Definition: FileIO.h:323
void writeBitSwappedCharArray(std::ofstream &fout, char *writeCharArray, size_t outputSize=0)
Definition: FileIO.h:344

References BE_BS, LE_BS, writeBitSwappedCharArray(), and writeCharArray().

Here is the call graph for this function:

◆ writeCharArray() [2/3]

void FileIO::writeCharArray ( std::ofstream &  fout,
char *  writeCharArray,
size_t  outputSize,
Endianness  e 
)
inline

Definition at line 377 of file FileIO.h.

378  {
379  if(e == Endianness::BE_BS || e == Endianness::LE_BS)
380  return FileIO::writeBitSwappedCharArray(fout, writeCharArray, outputSize);
381  else
382  return FileIO::writeCharArray(fout, writeCharArray, outputSize);
383  }

References BE_BS, LE_BS, writeBitSwappedCharArray(), and writeCharArray().

Here is the call graph for this function:

◆ writeCharArray() [3/3]

void FileIO::writeCharArray ( std::ofstream &  fout,
char *  writeCharArray,
size_t  outputSize = 0 
)
inline

Definition at line 323 of file FileIO.h.

324  {
325  uint8_t nullChar = 0;
326  size_t charArraySize = 1;
327  for( ; (0 != writeCharArray[charArraySize-1] && charArraySize != outputSize); charArraySize++);
328  fout.write(writeCharArray, charArraySize);
329  for( ; charArraySize < outputSize ; charArraySize++)
330  fout.write(reinterpret_cast<char*>(&nullChar), 1);
331  }

Referenced by writeBitSwappedCharArray(), and writeCharArray().

Here is the caller graph for this function:

◆ writeLittleEndian16()

void FileIO::writeLittleEndian16 ( std::ofstream &  fout,
uint16_t  writeValue 
)
inline

Definition at line 262 of file FileIO.h.

263  {
264  uint16_t writeValueLittleEndian = Endian::LittleEndianToNative16(writeValue);
265  fout.write(reinterpret_cast<char*>(&writeValueLittleEndian), sizeof(writeValueLittleEndian));
266  }

References Endian::LittleEndianToNative16().

Referenced by write16().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeLittleEndian32()

void FileIO::writeLittleEndian32 ( std::ofstream &  fout,
uint32_t  writeValue 
)
inline

Definition at line 257 of file FileIO.h.

258  {
259  uint32_t writeValueLittleEndian = Endian::LittleEndianToNative32(writeValue);
260  fout.write(reinterpret_cast<char*>(&writeValueLittleEndian), sizeof(writeValueLittleEndian));
261  }

References Endian::LittleEndianToNative32().

Referenced by write32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeLittleEndian64()

void FileIO::writeLittleEndian64 ( std::ofstream &  fout,
uint64_t  writeValue 
)
inline

Definition at line 252 of file FileIO.h.

253  {
254  uint64_t writeValueLittleEndian = Endian::LittleEndianToNative64(writeValue);
255  fout.write(reinterpret_cast<char*>(&writeValueLittleEndian), sizeof(writeValueLittleEndian));
256  }

References Endian::LittleEndianToNative64().

Referenced by write64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeLittleEndian8()

void FileIO::writeLittleEndian8 ( std::ofstream &  fout,
uint8_t  writeValue 
)
inline

Definition at line 267 of file FileIO.h.

268  {
269  uint8_t writeValueLittleEndian = Endian::LittleEndianToNative8(writeValue);
270  fout.write(reinterpret_cast<char*>(&writeValueLittleEndian), sizeof(writeValueLittleEndian));
271  }

References Endian::LittleEndianToNative8().

Referenced by write8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeNative16()

void FileIO::writeNative16 ( std::ofstream &  fout,
uint16_t  writeValue 
)
inline

Definition at line 222 of file FileIO.h.

223  {
224  fout.write(reinterpret_cast<char*>(&writeValue), sizeof(writeValue));
225  }

Referenced by write16().

Here is the caller graph for this function:

◆ writeNative32()

void FileIO::writeNative32 ( std::ofstream &  fout,
uint32_t  writeValue 
)
inline

Definition at line 218 of file FileIO.h.

219  {
220  fout.write(reinterpret_cast<char*>(&writeValue), sizeof(writeValue));
221  }

Referenced by write32().

Here is the caller graph for this function:

◆ writeNative64()

void FileIO::writeNative64 ( std::ofstream &  fout,
uint64_t  writeValue 
)
inline

Definition at line 214 of file FileIO.h.

215  {
216  fout.write(reinterpret_cast<char*>(&writeValue), sizeof(writeValue));
217  }

Referenced by write64().

Here is the caller graph for this function:

◆ writeNative8()

void FileIO::writeNative8 ( std::ofstream &  fout,
uint8_t  writeValue 
)
inline

Definition at line 226 of file FileIO.h.

227  {
228  fout.write(reinterpret_cast<char*>(&writeValue), sizeof(writeValue));
229  }

Referenced by write8().

Here is the caller graph for this function:

◆ writeString() [1/3]

void FileIO::writeString ( std::ofstream &  fout,
std::string  writeString,
Endianness  e 
)
inline

Definition at line 398 of file FileIO.h.

399  {
400  if(e == Endianness::BE_BS || e == Endianness::LE_BS)
402  else
403  return FileIO::writeString(fout, writeString, 0);
404  }
void writeString(std::ofstream &fout, std::string writeString, size_t outputSize=0)
Definition: FileIO.h:332
void writeBitSwappedString(std::ofstream &fout, std::string writeString, size_t outputSize=0)
Definition: FileIO.h:357

References BE_BS, LE_BS, writeBitSwappedString(), and writeString().

Here is the call graph for this function:

◆ writeString() [2/3]

void FileIO::writeString ( std::ofstream &  fout,
std::string  writeString,
size_t  outputSize,
Endianness  e 
)
inline

Definition at line 384 of file FileIO.h.

385  {
386  if(e == Endianness::BE_BS || e == Endianness::LE_BS)
387  return FileIO::writeBitSwappedString(fout, writeString, outputSize);
388  else
389  return FileIO::writeString(fout, writeString, outputSize);
390  }

References BE_BS, LE_BS, writeBitSwappedString(), and writeString().

Here is the call graph for this function:

◆ writeString() [3/3]

void FileIO::writeString ( std::ofstream &  fout,
std::string  writeString,
size_t  outputSize = 0 
)
inline

Definition at line 332 of file FileIO.h.

333  {
334  uint8_t nullChar = 0;
335  size_t stringSize = writeString.size() + 1;
336  if((0 == outputSize) || (outputSize >= stringSize))
337  fout.write(writeString.c_str(), stringSize);
338  else
339  fout.write(writeString.c_str(), outputSize);
340  for( ; stringSize < outputSize ; stringSize++)
341  fout.write(reinterpret_cast<char*>(&nullChar), 1);
342  }

Referenced by outputBITheader16bString(), writeBitSwappedString(), and writeString().

Here is the caller graph for this function: