57 #include "../../toe_utils.hpp"
69 #define THIS_NAME "TOE/AKd"
71 #define TRACE_OFF 0x0000
72 #define TRACE_AKD 1 << 1
73 #define TRACE_ALL 0xFFFF
75 #define DEBUG_LEVEL (TRACE_OFF)
96 stream<ExtendedEvent> &siEVe_Event,
97 stream<SigBit> &soEVe_RxEventSig,
98 stream<SigBit> &soEVe_TxEventSig,
99 stream<ExtendedEvent> &soTXe_Event)
102 #pragma HLS PIPELINE II=1 enable_flush
107 static AckEntry ACK_TABLE[TOE_MAX_SESSIONS];
108 #pragma HLS RESOURCE variable=ACK_TABLE core=RAM_T2P_BRAM
109 #pragma HLS DEPENDENCE variable=ACK_TABLE inter false
115 #pragma HLS RESET variable=akd_Ptr
120 if (!siEVe_Event.empty()) {
123 siEVe_Event.read(ev);
125 soEVe_RxEventSig.write(1);
229 printInfo(myName,
"S%d - Received \'%s\' - Setting ACK_TABLE[%d]={D=%4.4d,C=%2.2d}\n",
241 soTXe_Event.write(ev);
244 soEVe_TxEventSig.write(1);
247 printInfo(myName,
"S%d - Received '%s' - Clearing ACK_TABLE[%d]={D=%4.4d,C=%2.2d}\n",
256 if (ACK_TABLE[akd_Ptr].
delay > 0 and !soTXe_Event.full()) {
257 if (ACK_TABLE[akd_Ptr].
delay == 1) {
261 soEVe_TxEventSig.write(1);
266 printInfo(myName,
"S%d - It's ACK Time (count=%d) - Requesting [TXe] to generate an new ACK\n",
267 akd_Ptr.to_int(), ACK_TABLE[akd_Ptr].
count.to_uint());
270 ACK_TABLE[akd_Ptr].
delay -= 1;
273 if (akd_Ptr == TOE_MAX_SESSIONS) {
281 stream<ExtendedEvent> &siEVe_Event,
282 stream<SigBit> &soEVe_RxEventSig,
283 stream<SigBit> &soEVe_TxEventSig,
284 stream<ExtendedEvent> &soTXe_Event)
287 #pragma HLS PIPELINE II=1 enable_flush
296 static ap_uint<12> ACK_TABLE[TOE_MAX_SESSIONS];
297 #pragma HLS RESOURCE variable=ACK_TABLE core=RAM_T2P_BRAM
298 #pragma HLS DEPENDENCE variable=ACK_TABLE inter false
299 #pragma HLS RESET variable=ACK_TABLE
305 #pragma HLS RESET variable=akd_Ptr
310 if (!siEVe_Event.empty()) {
313 siEVe_Event.read(ev);
315 soEVe_RxEventSig.write(1);
322 printInfo(myName,
"S%d - Received \'%s\' - Setting ACK_TABLE[%d]=%d\n",
328 printInfo(myName,
"S%d - Received \'%s\' - Current ACK_TABLE[%d]=%d\n",
338 soTXe_Event.write(ev);
341 soEVe_TxEventSig.write(1);
344 printInfo(myName,
"S%d - Received '%s' - Clearing ACK_TABLE[%d]=%d\n",
350 if (ACK_TABLE[akd_Ptr] > 0 and !soTXe_Event.full()) {
351 if (ACK_TABLE[akd_Ptr] == 1) {
355 soEVe_TxEventSig.write(1);
357 printInfo(myName,
"S%d - It's ACK Time - Requesting [TXe] to generate an new ACK\n",
361 ACK_TABLE[akd_Ptr] -= 1;
364 if (akd_Ptr == TOE_MAX_SESSIONS) {
: ACK Delayer (AKd) of the TCP Offload Engine (TOE)
void delay(unsigned int mseconds)
const int cDepth_AKdToTXe_Event
void ack_delay(stream< ExtendedEvent > &siEVe_Event, stream< SigBit > &soEVe_RxEventSig, stream< SigBit > &soEVe_TxEventSig, stream< ExtendedEvent > &soTXe_Event)
ACK Delayer (AKd)
void ack_delay_OBSO(stream< ExtendedEvent > &siEVe_Event, stream< SigBit > &soEVe_RxEventSig, stream< SigBit > &soEVe_TxEventSig, stream< ExtendedEvent > &soTXe_Event)
const char * getEventName(EventType evType)
Returns the name of an enum-based event as a user friendly string.
const int cDepth_AKdToEVe_Event
#define assessSize(callerName, stream, streamName, depth)
A macro that checks if a stream is full.
#define printInfo(callerName, format,...)
A macro to print an information message.