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 // #define ENABLE_DDR
57 #define ROLE_IS_UPPERCASE
58 
61 enum EchoCtrl {
64  ECHO_OFF = 2
65 };
66 
67 
68 #define WAIT_FOR_META 0
69 #define WAIT_FOR_STREAM_PAIR 1
70 #define PROCESSING_PACKET 2
71 #define UPPERCASE_RETURN_RESULTS 3
72 
73 #define PacketFsmType uint8_t
74 
75 #define FSM_WRITE_NEW_DATA 0
76 #define FSM_DONE 1
77 #define PortFsmType uint8_t
78 
79 #define DEFAULT_TX_PORT 2718
80 #define DEFAULT_RX_PORT 2718
81 
82 
83 //#define MEMDW 64 // 512 or 128 or 64 // Bus width in bits for Host memory
84 //#define BPERDW (MEMDW/8) // Bytes per Data Word if MEMDW=512 => BPERDW = 64, if MEMDW=64 => BPERDW = 16
85 
86 //------------------------------------ Declarations for DDR ----------------------------------------
87 
88 /* General memory Data Width is set as a parameter*/
89 /* 512-bit host AXI data width*/
90 #define MEMDW_512 512 // 512 Bus width in bits for cF DDR memory
91 typedef ap_uint<MEMDW_512> membus_512_t; /* 512-bit ddr memory access */
93 #define TOTMEMDW_512 100 //512b * 100 = 640B
94 
95 // The maximum number of cycles allowed to acknowledge a write to DDR (i.e. read the status stream)
96 #define CYCLES_UNTIL_TIMEOUT 0x0100
97 #define TYPICAL_DDR_LATENCY 4
98 #define DDR_LATENCY 52 // The latency cycles of cF DDR
99 #define EXTRA_DDR_LATENCY_DUE_II (64 + 8) // 8 is the write from input stream to local stream, 64 is read from local stream to DDR
100 
101 
102 void uppercase(
103 
104  ap_uint<32> *pi_rank,
105  ap_uint<32> *pi_size,
106  //------------------------------------------------------
107  //-- SHELL / This / Udp/TCP Interfaces
108  //------------------------------------------------------
109  stream<NetworkWord> &siSHL_This_Data,
110  stream<NetworkWord> &soTHIS_Shl_Data,
111  stream<NetworkMetaStream> &siNrc_meta,
112  stream<NetworkMetaStream> &soNrc_meta,
113  ap_uint<32> *po_rx_ports
114  #ifdef ENABLE_DDR
115  ,
116  //------------------------------------------------------
117  //-- SHELL / Role / Mem / Mp1 Interface
118  //------------------------------------------------------
121  #endif//ENABLE_DDR
122 );
123 
124 
125 #endif//_ROLE_UPPERCASE_H_
126 
127 
#define ENABLE_DDR
Definition: memtest.hpp:42
membus_512_t membus_t
Definition: memtest.hpp:92
ap_uint< 512 > membus_512_t
Definition: memtest.hpp:91
EchoCtrl
Definition: memtest.hpp:49
membus_t lcl_mem0[16384]
membus_t lcl_mem1[16384]
membus_512_t membus_t
Definition: uppercase.hpp:92
ap_uint< 512 > membus_512_t
Definition: uppercase.hpp:91
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
@ ECHO_STORE_FWD
Definition: uppercase.hpp:63
@ ECHO_OFF
Definition: uppercase.hpp:64
@ ECHO_PATH_THRU
Definition: uppercase.hpp:62