30 #ifndef _SIM_APP_DATA_
31 #define _SIM_APP_DATA_
57 std::deque<AxisApp> appQ;
61 void setLen(
int appLen) {
75 return this->appQ.front();
79 return this->appQ.front();
83 this->appQ.pop_back();
87 this->appQ.pop_front();
90 void push_back(
AxisApp appChunk) {
91 this->appQ.push_back(appChunk);
98 this->myName =
"SimAppData";
100 if (datLen > 0 and datLen <= 65536) {
101 int noBytes = datLen;
103 pushChunk(
AxisApp(0x0000000000000000, 0xFF, 0));
110 this->myName =
"SimAppData";
116 if (this->
size() > 0) {
118 this->appQ[this->
size()-1].setLE_TLast(0);
120 this->push_back(appChunk);
121 this->setLen(this->getLen() + appChunk.
getLen());
126 AxisApp headingChunk = this->front();
128 setLen(getLen() - headingChunk.
getLen());
139 return this->appQ.size();
148 for (
int i=0; i<appDat.appQ.size(); i++) {
149 newAxisApp = appDat.appQ[i];
150 this->appQ.push_back(newAxisApp);
152 this->setLen(appDat.getLen());
160 for (
int q=0; q < this->
size(); q++) {
161 AxisApp axisData = this->appQ[q];
162 for (
int b=7; b >= 0; b--) {
164 int hi = ((b*8) + 7);
165 int lo = ((b*8) + 0);
166 ap_uint<8> octet = axisData.
getTData().range(hi, lo);
171 bool endOfDat =
false;
178 for (
int c=0; c < 16*2; c+=2) {
179 if (i < datStr.length()) {
180 hexaStr += datStr.substr(i, 2);
181 char ch = std::strtoul(datStr.substr(i, 2).c_str(), &ptr, 16);
195 printf(
"%4.4X %s %s \n", offset, hexaStr.c_str(), asciiStr.c_str());
197 }
while (not endOfDat);
207 if (!outFileStream.is_open()) {
212 outFileStream << hex << noshowbase << setfill(
'0') << setw(16) << axisApp.
getLE_TData().to_uint64();
213 outFileStream <<
" ";
214 outFileStream << setw(1) << axisApp.
getLE_TLast().to_int();
215 outFileStream <<
" ";
216 outFileStream << hex << noshowbase << setfill(
'0') << setw(2) << axisApp.
getLE_TKeep().to_int() <<
"\n";
218 outFileStream <<
"\n";
229 for (
int i=0; i < this->
size(); i++) {
230 AxisApp axisApp = this->appQ[i];
: Utilities for the simulation of the Network-Transport-Stack (NTS) components.
tData getTData(int leHi=64 -1, int leLo=0) const
LE_tKeep getLE_TKeep(int leHi=64/8-1, int leLo=0) const
LE_tData getLE_TData(int leHi=64 -1, int leLo=0) const
tKeep getTKeep(int leHi=64/8-1, int leLo=0) const
LE_tLast getLE_TLast() const
void pushChunk(AxisApp appChunk)
void clone(SimAppData &appDat)
Clone an APP data.
bool writeToDatFile(ofstream &outFileStream)
Dump this APP data as raw of AxisApp chunks into a file.
void dump()
Dump this APP data as HEX and ASCII characters to screen.
bool writeAxisAppToFile(AxisApp &axisApp, ofstream &outFileStream)
Dump an AxisApp chunk to a file.
string myUint8ToStrHex(ap_uint< 8 > inputNumber)
Converts an UINT8 into a string of 2 HEX characters.
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 ...
#define printError(callerName, format,...)
A macro to print an error message.
LE_tKeep lenToLE_tKeep(ap_uint< 4 > noValidBytes)
A function to set a number of '1' in an 8-bit field. It is used here to set the number of valid bytes...
void uppercase(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NetworkWord > &siSHL_This_Data, stream< NetworkWord > &soTHIS_Shl_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &soNrc_meta, ap_uint< 32 > *po_rx_ports)
Main process of the Uppercase Application directives.
: Utilities and helpers for the Network-Transport-Stack (NTS) components.