cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
triangle_app.hpp File Reference
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <hls_stream.h>
#include "ap_int.h"
#include <stdint.h>
#include "network.hpp"
Include dependency graph for triangle_app.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WAIT_FOR_META   0
 
#define WAIT_FOR_STREAM   1
 
#define PROCESSING_PACKET   2
 
#define PacketFsmType   uint8_t
 
#define FSM_WRITE_NEW_DATA   0
 
#define FSM_DONE   1
 
#define PortFsmType   uint8_t
 
#define DEFAULT_TX_PORT   2718
 
#define DEFAULT_RX_PORT   2718
 

Functions

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 the next node in the cluster. The last forwards it to 0. More...
 

Macro Definition Documentation

◆ DEFAULT_RX_PORT

#define DEFAULT_RX_PORT   2718

Definition at line 57 of file triangle_app.hpp.

◆ DEFAULT_TX_PORT

#define DEFAULT_TX_PORT   2718

Definition at line 56 of file triangle_app.hpp.

◆ FSM_DONE

#define FSM_DONE   1

Definition at line 53 of file triangle_app.hpp.

◆ FSM_WRITE_NEW_DATA

#define FSM_WRITE_NEW_DATA   0

Definition at line 52 of file triangle_app.hpp.

◆ PacketFsmType

#define PacketFsmType   uint8_t

Definition at line 50 of file triangle_app.hpp.

◆ PortFsmType

#define PortFsmType   uint8_t

Definition at line 54 of file triangle_app.hpp.

◆ PROCESSING_PACKET

#define PROCESSING_PACKET   2

Definition at line 48 of file triangle_app.hpp.

◆ WAIT_FOR_META

#define WAIT_FOR_META   0

Definition at line 46 of file triangle_app.hpp.

◆ WAIT_FOR_STREAM

#define WAIT_FOR_STREAM   1

Definition at line 47 of file triangle_app.hpp.

Function Documentation

◆ triangle_app()

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 the next node in the cluster. The last forwards it to 0.

Returns
Nothing.

Definition at line 211 of file triangle_app.cpp.

223 {
224 
225  //-- DIRECTIVES FOR THE BLOCK ---------------------------------------------
226 #pragma HLS INTERFACE ap_ctrl_none port=return
227 
228 #pragma HLS INTERFACE axis register both port=siNrc_data
229 #pragma HLS INTERFACE axis register both port=soNrc_data
230 
231 #pragma HLS INTERFACE axis register both port=siNrc_meta
232 #pragma HLS INTERFACE axis register both port=soNrc_meta
233 
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
237 
238 
239  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
240 #pragma HLS DATAFLOW
241 
242  //-- STATIC VARIABLES (with RESET) ------------------------------------------
243 
244  //-- STATIC DATAFLOW VARIABLES ------------------------------------------
245  static stream<NetworkWord> sBuffer_Data ("sBuffer_Data");
246  static stream<NetworkMetaStream> sBuffer_Meta ("sBuffer_Meta");
247  static stream<NodeId> sDstNode_sig ("sDstNode_sig");
248 
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
252 
253 
254  //-- LOCAL VARIABLES ------------------------------------------------------
255 
256  pPortAndDestionation(pi_rank, pi_size, sDstNode_sig, po_rx_ports);
257 
258  pEnq(siNrc_meta, siNrc_data, sBuffer_Meta, sBuffer_Data);
259 
260  pDeq(sDstNode_sig, sBuffer_Meta, sBuffer_Data, soNrc_meta, soNrc_data);
261 
262 }
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)
Here is the call graph for this function:
Here is the caller graph for this function: