cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
udp_app_flash_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_app_flash.hpp"
38 
39 using namespace hls;
40 
41 
44 #undef UAF_USE_AP_FIFO
45 #undef UAF_USE_NON_FIFO_IO
46 
47 
64 #if HLS_VERSION == 2016
65  void udp_app_flash_top (
66  //------------------------------------------------------
67  //-- SHELL / Mmio / Configuration Interfaces
68  //------------------------------------------------------
69  #if defined UAF_USE_NON_FIFO_IO
70  ap_uint<2> piSHL_Mmio_EchoCtrl,
71  ap_uint<1> piSHL_Mmio_PostPktEn,
72  ap_uint<1> piSHL_Mmio_CaptPktEn,
73  #endif
74  //------------------------------------------------------
75  //-- USIF / Rx Data Interfaces
76  //------------------------------------------------------
77  stream<UdpAppData> &siUSIF_Data,
78  stream<UdpAppMeta> &siUSIF_Meta,
79  stream<UdpAppDLen> &siUSIF_DLen,
80  //------------------------------------------------------
81  //-- USIF / Tx Data Interfaces
82  //------------------------------------------------------
83  stream<UdpAppData> &soUSIF_Data,
84  stream<UdpAppMeta> &soUSIF_Meta,
85  stream<UdpAppDLen> &soUSIF_DLen)
86 {
87  //-- DIRECTIVES FOR THE INTERFACES ----------------------------------------
88  #pragma HLS INTERFACE ap_ctrl_none port=return
89 
90 
91 
92 
93 
94  #if defined UAF_USE_NON_FIFO_IO
95  #pragma HLS INTERFACE ap_stable port=piSHL_Mmio_EchoCtrl
96  #pragma HLS INTERFACE ap_stable port=piSHL_Mmio_PostPktEn
97  #pragma HLS INTERFACE ap_stable port=piSHL_Mmio_CaptPktEn
98  #endif
99  #pragma HLS resource core=AXI4Stream variable=siUSIF_Data metadata="-bus_bundle siUSIF_Data"
100  #pragma HLS resource core=AXI4Stream variable=siUSIF_Meta metadata="-bus_bundle siUSIF_Meta"
101  #pragma HLS DATA_PACK variable=siUSIF_Meta
102  #pragma HLS resource core=AXI4Stream variable=siUSIF_DLen metadata="-bus_bundle siUSIF_DLen"
103 
104  #pragma HLS resource core=AXI4Stream variable=soUSIF_Data metadata="-bus_bundle soUSIF_Data"
105  #pragma HLS resource core=AXI4Stream variable=soUSIF_Meta metadata="-bus_bundle soUSIF_Meta"
106  #pragma HLS DATA_PACK variable=soUSIF_Meta
107  #pragma HLS resource core=AXI4Stream variable=soUSIF_DLen metadata="-bus_bundle soUSIF_DLen"
108 
109  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
110  #pragma HLS DATAFLOW
111 
112  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
113  udp_app_flash (
114  //-- SHELL / Mmio / Configuration Interfaces
115  #if defined UAF_USE_NON_FIFO_IO
116  piSHL_Mmio_EchoCtrl,
117  piSHL_Mmio_PostPktEn,
118  piSHL_Mmio_CaptPktEn,
119  #endif
120  //-- USIF / Rx Data Interfaces
121  siUSIF_Data,
122  siUSIF_Meta,
123  siUSIF_DLen,
124  //-- USIF / Tx Data Interfaces
125  soUSIF_Data,
126  soUSIF_Meta,
127  soUSIF_DLen);
128 }
129 #else
131  //------------------------------------------------------
132  //-- SHELL / Mmio Interfaces
133  //------------------------------------------------------
134  CmdBit *piSHL_Mmio_En,
135  #if defined UAF_USE_NON_FIFO_IO
136  ap_uint<2> piSHL_Mmio_EchoCtrl,
137  ap_uint<1> piSHL_Mmio_PostPktEn,
138  ap_uint<1> piSHL_Mmio_CaptPktEn,
139  #endif
140  //------------------------------------------------------
141  //-- USIF / Rx Data Interfaces
142  //------------------------------------------------------
143  stream<UdpAppData> &siUSIF_Data,
144  stream<UdpAppMeta> &siUSIF_Meta,
145  stream<UdpAppDLen> &siUSIF_DLen,
146  //------------------------------------------------------
147  //-- USIF / Tx Data Interfaces
148  //------------------------------------------------------
149  stream<UdpAppData> &soUSIF_Data,
150  stream<UdpAppMeta> &soUSIF_Meta,
151  stream<UdpAppDLen> &soUSIF_DLen)
152 {
153  //-- DIRECTIVES FOR THE INTERFACES ----------------------------------------
154  #pragma HLS INTERFACE ap_ctrl_none port=return
155 
156  #if defined TAF_USE_NON_FIFO_IO
157  #pragma HLS INTERFACE ap_stable register port=piSHL_Mmio_EchoCtrl name=piSHL_Mmio_EchoCtrl
158  #pragma HLS INTERFACE ap_stable port=piSHL_Mmio_PostPktEn
159  #pragma HLS INTERFACE ap_stable port=piSHL_Mmio_CaptPktEn
160  #endif
161 
162  #if defined (UAF_USE_AP_FIFO)
163  //-- [USIF] INTERFACES ------------------------------------------------------
164  #pragma HLS INTERFACE ap_fifo port=siUSIF_Data name=siUSIF_Data
165  #pragma HLS DATA_PACK variable=siUSIF_Data
166  #pragma HLS INTERFACE ap_fifo port=siUSIF_Meta name=siUSIF_Meta
167  #pragma HLS DATA_PACK variable=siUSIF_Meta
168  #pragma HLS INTERFACE ap_fifo port=siUSIF_DLen name=siUSIF_DLen
169 
170  #pragma HLS INTERFACE ap_fifo port=soUSIF_Data name=soUSIF_Data
171  #pragma HLS DATA_PACK variable=soUSIF_Data
172  #pragma HLS INTERFACE ap_fifo port=soUSIF_Meta name=soUSIF_Meta
173  #pragma HLS DATA_PACK variable=soUSIF_Meta
174  #pragma HLS INTERFACE ap_fifo port=soUSIF_DLen name=soUSIF_DLen
175  #else
176  //-- [USIF] INTERFACES ------------------------------------------------------
177  #pragma HLS INTERFACE axis off port=siUSIF_Data name=siUSIF_Data
178  #pragma HLS INTERFACE axis off port=siUSIF_Meta name=siUSIF_Meta
179  #pragma HLS DATA_PACK variable=siUSIF_Meta
180  #pragma HLS INTERFACE axis off port=siUSIF_DLen name=siUSIF_DLen
181 
182  #pragma HLS INTERFACE axis off port=soUSIF_Data name=soUSIF_Data
183  #pragma HLS INTERFACE axis off port=soUSIF_Meta name=soUSIF_Meta
184  #pragma HLS DATA_PACK variable=soUSIF_Meta
185  #pragma HLS INTERFACE axis off port=soUSIF_DLen name=soUSIF_DLen
186  #endif
187 
188  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
189 #if HLS_VERSION == 2017
190  #pragma HLS DATAFLOW
191 #else
192  #pragma HLS DATAFLOW disable_start_propagation
193 #endif
194  #pragma HLS INTERFACE ap_ctrl_none port=return
195 
196  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
197  udp_app_flash (
198  //-- SHELL / Mmio Interfaces
199  piSHL_Mmio_En,
200  #if defined UAF_USE_NON_FIFO_IO
201  piSHL_Mmio_EchoCtrl,
202  piSHL_Mmio_PostPktEn,
203  piSHL_Mmio_CaptPktEn,
204  #endif
205  //-- USIF / Rx Data Interfaces
206  siUSIF_Data,
207  siUSIF_Meta,
208  siUSIF_DLen,
209  //-- USIF / Tx Data Interfaces
210  soUSIF_Data,
211  soUSIF_Meta,
212  soUSIF_DLen);
213 
214 }
215 
216 #endif // HLS_VERSION
217 
ap_uint< 1 > CmdBit
Definition: nts_types.hpp:108
void udp_app_flash(CmdBit *piSHL_Mmio_En, stream< UdpAppData > &siUSIF_Data, stream< UdpAppMeta > &siUSIF_Meta, stream< UdpAppDLen > &siUSIF_DLen, stream< UdpAppData > &soUSIF_Data, stream< UdpAppMeta > &soUSIF_Meta, stream< UdpAppDLen > &soUSIF_DLen)
Main process of the UDP Application Flash (UAF)
void udp_app_flash_top(CmdBit *piSHL_Mmio_En, stream< UdpAppData > &siUSIF_Data, stream< UdpAppMeta > &siUSIF_Meta, stream< UdpAppDLen > &siUSIF_DLen, stream< UdpAppData > &soUSIF_Data, stream< UdpAppMeta > &soUSIF_Meta, stream< UdpAppDLen > &soUSIF_DLen)
Top of UDP Application Flash (UAF)
: UDP Application Flash (UAF)