cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
tcp_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 "tcp_app_flash_top.hpp"
38 
39 using namespace hls;
40 using namespace std;
41 
42 
43 
55 #if HLS_VERSION == 2016
56  void tcp_app_flash_top (
57  //------------------------------------------------------
58  //-- SHELL / MMIO / Configuration Interfaces
59  //------------------------------------------------------
60  #if defined TAF_USE_NON_FIFO_IO
61  ap_uint<2> piSHL_MmioEchoCtrl,
62  #endif
63  //------------------------------------------------------
64  //-- TSIF / Rx Data Interface
65  //------------------------------------------------------
66  stream<TcpAppData> &siTSIF_Data,
67  stream<TcpSessId> &siTSIF_SessId,
68  stream<TcpDatLen> &siTSIF_DatLen,
69  //------------------------------------------------------
70  //-- TSIF / Tx Data Interface
71  //------------------------------------------------------
72  stream<TcpAppData> &soTSIF_Data,
73  stream<TcpSessId> &soTSIF_SessId,
74  stream<TcpDatLen> &soTSIF_DatLen)
75 {
76  //-- DIRECTIVES FOR THE INTERFACES -----------------------------------------
77  #pragma HLS INTERFACE ap_ctrl_none port=return
78 
79 
80 
81 
82 
83  #if defined TAF_USE_NON_FIFO_IO
84  #pragma HLS INTERFACE ap_stable port=piSHL_MmioEchoCtrl
85  #endif
86  #pragma HLS resource core=AXI4Stream variable=siTSIF_Data metadata="-bus_bundle siTSIF_Data"
87  #pragma HLS resource core=AXI4Stream variable=siTSIF_SessId metadata="-bus_bundle siTSIF_SessId"
88  #pragma HLS resource core=AXI4Stream variable=siTSIF_DatLen metadata="-bus_bundle siTSIF_DatLen"
89 
90  #pragma HLS resource core=AXI4Stream variable=soTSIF_Data metadata="-bus_bundle soTSIF_Data"
91  #pragma HLS resource core=AXI4Stream variable=soTSIF_SessId metadata="-bus_bundle soTSIF_SessId"
92  #pragma HLS resource core=AXI4Stream variable=soTSIF_DatLen metadata="-bus_bundle soTSIF_DatLen"
93 
94  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
95  #pragma HLS DATAFLOW
96 
97  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
99  //-- SHELL / MMIO / Configuration Interfaces
100  #if defined TAF_USE_NON_FIFO_IO
101  piSHL_MmioEchoCtrl,
102  #endif
103  //-- SHELL / TCP Rx Data Interface
104  siTSIF_Data,
105  siTSIF_SessId,
106  siTSIF_DatLen,
107  //-- SHELL / TCP Tx Data Interface
108  soTSIF_Data,
109  soTSIF_SessId,
110  soTSIF_DatLen);
111 
112 }
113 #else
115  //------------------------------------------------------
116  //-- SHELL / MMIO / Configuration Interfaces
117  //------------------------------------------------------
118  #if defined TAF_USE_NON_FIFO_IO
119  ap_uint<2> piSHL_MmioEchoCtrl,
120  #endif
121  //------------------------------------------------------
122  //-- TSIF / Rx Data Interface
123  //------------------------------------------------------
124  stream<TcpAppData> &siTSIF_Data,
125  stream<TcpSessId> &siTSIF_SessId,
126  stream<TcpDatLen> &siTSIF_DatLen,
127  //------------------------------------------------------
128  //-- TSIF / Tx Data Interface
129  //------------------------------------------------------
130  stream<TcpAppData> &soTSIF_Data,
131  stream<TcpSessId> &soTSIF_SessId,
132  stream<TcpDatLen> &soTSIF_DatLen)
133 {
134  //-- DIRECTIVES FOR THE INTERFACES -----------------------------------------
135  #pragma HLS INTERFACE ap_ctrl_none port=return
136 
137  #if defined TAF_USE_NON_FIFO_IO
138  #pragma HLS INTERFACE ap_stable register port=piSHL_MmioEchoCtrl
139  #endif
140  #pragma HLS INTERFACE axis off port=siTSIF_Data name=siTSIF_Data
141  #pragma HLS INTERFACE axis off port=siTSIF_SessId name=siTSIF_SessId
142  #pragma HLS INTERFACE axis off port=siTSIF_DatLen name=siTSIF_DatLen
143  #pragma HLS INTERFACE axis off port=soTSIF_Data name=soTSIF_Data
144  #pragma HLS INTERFACE axis off port=soTSIF_SessId name=soTSIF_SessId
145  #pragma HLS INTERFACE axis off port=soTSIF_DatLen name=soTSIF_DatLen
146 
147  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
148  #if HLS_VERSION == 2017
149  #pragma HLS DATAFLOW
150  #else
151  #pragma HLS DATAFLOW disable_start_propagation
152  #endif
153 
154  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
155  tcp_app_flash (
156  //-- SHELL / MMIO / Configuration Interfaces
157  #if defined TAF_USE_NON_FIFO_IO
158  piSHL_MmioEchoCtrl,
159  #endif
160  //-- SHELL / TCP Rx Data Interface
161  siTSIF_Data,
162  siTSIF_SessId,
163  siTSIF_DatLen,
164  //-- SHELL / TCP Tx Data Interface
165  soTSIF_Data,
166  soTSIF_SessId,
167  soTSIF_DatLen);
168 
169 }
170 
171 #endif // HLS_VERSION
172 
void tcp_app_flash_top(stream< TcpAppData > &siTSIF_Data, stream< TcpSessId > &siTSIF_SessId, stream< TcpDatLen > &siTSIF_DatLen, stream< TcpAppData > &soTSIF_Data, stream< TcpSessId > &soTSIF_SessId, stream< TcpDatLen > &soTSIF_DatLen)
Top of TCP Application Flash (TAF)
void tcp_app_flash(stream< TcpAppData > &siTSIF_Data, stream< TcpSessId > &siTSIF_SessId, stream< TcpDatLen > &siTSIF_DataLen, stream< TcpAppData > &soTSIF_Data, stream< TcpSessId > &soTSIF_SessId, stream< TcpDatLen > &soTSIF_DatLen)
Main process of the TCP Application Flash (TAF)
: Top of TCP Application Flash (TAF)