cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
AxisRaw Class Reference

#include <AxisRaw.hpp>

Inheritance diagram for AxisRaw:
[legend]

Public Member Functions

 AxisRaw ()
 
 AxisRaw (LE_tData tdata, LE_tKeep tkeep, LE_tLast tlast)
 
tData getTData (int leHi=64 -1, int leLo=0) const
 
tKeep getTKeep (int leHi=64/8-1, int leLo=0) const
 
tLast getTLast () const
 
void setTData (tData data)
 
void setTKeep (tKeep keep)
 
void setTLast (tLast last)
 
LE_tData getLE_TData (int leHi=64 -1, int leLo=0) const
 
LE_tKeep getLE_TKeep (int leHi=64/8-1, int leLo=0) const
 
LE_tLast getLE_TLast () const
 
void setLE_TData (LE_tData data, int leHi=64 -1, int leLo=0)
 
void setLE_TKeep (LE_tKeep keep, int leHi=64/8-1, int leLo=0)
 
void setLE_TLast (LE_tLast last)
 
tDataHalf getTDataHi () const
 
tDataHalf getTDataLo () const
 
tKeepHalf getTKeepHi () const
 
tKeepHalf getTKeepLo () const
 
void setTDataHi (tDataHalf halfData)
 
void setTDataLo (tDataHalf halfData)
 
void setTKeepHi (tKeepHalf halfKeep)
 
void setTKeepLo (tKeepHalf halfKeep)
 
LE_tDataHalf getLE_TDataHi () const
 
LE_tDataHalf getLE_TDataLo () const
 
void setLE_TDataHi (LE_tData data)
 
void setLE_TDataLo (LE_tData data)
 
void clearUnusedBytes ()
 
int getLen () const
 
int getLenHi ()
 
int getLenLo ()
 
bool isValid () const
 

Protected Member Functions

int keepToLen () const
 

Protected Attributes

LE_tData tdata
 
LE_tKeep tkeep
 
LE_tLast tlast
 

Detailed Description

AXIS_RAW - RAW AXIS-4 STREAMING INTERFACE An AxisRaw is logically divided into 'ARW/8' bytes. The validity of a given byte is qualified by the 'tkeep' field, while the assertion of the 'tlast' bit indicates the end of a stream.

@Warning: Members of this class are kept public for compatibility issues with the legacy code.

Definition at line 170 of file AxisRaw.hpp.

Constructor & Destructor Documentation

◆ AxisRaw() [1/2]

AxisRaw::AxisRaw ( )
inline

Definition at line 178 of file AxisRaw.hpp.

178 {}

◆ AxisRaw() [2/2]

AxisRaw::AxisRaw ( LE_tData  tdata,
LE_tKeep  tkeep,
LE_tLast  tlast 
)
inline

Definition at line 179 of file AxisRaw.hpp.

179  :
180  tdata(tdata), tkeep(tkeep), tlast(tlast) {}
LE_tData tdata
Definition: AxisRaw.hpp:173
LE_tKeep tkeep
Definition: AxisRaw.hpp:174
LE_tLast tlast
Definition: AxisRaw.hpp:175

Member Function Documentation

◆ clearUnusedBytes()

void AxisRaw::clearUnusedBytes ( )
inline

MORE HELPER METHODS

Definition at line 391 of file AxisRaw.hpp.

391  {
392  //for (int i=0, leHi=ARW/8-1, leLo=0; i<ARW/8; i++) { // ARW/8 = noBytes
393  // #pragma HLS UNROLL factor=8
394  // if (tkeep[i] == 0) {
395  // tdata.range(leHi+8*i, leLo+8*i) = 0x00;
396  // }
397  int leHi=ARW/8-1;
398  int leLo=0;
399  switch(this->tkeep){
400  case 0x00: tdata.range(leHi+8*0, leLo+8*0) = 0x00; // No break here
401  case 0x01: tdata.range(leHi+8*1, leLo+8*1) = 0x00; // No break here
402  case 0x03: tdata.range(leHi+8*2, leLo+8*2) = 0x00; // No break here
403  case 0x07: tdata.range(leHi+8*3, leLo+8*3) = 0x00; // No break here
404  case 0x0F: tdata.range(leHi+8*4, leLo+8*4) = 0x00; // No break here
405  case 0x1F: tdata.range(leHi+8*5, leLo+8*5) = 0x00; // No break here
406  case 0x3F: tdata.range(leHi+8*6, leLo+8*6) = 0x00; // No break here
407  case 0x7F: tdata.range(leHi+8*7, leLo+8*7) = 0x00; // No break here
408  }
409  }
#define ARW
Definition: AxisRaw.hpp:114
Here is the caller graph for this function:

◆ getLE_TData()

LE_tData AxisRaw::getLE_TData ( int  leHi = 64 -1,
int  leLo = 0 
) const
inline

LITTLE-ENDIAN SETTERS AND GETTERS

Definition at line 260 of file AxisRaw.hpp.

260  {
261  return tdata.range(leHi, leLo);
262  }
Here is the caller graph for this function:

◆ getLE_TDataHi()

LE_tDataHalf AxisRaw::getLE_TDataHi ( ) const
inline

LITTLE-ENDIAN HELPERS

Definition at line 370 of file AxisRaw.hpp.

370  {
371  return getLE_TData().range(31, 0); // [TODO]
372  }
LE_tData getLE_TData(int leHi=64 -1, int leLo=0) const
Definition: AxisRaw.hpp:260
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLE_TDataLo()

LE_tDataHalf AxisRaw::getLE_TDataLo ( ) const
inline

Definition at line 374 of file AxisRaw.hpp.

374  {
375  return getLE_TData().range(63, 32); // [TODO]
376  }
Here is the call graph for this function:

◆ getLE_TKeep()

LE_tKeep AxisRaw::getLE_TKeep ( int  leHi = 64 /8-1,
int  leLo = 0 
) const
inline

Definition at line 264 of file AxisRaw.hpp.

264  {
265  return tkeep.range(leHi, leLo);
266  }
Here is the caller graph for this function:

◆ getLE_TLast()

LE_tLast AxisRaw::getLE_TLast ( ) const
inline

Definition at line 268 of file AxisRaw.hpp.

268  {
269  return tlast;
270  }
Here is the caller graph for this function:

◆ getLen()

int AxisRaw::getLen ( ) const
inline

Definition at line 411 of file AxisRaw.hpp.

411  {
412  return keepToLen();
413  }
int keepToLen() const
Definition: AxisRaw.hpp:451
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLenHi()

int AxisRaw::getLenHi ( )
inline

Definition at line 415 of file AxisRaw.hpp.

415  {
416  if (keepToLen() > ARW/8/2) {
417  return (ARW/8/2);
418  }
419  else {
420  return keepToLen();
421  }
422  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLenLo()

int AxisRaw::getLenLo ( )
inline

Definition at line 424 of file AxisRaw.hpp.

424  {
425  if (keepToLen() > ARW/8/2) {
426  return (keepToLen()-ARW/8/2);
427  }
428  else {
429  return 0;
430  }
431  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTData()

tData AxisRaw::getTData ( int  leHi = 64 -1,
int  leLo = 0 
) const
inline

BIG-ENDIAN SETTERS AND GETTERS

Definition at line 191 of file AxisRaw.hpp.

191  {
192  switch (leHi-leLo) {
193  case 64-1 : return byteSwap64(tdata.range(leHi, leLo)); break;
194  case 32-1 : return byteSwap32(tdata.range(leHi, leLo)); break;
195  case 16-1 : return byteSwap16(tdata.range(leHi, leLo)); break;
196  case 8-1 : return (tdata.range(leHi, leLo)); break;
197  default : break;
198  }
199  std::cout << "ASSERT - AxisRaw::getTData() - Unsupported range.\n"; assert(false);
200  return tdata;
201  }
Here is the caller graph for this function:

◆ getTDataHi()

tDataHalf AxisRaw::getTDataHi ( ) const
inline

BIG-ENDIAN HELPERS

Definition at line 293 of file AxisRaw.hpp.

293  {
294  return getTData(ARW/2-1, 0);
295  }
tData getTData(int leHi=64 -1, int leLo=0) const
Definition: AxisRaw.hpp:191
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTDataLo()

tDataHalf AxisRaw::getTDataLo ( ) const
inline

Definition at line 301 of file AxisRaw.hpp.

301  {
302  return getTData(ARW-1, ARW/2);
303  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTKeep()

tKeep AxisRaw::getTKeep ( int  leHi = 64 /8-1,
int  leLo = 0 
) const
inline

Definition at line 207 of file AxisRaw.hpp.

207  {
208  switch (leHi-leLo) {
209  case 8-1 : return bitSwap8(tkeep.range(leHi, leLo)); break;
210  case 4-1 : return bitSwap4(tkeep.range(leHi, leLo)); break;
211  case 2-1 : return bitSwap2(tkeep.range(leHi, leLo)); break;
212  case 1-1 : return (tkeep[leLo]); break;
213  default : break;
214  }
215  std::cout << "ASSERT - AxisRaw::getTKeep() - Unsupported range.\n"; assert(false);
216  return tkeep;
217  }
Here is the caller graph for this function:

◆ getTKeepHi()

tKeepHalf AxisRaw::getTKeepHi ( ) const
inline

Definition at line 309 of file AxisRaw.hpp.

309  {
310  return getTKeep(ARW/8/2-1, 0);
311  }
tKeep getTKeep(int leHi=64/8-1, int leLo=0) const
Definition: AxisRaw.hpp:207
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTKeepLo()

tKeepHalf AxisRaw::getTKeepLo ( ) const
inline

Definition at line 317 of file AxisRaw.hpp.

317  {
318  return getTKeep(ARW/8-1, ARW/8/2);
319  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTLast()

tLast AxisRaw::getTLast ( ) const
inline

Definition at line 219 of file AxisRaw.hpp.

219  {
220  return tlast;
221  }
Here is the caller graph for this function:

◆ isValid()

bool AxisRaw::isValid ( ) const
inline

Definition at line 434 of file AxisRaw.hpp.

434  {
435  if (((tlast == 0) and (tkeep != 0xFF)) or
436  ((tlast == 1) and (keepToLen() == 0))) {
437  return false;
438  }
439  return true;
440  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ keepToLen()

int AxisRaw::keepToLen ( ) const
inlineprotected

Definition at line 451 of file AxisRaw.hpp.

451  {
452  switch(this->tkeep){
453  case 0x01: return 1; break;
454  case 0x03: return 2; break;
455  case 0x07: return 3; break;
456  case 0x0F: return 4; break;
457  case 0x1F: return 5; break;
458  case 0x3F: return 6; break;
459  case 0x7F: return 7; break;
460  case 0xFF: return 8; break;
461  }
462  return 0;
463  }
Here is the caller graph for this function:

◆ setLE_TData()

void AxisRaw::setLE_TData ( LE_tData  data,
int  leHi = 64 -1,
int  leLo = 0 
)
inline

Definition at line 272 of file AxisRaw.hpp.

272  {
273  tdata.range(leHi, leLo) = data.range(leHi-leLo, 0);
274  }
ap_uint< 64 > data
Definition: tb_nal.cpp:832
Here is the caller graph for this function:

◆ setLE_TDataHi()

void AxisRaw::setLE_TDataHi ( LE_tData  data)
inline

Definition at line 379 of file AxisRaw.hpp.

379  {
380  tdata.range(31, 0) = data.range(31, 0); // [TODO]
381  }

◆ setLE_TDataLo()

void AxisRaw::setLE_TDataLo ( LE_tData  data)
inline

Definition at line 383 of file AxisRaw.hpp.

383  {
384  tdata.range(63, 32) = data.range(63, 32); // [TODO]
385  }

◆ setLE_TKeep()

void AxisRaw::setLE_TKeep ( LE_tKeep  keep,
int  leHi = 64 /8-1,
int  leLo = 0 
)
inline

Definition at line 276 of file AxisRaw.hpp.

276  {
277  tkeep.range(leHi, leLo) = keep;
278  }
Here is the caller graph for this function:

◆ setLE_TLast()

void AxisRaw::setLE_TLast ( LE_tLast  last)
inline

Definition at line 280 of file AxisRaw.hpp.

280  {
281  tlast = last;
282  }
Here is the caller graph for this function:

◆ setTData()

void AxisRaw::setTData ( tData  data)
inline

Definition at line 228 of file AxisRaw.hpp.

228  {
229  switch (ARW) {
230  case 64 : tdata = byteSwap64(data); break;
231  default : std::cout << "ASSERT - AxisRaw::setTData() - Unsupported Axis raw width.\n"; break;
232  }
233  }
Here is the caller graph for this function:

◆ setTDataHi()

void AxisRaw::setTDataHi ( tDataHalf  halfData)
inline

Definition at line 326 of file AxisRaw.hpp.

326  {
327  switch (ARW) {
328  case 64 : tdata.range(ARW/2-1, 0) = byteSwap32(halfData); break;
329  default : std::cout << "ASSERT - AxisRaw::setTDataHi() - Unsupported Axis raw width.\n"; break;
330  }
331  }
Here is the caller graph for this function:

◆ setTDataLo()

void AxisRaw::setTDataLo ( tDataHalf  halfData)
inline

Definition at line 337 of file AxisRaw.hpp.

337  {
338  switch (ARW) {
339  case 64 : tdata.range(ARW-1, ARW/2) = byteSwap32(halfData); break;
340  default : std::cout << "ASSERT - AxisRaw::setTDataLo() - Unsupported Axis raw width.\n"; break;
341  }
342  }
Here is the caller graph for this function:

◆ setTKeep()

void AxisRaw::setTKeep ( tKeep  keep)
inline

Definition at line 239 of file AxisRaw.hpp.

239  {
240  switch (ARW) {
241  case 64 : tkeep = bitSwap8(keep); break;
242  default : std::cout << "ASSERT - AxisRaw::setTKeep() - Unsupported Axis raw width.\n"; break;
243  }
244  }
Here is the caller graph for this function:

◆ setTKeepHi()

void AxisRaw::setTKeepHi ( tKeepHalf  halfKeep)
inline

Definition at line 348 of file AxisRaw.hpp.

348  {
349  switch (ARW) {
350  case 64 : tkeep(ARW/8/2-1, 0) = bitSwap4(halfKeep); break;
351  default : std::cout << "ASSERT - AxisRaw::setTKeepHi() - Unsupported Axis raw width.\n"; break;
352  }
353  }
Here is the caller graph for this function:

◆ setTKeepLo()

void AxisRaw::setTKeepLo ( tKeepHalf  halfKeep)
inline

Definition at line 359 of file AxisRaw.hpp.

359  {
360  switch (ARW) {
361  case 64 : tkeep(ARW/8-1, ARW/8/2) = bitSwap4(halfKeep); break;
362  default : std::cout << "ASSERT - AxisRaw::setTKeepLo() - Unsupported Axis raw width.\n"; break;
363  }
364  }
Here is the caller graph for this function:

◆ setTLast()

void AxisRaw::setTLast ( tLast  last)
inline

Definition at line 246 of file AxisRaw.hpp.

246  {
247  tlast = last;
248  if (last) { // [FIXME-Remove and create a 'setTLastAndClear()]
249  // Always zero the bytes which have their tkeep-bit cleared.
250  // This simplifies the computation of the various checksums and
251  // unifies the overall AxisRaw processing and verification.
253  }
254  }
void clearUnusedBytes()
Definition: AxisRaw.hpp:391
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ tdata

LE_tData AxisRaw::tdata
protected

Definition at line 173 of file AxisRaw.hpp.

◆ tkeep

LE_tKeep AxisRaw::tkeep
protected

Definition at line 174 of file AxisRaw.hpp.

◆ tlast

LE_tLast AxisRaw::tlast
protected

Definition at line 175 of file AxisRaw.hpp.


The documentation for this class was generated from the following file: