cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
uppercase.hpp
Go to the documentation of this file.
1 
17 
38 #ifndef _ROLE_UPPERCASE_H_
39 #define _ROLE_UPPERCASE_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 
53 using namespace hls;
54 
55 
56 
59 enum EchoCtrl {
62  ECHO_OFF = 2
63 };
64 
65 
69  STOP_CMD = 0,
70  START_CMD = 1
71 };
72 
73 
74 #define WAIT_FOR_META 0
75 #define WAIT_FOR_STREAM_PAIR 1
76 #define PROCESSING_PACKET 2
77 #define UPPERCASE_RETURN_RESULTS 3
78 
79 #define PacketFsmType uint8_t
80 
81 #define FSM_WRITE_NEW_DATA 0
82 #define FSM_DONE 1
83 #define PortFsmType uint8_t
84 
85 #define FSM_PROCESSING_STOP 0
86 #define FSM_PROCESSING_START 1
87 #define ProcessingFsmType uint8_t
88 
89 #define DEFAULT_TX_PORT 2718
90 #define DEFAULT_RX_PORT 2718
91 
92 
93 #define MEMDW 64 // 512 or 128 or 64 // Bus width in bits for Host memory
94 #define BPERDW (MEMDW/8) // Bytes per Data Word if MEMDW=512 => BPERDW = 64, if MEMDW=64 => BPERDW = 16
95 
96 #define MAX_NB_OF_ELMT_READ 16
97 typedef uint8_t mat_elmt_t; // change to float or double depending on your needs
98 
99 #define MAX_NB_OF_WORDS_READ (MAX_NB_OF_ELMT_READ*sizeof(mat_elmt_t)/BPERDW) // =2 if double =1 if float
100 #define MAX_NB_OF_ELMT_PERDW (BPERDW/sizeof(mat_elmt_t)) // =8 if double =16 if float
101 
102 
103 void uppercase(
104 
105  ap_uint<32> *pi_rank,
106  ap_uint<32> *pi_size,
107  //------------------------------------------------------
108  //-- SHELL / This / Udp/TCP Interfaces
109  //------------------------------------------------------
110  stream<NetworkWord> &siSHL_This_Data,
111  stream<NetworkWord> &soTHIS_Shl_Data,
112  stream<NetworkMetaStream> &siNrc_meta,
113  stream<NetworkMetaStream> &soNrc_meta,
114  ap_uint<32> *po_rx_ports
115 );
116 
117 
118 #endif
119 
120 
EchoCtrl
Definition: memtest.hpp:49
UppercaseCmd
Definition: uppercase.hpp:68
uint8_t mat_elmt_t
Definition: uppercase.hpp:97
void uppercase(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 Uppercase Application directives.
Definition: uppercase.cpp:335
@ STOP_CMD
Definition: uppercase.hpp:69
@ START_CMD
Definition: uppercase.hpp:70
@ ECHO_STORE_FWD
Definition: uppercase.hpp:63
@ ECHO_OFF
Definition: uppercase.hpp:64
@ ECHO_PATH_THRU
Definition: uppercase.hpp:62