cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
mceuropeanengine.hpp
Go to the documentation of this file.
1 
17 
38 #ifndef _ROLE_MCEUROPEANENGINE_H_
39 #define _ROLE_MCEUROPEANENGINE_H_
40 
41 #include <stdio.h>
42 #include <iostream>
43 #include <fstream>
44 #include <string>
45 #include <string.h>
46 #include <math.h>
47 #include <hls_stream.h>
48 #include "ap_int.h"
49 #include <stdint.h>
50 
51 #include "network.hpp"
52 
54 
55 using namespace hls;
56 
57 
58 /* Instead of the actual MCE IP, use sipmle logic that assigns values on out. For fast HLS cim/cosim
59  * uncomment this, else keep it commented.
60  */
61 //#define FAKE_MCEuropeanEngine
62 
63 #define DEFAULT_TX_PORT 2718
64 #define DEFAULT_RX_PORT 2718
65 
66 //#define USE_HLSLIB_DATAFLOW
67 
68 //#define USE_HLSLIB_STREAM
69 
70 #if DtUsed == double
71 #define INPUT_PTR_WIDTH 64
72 #elif DtUsed == float
73 #define INPUT_PTR_WIDTH 32
74 #endif
75 #define OUTPUT_PTR_WIDTH 64
76 
77 
78 #define INSIZE sizeof(varin)
79 #define OUTSIZE sizeof(DtUsed)*OUTDEP
80 
81 #define BITS_PER_10GBITETHRNET_AXI_PACKET 64
82 #define BYTES_PER_10GBITETHRNET_AXI_PACKET (BITS_PER_10GBITETHRNET_AXI_PACKET/8)
83 
84 #define IN_PACKETS INSIZE/(BYTES_PER_10GBITETHRNET_AXI_PACKET)
85 #define OUT_PACKETS OUTSIZE/(BYTES_PER_10GBITETHRNET_AXI_PACKET)
86 
87 #define MIN_RX_LOOPS IN_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/INPUT_PTR_WIDTH)
88 #define MIN_TX_LOOPS OUT_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/OUTPUT_PTR_WIDTH)
89 
90 #define WAIT_FOR_META 0
91 #define WAIT_FOR_STREAM_PAIR 1
92 #define PROCESSING_PACKET 2
93 #define PROCESSING_WAIT 3
94 #define MCEUROPEANENGINE_RETURN_RESULTS 4
95 
96 #define PacketFsmType uint8_t
97 
98 
99 void mceuropeanengine(
100 
101  ap_uint<32> *pi_rank,
102  ap_uint<32> *pi_size,
103  //------------------------------------------------------
104  //-- SHELL / This / Udp/TCP Interfaces
105  //------------------------------------------------------
106  stream<NetworkWord> &siSHL_This_Data,
107  stream<NetworkWord> &soTHIS_Shl_Data,
108  stream<NetworkMetaStream> &siNrc_meta,
109  stream<NetworkMetaStream> &soNrc_meta,
110  ap_uint<32> *po_rx_ports
111 );
112 
113 
114 #endif
115 
116 
void mceuropeanengine(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NetworkWord > &siSHL_This_Data, stream< NetworkWord > &soTHIS_Shl_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &soNrc_meta, ap_uint< 32 > *po_rx_ports)
Main process of the MCEuropeanEngine Application directives.