cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
udp_shell_if.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2016 -- 2021 IBM Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
30 #ifndef _USIF_H_
31 #define _USIF_H_
32 
33 #include <hls_stream.h>
34 #include "ap_int.h"
35 
36 #include "../../../../cFDK/SRA/LIB/SHELL/LIB/hls/NTS/nts.hpp"
37 #include "../../../../cFDK/SRA/LIB/SHELL/LIB/hls/NTS/nts_utils.hpp"
38 
39 //-------------------------------------------------------------------
40 //-- DEFAULT LISTENING PORTS
41 //-- By default, the following port numbers will be used by the
42 //-- UdpShellInterface (unless user specifies new ones via TBD).
43 //-- Default listen ports:
44 //-- --> 5001 : Traffic received on this port is [TODO-TBD].
45 //-- It is used to emulate IPERF V2.
46 //-- --> 5201 : Traffic received on this port is [TODO-TBD].
47 //-- It is used to emulate IPREF V3.
48 //-- --> 8800 : Traffic received on this port is systematically
49 //-- dumped. It is used to test the Rx part of UOE.
50 //-- --> 8801 : A message received on this port triggers the
51 //-- transmission of 'nr' bytes from the FPGA to the host.
52 //-- It is used to test the Tx part of UOE.
53 //-- --> 8802 : Traffic received on this port is forwarded to the UDP
54 //-- test application which will loop and echo it back to
55 //-- the sender in store-and-forward mode.
56 //-- --> 8803 : Traffic received on this port is forwarded to the UDP
57 //-- test application which will loop and echo it back to
58 //-- the sender in path-through mode.
59 //-------------------------------------------------------------------
60 #define RECV_MODE_LSN_PORT 8800 // 0x2260
61 #define XMIT_MODE_LSN_PORT 8801 // 0x2261
62 #define ECHO_MOD2_LSN_PORT 8802 // 0x2262
63 #define ECHO_MODE_LSN_PORT 8803 // 0x2263
64 #define IPERF_LSN_PORT 5001 // 0x1389
65 #define IPREF3_LSN_PORT 5201 // 0x1451
66 
67 //-------------------------------------------------------------------
68 //-- DEFAULT XMIT STRING
69 //-- By default, the string 'Hi from FMKU60\n' is sent out as two
70 //-- alternating chunks during the transmission test, which turns
71 //-- into the two following chunks:
72 //-------------------------------------------------------------------
73 #define GEN_CHK0 0x48692066726f6d20 // 'Hi from '
74 #define GEN_CHK1 0x464d4b553630210a // 'FMKU60\n'
75 
76 
77 
82 void udp_shell_if(
83 
84  //------------------------------------------------------
85  //-- SHELL / Mmio Interface
86  //------------------------------------------------------
87  CmdBit *piSHL_Mmio_En,
88 
89  //------------------------------------------------------
90  //-- SHELL / Control Port Interfaces
91  //------------------------------------------------------
92  stream<UdpAppLsnReq> &soSHL_LsnReq,
93  stream<UdpAppLsnRep> &siSHL_LsnRep,
94  stream<UdpAppClsReq> &soSHL_ClsReq,
95  stream<UdpAppClsRep> &siSHL_ClsRep,
96 
97  //------------------------------------------------------
98  //-- SHELL / Rx Data Interfaces
99  //------------------------------------------------------
100  stream<UdpAppData> &siSHL_Data,
101  stream<UdpAppMeta> &siSHL_Meta,
102  stream<UdpAppDLen> &siSHL_DLen,
103 
104  //------------------------------------------------------
105  //-- SHELL / Tx Data Interfaces
106  //------------------------------------------------------
107  stream<UdpAppData> &soSHL_Data,
108  stream<UdpAppMeta> &soSHL_Meta,
109  stream<UdpAppDLen> &soSHL_DLen,
110 
111  //------------------------------------------------------
112  //-- UAF / Tx Data Interfaces
113  //------------------------------------------------------
114  stream<UdpAppData> &siUAF_Data,
115  stream<UdpAppMeta> &siUAF_Meta,
116  stream<UdpAppDLen> &siUAF_DLen,
117 
118  //------------------------------------------------------
119  //-- UAF / Rx Data Interfaces
120  //------------------------------------------------------
121  stream<UdpAppData> &soUAF_Data,
122  stream<UdpAppMeta> &soUAF_Meta,
123  stream<UdpAppDLen> &soUAF_DLen
124 
125 );
126 
127 #endif
128 
ap_uint< 1 > CmdBit
Definition: nts_types.hpp:108
void udp_shell_if(CmdBit *piSHL_Mmio_En, stream< UdpPort > &soSHL_LsnReq, stream< StsBool > &siSHL_LsnRep, stream< UdpPort > &soSHL_ClsReq, stream< StsBool > &siSHL_ClsRep, stream< UdpAppData > &siSHL_Data, stream< UdpAppMeta > &siSHL_Meta, stream< UdpAppDLen > &siSHL_DLen, stream< UdpAppData > &soSHL_Data, stream< UdpAppMeta > &soSHL_Meta, stream< UdpAppDLen > &soSHL_DLen, stream< UdpAppData > &siUAF_Data, stream< UdpAppMeta > &siUAF_Meta, stream< UdpAppDLen > &siUAF_DLen, stream< UdpAppData > &soUAF_Data, stream< UdpAppMeta > &soUAF_Meta, stream< UdpAppDLen > &soUAF_DLen)
Main process of the UDP Shell Interface (USIF).