34 stream<NodeId> &sDstNode_sig,
35 ap_uint<32> *po_rx_ports
39 #pragma HLS INLINE off
43 #pragma HLS reset variable=port_fsm
51 if(!sDstNode_sig.full())
53 NodeId dst_rank = (*pi_rank + 1) % *pi_size;
54 printf(
"rank: %d; size: %d; \n", (
int) *pi_rank, (
int) *pi_size);
55 sDstNode_sig.write(dst_rank);
67 stream<NetworkMetaStream> &siNrc_meta,
68 stream<NetworkWord> &siNrc_data,
69 stream<NetworkMetaStream> &sRxtoTx_Meta,
70 stream<NetworkWord> &sRxpToTxp_Data
74 #pragma HLS INLINE off
75 #pragma HLS pipeline II=1
78 #pragma HLS reset variable=enqueueFSM
87 if ( !siNrc_meta.empty() && !sRxtoTx_Meta.full() )
89 meta_tmp = siNrc_meta.read();
91 sRxtoTx_Meta.write(meta_tmp);
97 if ( !siNrc_data.empty() && !sRxpToTxp_Data.full() )
99 udpWord = siNrc_data.read();
100 sRxpToTxp_Data.write(udpWord);
101 if(udpWord.
tlast == 1)
112 stream<NodeId> &sDstNode_sig,
113 stream<NetworkMetaStream> &sRxtoTx_Meta,
114 stream<NetworkWord> &sRxpToTxp_Data,
115 stream<NetworkMetaStream> &soNrc_meta,
116 stream<NetworkWord> &soNrc_data
120 #pragma HLS INLINE off
121 #pragma HLS pipeline II=1
124 #pragma HLS reset variable=dequeueFSM
135 if(!sDstNode_sig.empty())
137 dst_rank = sDstNode_sig.read();
145 !sRxtoTx_Meta.empty()
147 && !soNrc_meta.full()
165 meta_out.
len = meta_in.
len;
185 if( !sRxpToTxp_Data.empty() && !soNrc_data.full())
187 udpWordTx = sRxpToTxp_Data.read();
188 soNrc_data.write(udpWordTx);
190 if(udpWordTx.
tlast == 1)
212 ap_uint<32> *pi_rank,
213 ap_uint<32> *pi_size,
217 stream<NetworkWord> &siNrc_data,
218 stream<NetworkWord> &soNrc_data,
219 stream<NetworkMetaStream> &siNrc_meta,
220 stream<NetworkMetaStream> &soNrc_meta,
221 ap_uint<32> *po_rx_ports
226 #pragma HLS INTERFACE ap_ctrl_none port=return
228 #pragma HLS INTERFACE axis register both port=siNrc_data
229 #pragma HLS INTERFACE axis register both port=soNrc_data
231 #pragma HLS INTERFACE axis register both port=siNrc_meta
232 #pragma HLS INTERFACE axis register both port=soNrc_meta
234 #pragma HLS INTERFACE ap_vld register port=po_rx_ports name=poROL_NRC_Rx_ports
235 #pragma HLS INTERFACE ap_vld register port=pi_rank name=piFMC_ROL_rank
236 #pragma HLS INTERFACE ap_vld register port=pi_size name=piFMC_ROL_size
245 static stream<NetworkWord> sBuffer_Data (
"sBuffer_Data");
246 static stream<NetworkMetaStream> sBuffer_Meta (
"sBuffer_Meta");
247 static stream<NodeId> sDstNode_sig (
"sDstNode_sig");
249 #pragma HLS STREAM variable=sBuffer_Data depth=252
250 #pragma HLS STREAM variable=sBuffer_Meta depth=32
251 #pragma HLS STREAM variable=sDstNode_sig depth=1
258 pEnq(siNrc_meta, siNrc_data, sBuffer_Meta, sBuffer_Data);
260 pDeq(sDstNode_sig, sBuffer_Meta, sBuffer_Data, soNrc_meta, soNrc_data);
#define FSM_WRITE_NEW_DATA
#define PROCESSING_PACKET
#define NAL_THIS_FPGA_PSEUDO_NID
void pPortAndDestionation(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NodeId > &sDstNode_sig, ap_uint< 32 > *po_rx_ports)
void pDeq(stream< NodeId > &sDstNode_sig, stream< NetworkMetaStream > &sRxtoTx_Meta, stream< NetworkWord > &sRxpToTxp_Data, stream< NetworkMetaStream > &soNrc_meta, stream< NetworkWord > &soNrc_data)
void pEnq(stream< NetworkMetaStream > &siNrc_meta, stream< NetworkWord > &siNrc_data, stream< NetworkMetaStream > &sRxtoTx_Meta, stream< NetworkWord > &sRxpToTxp_Data)
void triangle_app(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NetworkWord > &siNrc_data, stream< NetworkWord > &soNrc_data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &soNrc_meta, ap_uint< 32 > *po_rx_ports)
Main process of the UDP/TCP Triangle Application. This HLS IP receives a packet and forwards it to th...