cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
uoe.hpp
Go to the documentation of this file.
1 
17 
43 
56 #ifndef _UOE_H_
57 #define _UOE_H_
58 
59 #include "../../../NTS/nts.hpp"
60 #include "../../../NTS/nts_utils.hpp"
61 #include "../../../NTS/SimNtsUtils.hpp"
62 #include "../../AxisIp4.hpp"
63 #include "../../AxisPsd4.hpp"
64 
65 
66 
70 //-- The Maximum Datagram Size (MDS) that can be received or sent by UOE
71 //-- FYI: MDS is rounded modulo 8 bytes to match the chunk size.
72 static const Ly4Len UDP_MDS = (MTU_ZYC2-IP4_HEADER_LEN-UDP_HEADER_LEN) & ~0x7; // 1416
73 
74 //-------------------------------------------------------------------
75 //-- DEFINES FOR THE UOE INTERNAL STREAMS (can be changed)
76 //-------------------------------------------------------------------
77 #define UOE_ELASTIC_DATA_BUFFER 16*1024 // In Bytes
78 #define UOE_ELASTIC_HEADER_BUFF 64 // In Headers
79 
80 //-------------------------------------------------------------------
81 //-- DERIVED CONSTANTS FOR THE UOE INTERNAl STREAMS (don't touch)
82 //-------------------------------------------------------------------
83 const int cUdpRxDataFifoSize = (UOE_ELASTIC_DATA_BUFFER)/(ARW/8); // Size of UDP Rx data buffer (in chunks)
84 const int cUdpRxHdrsFifoSize = (UOE_ELASTIC_HEADER_BUFF); // Size of the UDP Rx header buffer (in UDP headers)
85 const int cIp4RxHdrsFifoSize = (cUdpRxHdrsFifoSize * 4); // Size of the IP4 Rx header buffer (1-header=4-entries in the FiFo)
86 const int cMtuSize = (2*MTU)/(ARW/8); // Minimum size to store one MTU
87 
88 
92 //---------------------------------------------------------
93 //-- UOE - IPv4 ADDRESS PAIR
94 //---------------------------------------------------------
95 class IpAddrPair {
96  public:
101  ipSa(ipSa), ipDa(ipDa) {}
102 };
103 
104 
105 
110 #if HLS_VERSION == 2017
111 
112  void uoe_top(
113 
114  //------------------------------------------------------
115  //-- MMIO Interface
116  //------------------------------------------------------
117  CmdBit piMMIO_En,
118  stream<ap_uint<16> > &soMMIO_DropCnt,
119  stream<StsBool> &soMMIO_Ready,
120 
121  //------------------------------------------------------
122  //-- IPRX / IP Rx / Data Interface
123  //------------------------------------------------------
124  stream<AxisIp4> &siIPRX_Data,
125 
126  //------------------------------------------------------
127  //-- IPTX / IP Tx / Data Interface
128  //------------------------------------------------------
129  stream<AxisIp4> &soIPTX_Data,
130 
131  //------------------------------------------------------
132  //-- UAIF / Control Port Interfaces
133  //------------------------------------------------------
134  stream<UdpAppLsnReq> &siUAIF_LsnReq,
135  stream<UdpAppLsnRep> &soUAIF_LsnRep,
136  stream<UdpAppClsReq> &siUAIF_ClsReq,
137  stream<UdpAppClsRep> &soUAIF_ClsRep,
138 
139  //------------------------------------------------------
140  //-- UAIF / Rx Data Interfaces
141  //------------------------------------------------------
142  stream<UdpAppData> &soUAIF_Data,
143  stream<UdpAppMeta> &soUAIF_Meta,
144  stream<UdpAppDLen> &soUAIF_DLen,
145 
146  //------------------------------------------------------
147  //-- UAIF / Tx Data Interfaces
148  //------------------------------------------------------
149  stream<UdpAppData> &siUAIF_Data,
150  stream<UdpAppMeta> &siUAIF_Meta,
151  stream<UdpAppDLen> &siUAIF_DLen,
152 
153  //------------------------------------------------------
154  //-- ICMP / Message Data Interface (Port Unreachable)
155  //------------------------------------------------------
156  stream<AxisIcmp> &soICMP_Data
157  );
158 #else
159 
160  void uoe_top(
161  //------------------------------------------------------
162  //-- MMIO Interface
163  //------------------------------------------------------
164  CmdBit piMMIO_En,
165  stream<ap_uint<16> > &soMMIO_DropCnt,
166  stream<StsBool> &soMMIO_Ready,
167 
168  //------------------------------------------------------
169  //-- IPRX / IP Rx / Data Interface
170  //------------------------------------------------------
171  stream<AxisRaw> &siIPRX_Data,
172 
173  //------------------------------------------------------
174  //-- IPTX / IP Tx / Data Interface
175  //------------------------------------------------------
176  stream<AxisRaw> &soIPTX_Data,
177 
178  //------------------------------------------------------
179  //-- UAIF / Control Port Interfaces
180  //------------------------------------------------------
181  stream<UdpAppLsnReq> &siUAIF_LsnReq,
182  stream<UdpAppLsnRep> &soUAIF_LsnRep,
183  stream<UdpAppClsReq> &siUAIF_ClsReq,
184  stream<UdpAppClsRep> &soUAIF_ClsRep,
185 
186  //------------------------------------------------------
187  //-- UAIF / Rx Data Interfaces
188  //------------------------------------------------------
189  stream<UdpAppData> &soUAIF_Data,
190  stream<UdpAppMeta> &soUAIF_Meta,
191  stream<UdpAppDLen> &soUAIF_DLen,
192 
193  //------------------------------------------------------
194  //-- UAIF / Tx Data Interfaces
195  //------------------------------------------------------
196  stream<UdpAppData> &siUAIF_Data,
197  stream<UdpAppMeta> &siUAIF_Meta,
198  stream<UdpAppDLen> &siUAIF_DLen,
199 
200  //------------------------------------------------------
201  //-- ICMP / Message Data Interface (Port Unreachable)
202  //------------------------------------------------------
203  stream<AxisRaw> &soICMP_Data
204  );
205 
206 #endif // HLS_VERSION
207 
208 #endif
209 
IpAddrPair(Ip4Addr ipSa, Ip4Addr ipDa)
Definition: uoe.hpp:100
IpAddrPair()
Definition: uoe.hpp:99
Ip4Addr ipDa
Definition: uoe.hpp:98
Ip4Addr ipSa
Definition: uoe.hpp:97
#define UOE_ELASTIC_HEADER_BUFF
Definition: uoe.hpp:78
const int cMtuSize
Definition: uoe.hpp:86
void uoe_top(CmdBit piMMIO_En, stream< ap_uint< 16 > > &soMMIO_DropCnt, stream< StsBool > &soMMIO_Ready, stream< AxisRaw > &siIPRX_Data, stream< AxisRaw > &soIPTX_Data, stream< UdpAppLsnReq > &siUAIF_LsnReq, stream< UdpAppLsnRep > &soUAIF_LsnRep, stream< UdpAppClsReq > &siUAIF_ClsReq, stream< UdpAppClsRep > &soUAIF_ClsRep, stream< UdpAppData > &soUAIF_Data, stream< UdpAppMeta > &soUAIF_Meta, stream< UdpAppDLen > &soUAIF_DLen, stream< UdpAppData > &siUAIF_Data, stream< UdpAppMeta > &siUAIF_Meta, stream< UdpAppDLen > &siUAIF_DLen, stream< AxisRaw > &soICMP_Data)
Top of UDP Offload Engine (UOE)
Definition: uoe.cpp:2042
#define UOE_ELASTIC_DATA_BUFFER
Definition: uoe.hpp:77
const int cUdpRxHdrsFifoSize
Definition: uoe.hpp:84
const int cUdpRxDataFifoSize
Definition: uoe.hpp:83
const int cIp4RxHdrsFifoSize
Definition: uoe.hpp:85
#define ARW
Definition: AxisRaw.hpp:114
ap_uint< 16 > Ly4Len
Definition: nts_types.hpp:202
ap_uint< 32 > Ip4Addr
Definition: AxisIp4.hpp:169
#define IP4_HEADER_LEN
Definition: AxisIp4.hpp:133
ap_uint< 1 > CmdBit
Definition: nts_types.hpp:108
#define UDP_HEADER_LEN
Definition: AxisUdp.hpp:81
int MTU_ZYC2
Definition: tc_utils.py:39
#define MTU
Definition: udp.hpp:71