31 #ifndef _SIM_NTS_UTILS_H_
32 #define _SIM_NTS_UTILS_H_
39 #include "../MEM/mem.hpp"
40 #include "../NTS/nts.hpp"
41 #include "../NTS/nts_utils.hpp"
42 #include "../NTS/SimNtsUtils.hpp"
64 vector<string>
myTokenizer (
string strBuff,
char delimiter);
88 unsigned int ¶mVal);
100 #ifndef __SYNTHESIS__
102 string datFile,
int &nrChunks,
103 int &nrFrames,
int &nrBytes);
105 string datFile,
int &nrChunks,
106 int &nrFrames,
int &nrBytes);
107 template <
class AXIS_T> \
109 string datFile,
int &nrChunks,
110 int &nrFrames,
int &nrBytes);
111 template <
class AXIS_T> \
113 string datFile,
int &nrChunks,
114 int &nrFrames,
int &nrBytes);
bool readHostSocketFromLine(SockAddr &hostSock, string stringBuffer)
Retrieve a Host socket from a string.
bool readFpgaSocketFromLine(SockAddr &fpgaSock, string stringBuffer)
Retrieve an Fpga socket from a string.
bool readAxisRawFromLine(AxisRaw &axisRaw, string stringBuffer)
Retrieve an AxisRaw chunk from a string.
bool writeApUintToFile(ap_uint< D > &data, ofstream &outFileStream)
Dump an AP_UINT to a file.
string myUint8ToStrHex(ap_uint< 8 > inputNumber)
Converts an UINT8 into a string of 2 HEX characters.
vector< string > myTokenizer(string strBuff, char delimiter)
Brakes a string into tokens by using the 'delimiter' character.
bool isDatFile(string fileName)
Checks if a file has a ".dat" extension.
bool writeAxisRawToFile(AxisRaw &axisRaw, ofstream &outFileStream)
Dump an Axis raw data chunk to a file.
bool drainAxisRawStreamToFile(stream< AxisRaw > &ss, const string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
bool isDottedDecimal(string ipStr)
Checks if a string contains an IP address represented in dot-decimal notation.
ap_uint< 64 > myStrHexToUint64(string dataString)
Converts a string of 16 HEX characters into an UINT64.
bool readTbParamFromFile(const string paramName, const string datFile, unsigned int ¶mVal)
Retrieve a testbench parameter from a DAT file.
bool feedAxisFromFile(stream< AXIS_T > &ss, const string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
Initialize an Axi4-Stream (Axis) from a DAT file.
bool drainAxisToFile(stream< AXIS_T > &ss, const string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
Empty an Axi4-Stream (Axis) to a DAT file.
string myUint64ToStrHex(ap_uint< 64 > inputNumber)
Converts an UINT64 into a string of 16 HEX characters.
bool writeSocketPairToFile(SocketPair &socketPair, ofstream &outFileStream)
Dump a SocketPair to a file.
int myDiffTwoFiles(string dataFileName, string goldFileName)
Compares 2 files line-by-line, up to length of the 2nd file.
int writeAxisAppToFile(AxisApp &axisApp, ofstream &outFile)
Dump a TCP or UDP application data chunk into a file. The data are stored as a stream of bytes which ...
ap_uint< 8 > myStrHexToUint8(string keepString)
Converts a string of 2 HEX characters into an UINT8.
bool readAxisRawFromFile(AxisRaw &axisRaw, ifstream &inpFileStream)
Retrieve an Axis raw data chunk from a file.
bool isHexString(string str)
Checks if a string contains a hexadecimal number.
bool feedAxisRawStreamFromFile(stream< AxisRaw > &ss, const string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
ap_uint< 32 > myDottedDecimalIpToUint32(string ipStr)
Converts an IPv4 address represented with a dotted-decimal string into an UINT32.
bool readFpgaSndPortFromLine(Ly4Port &port, string stringBuffer)
Retrieve an FPGA send port from a string.