cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
udp_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 "udp_shell_if_top.hpp"
38 
39 using namespace hls;
40 using namespace std;
41 
42 
45 #undef USE_AP_FIFO
46 
47 
74 #if HLS_VERSION == 2016
75  void udp_shell_if_top(
76  //------------------------------------------------------
77  //-- SHELL / Mmio Interface
78  //------------------------------------------------------
79  CmdBit *piSHL_Mmio_En,
80  //------------------------------------------------------
81  //-- SHELL / Control Port Interfaces
82  //------------------------------------------------------
83  stream<UdpPort> &soSHL_LsnReq,
84  stream<StsBool> &siSHL_LsnRep,
85  stream<UdpPort> &soSHL_ClsReq,
86  stream<StsBool> &siSHL_ClsRep,
87  //------------------------------------------------------
88  //-- SHELL / Rx Data Interfaces
89  //------------------------------------------------------
90  stream<UdpAppData> &siSHL_Data,
91  stream<UdpAppMeta> &siSHL_Meta,
92  //------------------------------------------------------
93  //-- SHELL / Tx Data Interfaces
94  //------------------------------------------------------
95  stream<UdpAppData> &soSHL_Data,
96  stream<UdpAppMeta> &soSHL_Meta,
97  stream<UdpAppDLen> &soSHL_DLen,
98  //------------------------------------------------------
99  //-- UAF / Tx Data Interfaces
100  //------------------------------------------------------
101  stream<UdpAppData> &siUAF_Data,
102  stream<UdpAppMeta> &siUAF_Meta,
103  stream<UdpAppDLen> &siUAF_DLen,
104  //------------------------------------------------------
105  //-- UAF / Rx Data Interfaces
106  //------------------------------------------------------
107  stream<UdpAppData> &soUAF_Data,
108  stream<UdpAppMeta> &soUAF_Meta,
109  stream<UdpAppDLen> &soUAF_DLen)
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  //-- [SHL] INTERFACES ------------------------------------------------------
122  #pragma HLS resource core=AXI4Stream variable=soSHL_LsnReq metadata="-bus_bundle soSHL_LsnReq"
123  #pragma HLS resource core=AXI4Stream variable=siSHL_LsnRep metadata="-bus_bundle siSHL_LsnRep"
124  #pragma HLS resource core=AXI4Stream variable=soSHL_ClsReq metadata="-bus_bundle soSHL_ClsReq"
125  #pragma HLS resource core=AXI4Stream variable=siSHL_ClsRep metadata="-bus_bundle siSHL_ClsRep"
126 
127  #pragma HLS resource core=AXI4Stream variable=siSHL_Data metadata="-bus_bundle siSHL_Data"
128  #pragma HLS resource core=AXI4Stream variable=siSHL_Meta metadata="-bus_bundle siSHL_Meta"
129  #pragma HLS DATA_PACK variable=siSHL_Meta
130 
131  #pragma HLS resource core=AXI4Stream variable=soSHL_Data metadata="-bus_bundle soSHL_Data"
132  #pragma HLS resource core=AXI4Stream variable=soSHL_Meta metadata="-bus_bundle soSHL_Meta"
133  #pragma HLS DATA_PACK variable=soSHL_Meta
134  #pragma HLS resource core=AXI4Stream variable=soSHL_DLen metadata="-bus_bundle soSHL_DLen"
135 
136  //-- [UAF] INTERFACES ------------------------------------------------------
137  #pragma HLS resource core=AXI4Stream variable=siUAF_Data metadata="-bus_bundle siUAF_Data"
138  #pragma HLS resource core=AXI4Stream variable=siUAF_Meta metadata="-bus_bundle siUAF_Meta"
139  #pragma HLS DATA_PACK variable=siUAF_Meta
140  #pragma HLS resource core=AXI4Stream variable=siUAF_DLen metadata="-bus_bundle siUAF_DLen"
141 
142  #pragma HLS resource core=AXI4Stream variable=soUAF_Data metadata="-bus_bundle soUAF_Data"
143  #pragma HLS resource core=AXI4Stream variable=soUAF_Meta metadata="-bus_bundle soUAF_Meta"
144  #pragma HLS DATA_PACK variable=soUAF_Meta
145  #pragma HLS resource core=AXI4Stream variable=soUAF_DLen metadata="-bus_bundle soUAF_DLen"
146 
147  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
148  #pragma HLS DATAFLOW
149 
150  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
151  udp_shell_if(
152  //-- SHELL / Mmio Interface
153  piSHL_Mmio_En,
154  //-- SHELL / Control Port Interfaces
155  soSHL_LsnReq,
156  siSHL_LsnRep,
157  soSHL_ClsReq,
158  siSHL_ClsRep,
159  //-- SHELL / Rx Data Interfaces
160  siSHL_Data,
161  siSHL_Meta,
162  //-- SHELL / Tx Data Interfaces
163  soSHL_Data,
164  soSHL_Meta,
165  soSHL_DLen,
166  //-- UAF / Tx Data Interfaces
167  siUAF_Data,
168  siUAF_Meta,
169  siUAF_DLen,
170  //-- UAF / Rx Data Interfaces
171  soUAF_Data,
172  soUAF_Meta,
173  soUAF_DLen);
174 }
175 #else
177  //------------------------------------------------------
178  //-- SHELL / Mmio Interface
179  //------------------------------------------------------
180  CmdBit *piSHL_Mmio_En,
181  //------------------------------------------------------
182  //-- SHELL / Control Port Interfaces
183  //------------------------------------------------------
184  stream<UdpPort> &soSHL_LsnReq,
185  stream<StsBool> &siSHL_LsnRep,
186  stream<UdpPort> &soSHL_ClsReq,
187  stream<StsBool> &siSHL_ClsRep,
188  //------------------------------------------------------
189  //-- SHELL / Rx Data Interfaces
190  //------------------------------------------------------
191  stream<UdpAppData> &siSHL_Data,
192  stream<UdpAppMeta> &siSHL_Meta,
193  stream<UdpAppDLen> &siSHL_DLen,
194  //------------------------------------------------------
195  //-- SHELL / Tx Data Interfaces
196  //------------------------------------------------------
197  stream<UdpAppData> &soSHL_Data,
198  stream<UdpAppMeta> &soSHL_Meta,
199  stream<UdpAppDLen> &soSHL_DLen,
200  //------------------------------------------------------
201  //-- UAF / Tx Data Interfaces
202  //------------------------------------------------------
203  stream<UdpAppData> &siUAF_Data,
204  stream<UdpAppMeta> &siUAF_Meta,
205  stream<UdpAppDLen> &siUAF_DLen,
206  //------------------------------------------------------
207  //-- UAF / Rx Data Interfaces
208  //------------------------------------------------------
209  stream<UdpAppData> &soUAF_Data,
210  stream<UdpAppMeta> &soUAF_Meta,
211  stream<UdpAppDLen> &soUAF_DLen)
212 {
213  //-- DIRECTIVES FOR THE INTERFACES -----------------------------------------
214  #pragma HLS INTERFACE ap_ctrl_none port=return
215 
216  #if defined (USE_AP_FIFO)
217  //-- Make use of FIFOs on the UAF interfaces -------------------------------
218  #pragma HLS INTERFACE ap_stable register port=piSHL_Mmio_En name=piSHL_Mmio_En
219 
220  //-- [SHL] INTERFACES ------------------------------------------------------
221  #pragma HLS INTERFACE axis off port=soSHL_LsnReq name=soSHL_LsnReq
222  #pragma HLS INTERFACE axis off port=siSHL_LsnRep name=siSHL_LsnRep
223  #pragma HLS INTERFACE axis off port=soSHL_ClsReq name=soSHL_ClsReq
224  #pragma HLS INTERFACE axis off port=siSHL_ClsRep name=siSHL_ClsRep
225 
226  #pragma HLS INTERFACE axis off port=siSHL_Data name=siSHL_Data
227  #pragma HLS INTERFACE axis off port=siSHL_Meta name=siSHL_Meta
228  #pragma HLS DATA_PACK variable=siSHL_Meta
229  #pragma HLS INTERFACE axis off port=siSHL_DLen name=siSHL_DLen
230 
231  #pragma HLS INTERFACE axis off port=soSHL_Data name=soSHL_Data
232  #pragma HLS INTERFACE axis off port=soSHL_Meta name=soSHL_Meta
233  #pragma HLS DATA_PACK variable=soSHL_Meta
234  #pragma HLS INTERFACE axis off port=soSHL_DLen name=soSHL_DLen
235 
236  //-- [UAF] INTERFACES ------------------------------------------------------
237  #pragma HLS INTERFACE ap_fifo port=siUAF_Data name=siUAF_Data
238  #pragma HLS DATA_PACK variable=siUAF_Data
239  #pragma HLS INTERFACE ap_fifo port=siUAF_Meta name=siUAF_Meta
240  #pragma HLS DATA_PACK variable=siUAF_Meta
241  #pragma HLS INTERFACE ap_fifo port=siUAF_DLen name=siUAF_DLen
242 
243  #pragma HLS INTERFACE ap_fifo port=soUAF_Data name=soUAF_Data
244  #pragma HLS DATA_PACK variable=soUAF_Data
245  #pragma HLS INTERFACE ap_fifo port=soUAF_Meta name=soUAF_Meta
246  #pragma HLS DATA_PACK variable=soUAF_Meta
247  #pragma HLS INTERFACE ap_fifo port=soUAF_DLen name=soUAF_DLen
248  #else
249  //-- Make use of AXIS on the UAF interfaces --------------------------------
250  #pragma HLS INTERFACE ap_stable register port=piSHL_Mmio_En name=piSHL_Mmio_En
251 
252  //-- [SHL] INTERFACES ------------------------------------------------------
253  #pragma HLS INTERFACE axis off port=soSHL_LsnReq name=soSHL_LsnReq
254  #pragma HLS INTERFACE axis off port=siSHL_LsnRep name=siSHL_LsnRep
255  #pragma HLS INTERFACE axis off port=soSHL_ClsReq name=soSHL_ClsReq
256  #pragma HLS INTERFACE axis off port=siSHL_ClsRep name=siSHL_ClsRep
257 
258  #pragma HLS INTERFACE axis off port=siSHL_Data name=siSHL_Data
259  #pragma HLS INTERFACE axis off port=siSHL_Meta name=siSHL_Meta
260  #pragma HLS DATA_PACK variable=siSHL_Meta
261  #pragma HLS INTERFACE axis off port=siSHL_DLen name=siSHL_DLen
262 
263  #pragma HLS INTERFACE axis off port=soSHL_Data name=soSHL_Data
264  #pragma HLS INTERFACE axis off port=soSHL_Meta name=soSHL_Meta
265  #pragma HLS DATA_PACK variable=soSHL_Meta
266  #pragma HLS INTERFACE axis off port=soSHL_DLen name=soSHL_DLen
267 
268  //-- [UAF] INTERFACES ------------------------------------------------------
269  #pragma HLS INTERFACE axis off port=siUAF_Data name=siUAF_Data
270  #pragma HLS INTERFACE axis off port=siUAF_Meta name=siUAF_Meta
271  #pragma HLS DATA_PACK variable=siUAF_Meta
272  #pragma HLS INTERFACE axis off port=siUAF_DLen name=siUAF_DLen
273 
274  #pragma HLS INTERFACE axis off port=soUAF_Data name=soUAF_Data
275  #pragma HLS INTERFACE axis off port=soUAF_Meta name=soUAF_Meta
276  #pragma HLS DATA_PACK variable=soUAF_Meta
277  #pragma HLS INTERFACE axis off port=soUAF_DLen name=soUAF_DLen
278  #endif
279 
280  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
281  #if HLS_VERSION == 2017
282  #pragma HLS DATAFLOW
283  #else
284  #pragma HLS DATAFLOW disable_start_propagation
285  #endif
286 
287  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
288  udp_shell_if(
289  //-- SHELL / Mmio Interface
290  piSHL_Mmio_En,
291  //-- SHELL / Control Port Interfaces
292  soSHL_LsnReq,
293  siSHL_LsnRep,
294  soSHL_ClsReq,
295  siSHL_ClsRep,
296  //-- SHELL / Rx Data Interfaces
297  siSHL_Data,
298  siSHL_Meta,
299  siSHL_DLen,
300  //-- SHELL / Tx Data Interfaces
301  soSHL_Data,
302  soSHL_Meta,
303  soSHL_DLen,
304  //-- UAF / Tx Data Interfaces
305  siUAF_Data,
306  siUAF_Meta,
307  siUAF_DLen,
308  //-- UAF / Rx Data Interfaces
309  soUAF_Data,
310  soUAF_Meta,
311  soUAF_DLen);
312 
313 }
314 
315 #endif // HLS_VERSION
316 
ap_uint< 1 > CmdBit
Definition: nts_types.hpp:108
void udp_shell_if_top(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)
Top of UDP Shell Interface (USIF)
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).
: Top of UDP Shell Interface (USIF).