cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
tcp_shell_if_top.cpp
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 
37 #include "tcp_shell_if_top.hpp"
38 
39 using namespace hls;
40 using namespace std;
41 
42 
43 
65 #if HLS_VERSION == 2016
66  void tcp_shell_if_top(
67  //------------------------------------------------------
68  //-- SHELL / Mmio Interface
69  //------------------------------------------------------
70  CmdBit *piSHL_Mmio_En,
71  //------------------------------------------------------
72  //-- TAF / TxP Data Interface
73  //------------------------------------------------------
74  stream<TcpAppData> &siTAF_Data,
75  stream<TcpSessId> &siTAF_SessId,
76  stream<TcpDatLen> &siTAF_DatLen,
77  //------------------------------------------------------
78  //-- TAF / RxP Data Interface
79  //------------------------------------------------------
80  stream<TcpAppData> &soTAF_Data,
81  stream<TcpSessId> &soTAF_SessId,
82  stream<TcpDatLen> &soTAF_DatLen,
83  //------------------------------------------------------
84  //-- SHELL / Rx Data Interfaces
85  //------------------------------------------------------
86  stream<TcpAppNotif> &siSHL_Notif,
87  stream<TcpAppRdReq> &soSHL_DReq,
88  stream<TcpAppData> &siSHL_Data,
89  stream<TcpAppMeta> &siSHL_Meta,
90  //------------------------------------------------------
91  //-- SHELL / Listen Interfaces
92  //------------------------------------------------------
93  stream<TcpAppLsnReq> &soSHL_LsnReq,
94  stream<TcpAppLsnRep> &siSHL_LsnRep,
95  //------------------------------------------------------
96  //-- SHELL / Tx Data Interfaces
97  //------------------------------------------------------
98  stream<TcpAppData> &soSHL_Data,
99  stream<TcpAppSndReq> &soSHL_SndReq,
100  stream<TcpAppSndRep> &siSHL_SndRep,
101  //------------------------------------------------------
102  //-- SHELL / Tx Open Interfaces
103  //------------------------------------------------------
104  stream<TcpAppOpnReq> &soSHL_OpnReq,
105  stream<TcpAppOpnRep> &siSHL_OpnRep,
106  //------------------------------------------------------
107  //-- SHELL / Close Interfaces
108  //------------------------------------------------------
109  stream<TcpAppClsReq> &soSHL_ClsReq)
110 {
111 
112  //-- DIRECTIVES FOR THE INTERFACES -----------------------------------------
113  #pragma HLS INTERFACE ap_ctrl_none port=return
114 
115 
116 
117 
118 
119  #pragma HLS INTERFACE ap_stable register port=piSHL_Mmio_En name=piSHL_Mmio_En
120 
121  #pragma HLS resource core=AXI4Stream variable=siTAF_Data metadata="-bus_bundle siTAF_Data"
122  #pragma HLS resource core=AXI4Stream variable=siTAF_SessId metadata="-bus_bundle siTAF_SessId"
123  #pragma HLS resource core=AXI4Stream variable=siTAF_DatLen metadata="-bus_bundle siTAF_DatLen"
124 
125  #pragma HLS resource core=AXI4Stream variable=soTAF_Data metadata="-bus_bundle soTAF_Data"
126  #pragma HLS resource core=AXI4Stream variable=soTAF_SessId metadata="-bus_bundle soTAF_SessId"
127  #pragma HLS resource core=AXI4Stream variable=soTAF_DatLen metadata="-bus_bundle soTAF_DatLen"
128 
129  #pragma HLS resource core=AXI4Stream variable=siSHL_Notif metadata="-bus_bundle siSHL_Notif"
130  #pragma HLS DATA_PACK variable=siSHL_Notif
131  #pragma HLS resource core=AXI4Stream variable=soSHL_DReq metadata="-bus_bundle soSHL_DReq"
132  #pragma HLS DATA_PACK variable=soSHL_DReq
133  #pragma HLS resource core=AXI4Stream variable=siSHL_Data metadata="-bus_bundle siSHL_Data"
134  #pragma HLS resource core=AXI4Stream variable=siSHL_Meta metadata="-bus_bundle siSHL_Meta"
135 
136  #pragma HLS resource core=AXI4Stream variable=soSHL_LsnReq metadata="-bus_bundle soSHL_LsnReq"
137  #pragma HLS resource core=AXI4Stream variable=siSHL_LsnRep metadata="-bus_bundle siSHL_LsnRep"
138 
139  #pragma HLS resource core=AXI4Stream variable=soSHL_Data metadata="-bus_bundle soSHL_Data"
140  #pragma HLS resource core=AXI4Stream variable=soSHL_SndReq metadata="-bus_bundle soSHL_SndReq"
141  #pragma HLS DATA_PACK variable=soSHL_SndReq
142  #pragma HLS resource core=AXI4Stream variable=siSHL_SndRep metadata="-bus_bundle siSHL_SndRep"
143  #pragma HLS DATA_PACK variable=siSHL_SndRep
144 
145  #pragma HLS resource core=AXI4Stream variable=soSHL_OpnReq metadata="-bus_bundle soSHL_OpnReq"
146  #pragma HLS DATA_PACK variable=soSHL_OpnReq
147  #pragma HLS resource core=AXI4Stream variable=siSHL_OpnRep metadata="-bus_bundle siSHL_OpnRep"
148  #pragma HLS DATA_PACK variable=siSHL_OpnRep
149 
150  #pragma HLS resource core=AXI4Stream variable=soSHL_ClsReq metadata="-bus_bundle soSHL_ClsReq"
151 
152  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
153  #pragma HLS DATAFLOW
154 
155  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
156  tcp_shell_if(
157  //-- SHELL / Mmio Interface
158  piSHL_Mmio_En,
159  //-- TAF / Rx & Tx Data Interfaces
160  siTAF_Data,
161  siTAF_SessId,
162  siTAF_DatLen,
163  soTAF_Data,
164  soTAF_SessId,
165  soTAF_DatLen,
166  //-- TOE / Rx Data Interfaces
167  siSHL_Notif,
168  soSHL_DReq,
169  siSHL_Data,
170  siSHL_Meta,
171  //-- TOE / Listen Interfaces
172  soSHL_LsnReq,
173  siSHL_LsnRep,
174  //-- TOE / Tx Data Interfaces
175  soSHL_Data,
176  soSHL_SndReq,
177  siSHL_SndRep,
178  //-- TOE / Tx Open Interfaces
179  soSHL_OpnReq,
180  siSHL_OpnRep,
181  //-- TOE / Close Interfaces
182  soSHL_ClsReq);
183 
184 }
185 #else
187  //------------------------------------------------------
188  //-- SHELL / Mmio Interface
189  //------------------------------------------------------
190  CmdBit *piSHL_Mmio_En,
191  //------------------------------------------------------
192  //-- TAF / TxP Data Interface
193  //------------------------------------------------------
194  stream<TcpAppData> &siTAF_Data,
195  stream<TcpSessId> &siTAF_SessId,
196  stream<TcpDatLen> &siTAF_DatLen,
197  //------------------------------------------------------
198  //-- TAF / RxP Data Interface
199  //------------------------------------------------------
200  stream<TcpAppData> &soTAF_Data,
201  stream<TcpSessId> &soTAF_SessId,
202  stream<TcpDatLen> &soTAF_DatLen,
203  //------------------------------------------------------
204  //-- SHELL / Rx Data Interfaces
205  //------------------------------------------------------
206  stream<TcpAppNotif> &siSHL_Notif,
207  stream<TcpAppRdReq> &soSHL_DReq,
208  stream<TcpAppData> &siSHL_Data,
209  stream<TcpAppMeta> &siSHL_Meta,
210  //------------------------------------------------------
211  //-- SHELL / Listen Interfaces
212  //------------------------------------------------------
213  stream<TcpAppLsnReq> &soSHL_LsnReq,
214  stream<TcpAppLsnRep> &siSHL_LsnRep,
215  //------------------------------------------------------
216  //-- SHELL / Tx Data Interfaces
217  //------------------------------------------------------
218  stream<TcpAppData> &soSHL_Data,
219  stream<TcpAppSndReq> &soSHL_SndReq,
220  stream<TcpAppSndRep> &siSHL_SndRep,
221  //------------------------------------------------------
222  //-- SHELL / Tx Open Interfaces
223  //------------------------------------------------------
224  stream<TcpAppOpnReq> &soSHL_OpnReq,
225  stream<TcpAppOpnRep> &siSHL_OpnRep,
226  //------------------------------------------------------
227  //-- SHELL / Close Interfaces
228  //------------------------------------------------------
229  stream<TcpAppClsReq> &soSHL_ClsReq,
230  //------------------------------------------------------
231  //-- DEBUG Probes
232  //------------------------------------------------------
233  stream<ap_uint<32> > &soDBG_SinkCnt,
234  stream<ap_uint<16> > &soDBG_InpBufSpace)
235 {
236  //-- DIRECTIVES FOR THE INTERFACES -----------------------------------------
237  #pragma HLS INTERFACE ap_ctrl_none port=return
238 
239  #pragma HLS INTERFACE ap_stable register port=piSHL_Mmio_En name=piSHL_Mmio_En
240 
241  #pragma HLS INTERFACE axis off port=siTAF_Data name=siTAF_Data
242  #pragma HLS INTERFACE axis off port=siTAF_SessId name=siTAF_SessId
243  #pragma HLS INTERFACE axis off port=siTAF_DatLen name=siTAF_DatLen
244 
245  #pragma HLS INTERFACE axis off port=soTAF_Data name=soTAF_Data
246  #pragma HLS INTERFACE axis off port=soTAF_SessId name=soTAF_SessId
247  #pragma HLS INTERFACE axis off port=soTAF_DatLen name=soTAF_DatLen
248 
249  #pragma HLS INTERFACE axis off port=siSHL_Notif name=siSHL_Notif
250  #pragma HLS DATA_PACK variable=siSHL_Notif
251  #pragma HLS INTERFACE axis off port=soSHL_DReq name=soSHL_DReq
252  #pragma HLS DATA_PACK variable=soSHL_DReq
253  #pragma HLS INTERFACE axis off port=siSHL_Data name=siSHL_Data
254  #pragma HLS INTERFACE axis off port=siSHL_Meta name=siSHL_Meta
255 
256  #pragma HLS INTERFACE axis off port=soSHL_LsnReq name=soSHL_LsnReq
257  #pragma HLS INTERFACE axis off port=siSHL_LsnRep name=siSHL_LsnRep
258 
259  #pragma HLS INTERFACE axis off port=soSHL_Data name=soSHL_Data
260  #pragma HLS INTERFACE axis off port=soSHL_SndReq name=soSHL_SndReq
261  #pragma HLS DATA_PACK variable=soSHL_SndReq
262  #pragma HLS INTERFACE axis off port=siSHL_SndRep name=siSHL_SndRep
263  #pragma HLS DATA_PACK variable=siSHL_SndRep
264 
265  #pragma HLS INTERFACE axis off port=soSHL_OpnReq name=soSHL_OpnReq
266  #pragma HLS DATA_PACK variable=soSHL_OpnReq
267  #pragma HLS INTERFACE axis off port=siSHL_OpnRep name=siSHL_OpnRep
268  #pragma HLS DATA_PACK variable=siSHL_OpnRep
269 
270  #pragma HLS INTERFACE axis off port=soSHL_ClsReq name=soSHL_ClsReq
271 
272  #pragma HLS INTERFACE axis register both port=soDBG_SinkCnt name=soDBG_SinkCnt
273  #pragma HLS INTERFACE axis register both port=soDBG_InpBufSpace name=soDBG_InpBufSpace
274 
275  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
276  #if HLS_VERSION == 2017
277  #pragma HLS DATAFLOW
278  #else
279  #pragma HLS DATAFLOW disable_start_propagation
280  #endif
281 
282  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
283  tcp_shell_if(
284  //-- SHELL / Mmio Interface
285  piSHL_Mmio_En,
286  //-- TAF / Rx & Tx Data Interfaces
287  siTAF_Data,
288  siTAF_SessId,
289  siTAF_DatLen,
290  soTAF_Data,
291  soTAF_SessId,
292  soTAF_DatLen,
293  //-- TOE / Rx Data Interfaces
294  siSHL_Notif,
295  soSHL_DReq,
296  siSHL_Data,
297  siSHL_Meta,
298  //-- TOE / Listen Interfaces
299  soSHL_LsnReq,
300  siSHL_LsnRep,
301  //-- TOE / Tx Data Interfaces
302  soSHL_Data,
303  soSHL_SndReq,
304  siSHL_SndRep,
305  //-- TOE / Tx Open Interfaces
306  soSHL_OpnReq,
307  siSHL_OpnRep,
308  //-- TOE / Close Interfaces
309  soSHL_ClsReq,
310  //-- DEBUG Interfaces
311  soDBG_SinkCnt,
312  soDBG_InpBufSpace);
313 }
314 
315 #endif // HLS_VERSION
316 
ap_uint< 1 > CmdBit
Definition: nts_types.hpp:108
void tcp_shell_if(CmdBit *piSHL_Mmio_En, stream< TcpAppData > &siTAF_Data, stream< TcpSessId > &siTAF_SessId, stream< TcpDatLen > &siTAF_DatLen, stream< TcpAppData > &soTAF_Data, stream< TcpSessId > &soTAF_SessId, stream< TcpDatLen > &soTAF_DatLen, stream< TcpAppNotif > &siSHL_Notif, stream< TcpAppRdReq > &soSHL_DReq, stream< TcpAppData > &siSHL_Data, stream< TcpAppMeta > &siSHL_Meta, stream< TcpAppLsnReq > &soSHL_LsnReq, stream< TcpAppLsnRep > &siSHL_LsnRep, stream< TcpAppData > &soSHL_Data, stream< TcpAppSndReq > &soSHL_SndReq, stream< TcpAppSndRep > &siSHL_SndRep, stream< TcpAppOpnReq > &soSHL_OpnReq, stream< TcpAppOpnRep > &siSHL_OpnRep, stream< TcpAppClsReq > &soSHL_ClsReq, stream< ap_uint< 32 > > &soDBG_SinkCnt, stream< ap_uint< 16 > > &soDBG_InpBufSpace)
TCP Shell Interface (TSIF)
void tcp_shell_if_top(CmdBit *piSHL_Mmio_En, stream< TcpAppData > &siTAF_Data, stream< TcpSessId > &siTAF_SessId, stream< TcpDatLen > &siTAF_DatLen, stream< TcpAppData > &soTAF_Data, stream< TcpSessId > &soTAF_SessId, stream< TcpDatLen > &soTAF_DatLen, stream< TcpAppNotif > &siSHL_Notif, stream< TcpAppRdReq > &soSHL_DReq, stream< TcpAppData > &siSHL_Data, stream< TcpAppMeta > &siSHL_Meta, stream< TcpAppLsnReq > &soSHL_LsnReq, stream< TcpAppLsnRep > &siSHL_LsnRep, stream< TcpAppData > &soSHL_Data, stream< TcpAppSndReq > &soSHL_SndReq, stream< TcpAppSndRep > &siSHL_SndRep, stream< TcpAppOpnReq > &soSHL_OpnReq, stream< TcpAppOpnRep > &siSHL_OpnRep, stream< TcpAppClsReq > &soSHL_ClsReq, stream< ap_uint< 32 > > &soDBG_SinkCnt, stream< ap_uint< 16 > > &soDBG_InpBufSpace)
Top of TCP Shell Interface (TSIF)
: Top of TCP Shell Interface (TSIF)