cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
Uppercase HLS

This is a subgroup of Uppercase accelerated function with only synthesizable (HLS) functions/classes. More...

Collaboration diagram for Uppercase HLS:

Files

file  uppercase.hpp
 The Role for a Uppercase Example application (UDP or TCP)
 
file  uppercase.cpp
 The Role for a Uppercase Example application (UDP or TCP)
 
file  uppercase.hpp
 The Role for a Uppercase Example application (UDP or TCP)
 
file  uppercase.cpp
 The Role for a Uppercase Example application (UDP or TCP)
 

Macros

#define ROLE_IS_UPPERCASE
 
#define WAIT_FOR_META   0
 
#define WAIT_FOR_STREAM_PAIR   1
 
#define PROCESSING_PACKET   2
 
#define UPPERCASE_RETURN_RESULTS   3
 
#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
 
#define MEMDW_512   512
 
#define TOTMEMDW_512   100
 
#define CYCLES_UNTIL_TIMEOUT   0x0100
 
#define TYPICAL_DDR_LATENCY   4
 
#define DDR_LATENCY   52
 
#define EXTRA_DDR_LATENCY_DUE_II   (64 + 8)
 
#define Data_t_in   ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>
 
#define Data_t_out   ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>
 
#define WAIT_FOR_META   0
 
#define WAIT_FOR_STREAM_PAIR   1
 
#define PROCESSING_PACKET   2
 
#define UPPERCASE_RETURN_RESULTS   3
 
#define PacketFsmType   uint8_t
 
#define FSM_WRITE_NEW_DATA   0
 
#define FSM_DONE   1
 
#define PortFsmType   uint8_t
 
#define FSM_PROCESSING_STOP   0
 
#define FSM_PROCESSING_START   1
 
#define ProcessingFsmType   uint8_t
 
#define DEFAULT_TX_PORT   2718
 
#define DEFAULT_RX_PORT   2718
 
#define MEMDW   64
 
#define BPERDW   (MEMDW/8)
 
#define MAX_NB_OF_ELMT_READ   16
 
#define MAX_NB_OF_WORDS_READ   (MAX_NB_OF_ELMT_READ*sizeof(mat_elmt_t)/BPERDW)
 
#define MAX_NB_OF_ELMT_PERDW   (BPERDW/sizeof(mat_elmt_t))
 
#define Data_t_in   ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>
 
#define Data_t_out   ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>
 

Typedefs

typedef ap_uint< 512 > membus_512_t
 
typedef membus_512_t membus_t
 
typedef char word_t[8]
 
typedef uint8_t mat_elmt_t
 
typedef char word_t[8]
 

Enumerations

enum  EchoCtrl {
  ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 ,
  ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 ,
  ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 ,
  ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 ,
  ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 ,
  ECHO_OFF = 2 , ECHO_STORE_FWD = 0 , ECHO_PATH_THRU = 1 , ECHO_CTRL_DISABLED = 0 ,
  ECHO_PATH_THRU = 1 , ECHO_STORE_FWD = 2 , ECHO_OFF = 3
}
 
enum  EchoCtrl {
  ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 ,
  ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 ,
  ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 ,
  ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 ,
  ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 ,
  ECHO_OFF = 2 , ECHO_STORE_FWD = 0 , ECHO_PATH_THRU = 1 , ECHO_CTRL_DISABLED = 0 ,
  ECHO_PATH_THRU = 1 , ECHO_STORE_FWD = 2 , ECHO_OFF = 3
}
 
enum  UppercaseCmd { STOP_CMD = 0 , START_CMD = 1 }
 

Functions

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. More...
 
void pPortAndDestionation (ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NodeId > &sDstNode_sig, ap_uint< 32 > *po_rx_ports)
 pPortAndDestionation - Setup the port and the destination rank. More...
 
void pRXPath (stream< NetworkWord > &siSHL_This_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &sRxtoTx_Meta, stream< NetworkWord > &sRxpToTxp_Data, NetworkMetaStream meta_tmp, unsigned int *processed_word_rx, unsigned int *processed_bytes_rx)
 Receive Path - From SHELL to THIS. More...
 
void pTXPath (stream< NetworkWord > &soTHIS_Shl_Data, stream< NetworkMetaStream > &soNrc_meta, stream< NetworkWord > &sRxpToTxp_Data, stream< NetworkMetaStream > &sRxtoTx_Meta, stream< NodeId > &sDstNode_sig, unsigned int *processed_word_tx, ap_uint< 32 > *pi_rank)
 Transmit Path - From THIS to SHELL. More...
 
void pRXPath (stream< NetworkWord > &siSHL_This_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &sRxtoTx_Meta, stream< NetworkWord > &sRxpToProcp_Data, NetworkMetaStream meta_tmp, bool *start_stop, unsigned int *processed_word_rx, unsigned int *processed_bytes_rx)
 Receive Path - From SHELL to THIS. More...
 
void pTHISProcessingData (stream< NetworkWord > &sRxpToProcp_Data, stream< NetworkWord > &sProcpToTxp_Data, bool *start_stop)
 THIS processing the data once recieved a start command. More...
 

Variables

uint8_t enqueueFSM = 0
 
uint8_t dequeueFSM = 0
 
uint8_t UppercaseFSM = 0
 
uint8_t enqueueFSM = 0
 
uint8_t dequeueFSM = 1
 
uint8_t UppercaseFSM = 0
 
uint8_t processingFSM = 0
 

Detailed Description

This is a subgroup of Uppercase accelerated function with only synthesizable (HLS) functions/classes.

Macro Definition Documentation

◆ BPERDW

#define BPERDW   (MEMDW/8)

Definition at line 94 of file uppercase.hpp.

◆ CYCLES_UNTIL_TIMEOUT

#define CYCLES_UNTIL_TIMEOUT   0x0100

Definition at line 96 of file uppercase.hpp.

◆ Data_t_in [1/2]

#define Data_t_in   ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>

Definition at line 51 of file uppercase.cpp.

◆ Data_t_in [2/2]

#define Data_t_in   ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>

Definition at line 51 of file uppercase.cpp.

◆ Data_t_out [1/2]

#define Data_t_out   ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>

Definition at line 52 of file uppercase.cpp.

◆ Data_t_out [2/2]

#define Data_t_out   ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>

Definition at line 52 of file uppercase.cpp.

◆ DDR_LATENCY

#define DDR_LATENCY   52

Definition at line 98 of file uppercase.hpp.

◆ DEFAULT_RX_PORT [1/2]

#define DEFAULT_RX_PORT   2718

Definition at line 80 of file uppercase.hpp.

◆ DEFAULT_RX_PORT [2/2]

#define DEFAULT_RX_PORT   2718

Definition at line 90 of file uppercase.hpp.

◆ DEFAULT_TX_PORT [1/2]

#define DEFAULT_TX_PORT   2718

Definition at line 79 of file uppercase.hpp.

◆ DEFAULT_TX_PORT [2/2]

#define DEFAULT_TX_PORT   2718

Definition at line 89 of file uppercase.hpp.

◆ EXTRA_DDR_LATENCY_DUE_II

#define EXTRA_DDR_LATENCY_DUE_II   (64 + 8)

Definition at line 99 of file uppercase.hpp.

◆ FSM_DONE [1/2]

#define FSM_DONE   1

Definition at line 76 of file uppercase.hpp.

◆ FSM_DONE [2/2]

#define FSM_DONE   1

Definition at line 82 of file uppercase.hpp.

◆ FSM_PROCESSING_START

#define FSM_PROCESSING_START   1

Definition at line 86 of file uppercase.hpp.

◆ FSM_PROCESSING_STOP

#define FSM_PROCESSING_STOP   0

Definition at line 85 of file uppercase.hpp.

◆ FSM_WRITE_NEW_DATA [1/2]

#define FSM_WRITE_NEW_DATA   0

Definition at line 75 of file uppercase.hpp.

◆ FSM_WRITE_NEW_DATA [2/2]

#define FSM_WRITE_NEW_DATA   0

Definition at line 81 of file uppercase.hpp.

◆ MAX_NB_OF_ELMT_PERDW

#define MAX_NB_OF_ELMT_PERDW   (BPERDW/sizeof(mat_elmt_t))

Definition at line 100 of file uppercase.hpp.

◆ MAX_NB_OF_ELMT_READ

#define MAX_NB_OF_ELMT_READ   16

Definition at line 96 of file uppercase.hpp.

◆ MAX_NB_OF_WORDS_READ

#define MAX_NB_OF_WORDS_READ   (MAX_NB_OF_ELMT_READ*sizeof(mat_elmt_t)/BPERDW)

Definition at line 99 of file uppercase.hpp.

◆ MEMDW

#define MEMDW   64

Definition at line 93 of file uppercase.hpp.

◆ MEMDW_512

#define MEMDW_512   512

Definition at line 90 of file uppercase.hpp.

◆ PacketFsmType [1/2]

#define PacketFsmType   uint8_t

Definition at line 73 of file uppercase.hpp.

◆ PacketFsmType [2/2]

#define PacketFsmType   uint8_t

Definition at line 79 of file uppercase.hpp.

◆ PortFsmType [1/2]

#define PortFsmType   uint8_t

Definition at line 77 of file uppercase.hpp.

◆ PortFsmType [2/2]

#define PortFsmType   uint8_t

Definition at line 83 of file uppercase.hpp.

◆ PROCESSING_PACKET [1/2]

#define PROCESSING_PACKET   2

Definition at line 70 of file uppercase.hpp.

◆ PROCESSING_PACKET [2/2]

#define PROCESSING_PACKET   2

Definition at line 76 of file uppercase.hpp.

◆ ProcessingFsmType

#define ProcessingFsmType   uint8_t

Definition at line 87 of file uppercase.hpp.

◆ ROLE_IS_UPPERCASE

#define ROLE_IS_UPPERCASE

Definition at line 57 of file uppercase.hpp.

◆ TOTMEMDW_512

#define TOTMEMDW_512   100

Definition at line 93 of file uppercase.hpp.

◆ TYPICAL_DDR_LATENCY

#define TYPICAL_DDR_LATENCY   4

Definition at line 97 of file uppercase.hpp.

◆ UPPERCASE_RETURN_RESULTS [1/2]

#define UPPERCASE_RETURN_RESULTS   3

Definition at line 71 of file uppercase.hpp.

◆ UPPERCASE_RETURN_RESULTS [2/2]

#define UPPERCASE_RETURN_RESULTS   3

Definition at line 77 of file uppercase.hpp.

◆ WAIT_FOR_META [1/2]

#define WAIT_FOR_META   0

Definition at line 68 of file uppercase.hpp.

◆ WAIT_FOR_META [2/2]

#define WAIT_FOR_META   0

Definition at line 74 of file uppercase.hpp.

◆ WAIT_FOR_STREAM_PAIR [1/2]

#define WAIT_FOR_STREAM_PAIR   1

Definition at line 69 of file uppercase.hpp.

◆ WAIT_FOR_STREAM_PAIR [2/2]

#define WAIT_FOR_STREAM_PAIR   1

Definition at line 75 of file uppercase.hpp.

Typedef Documentation

◆ mat_elmt_t

typedef uint8_t mat_elmt_t

Definition at line 97 of file uppercase.hpp.

◆ membus_512_t

typedef ap_uint< 512 > membus_512_t

Definition at line 91 of file uppercase.hpp.

◆ membus_t

Definition at line 92 of file uppercase.hpp.

◆ word_t [1/2]

typedef char word_t[8]

Definition at line 59 of file uppercase.cpp.

◆ word_t [2/2]

typedef char word_t[8]

Definition at line 60 of file uppercase.cpp.

Enumeration Type Documentation

◆ EchoCtrl [1/2]

enum EchoCtrl

SHELL/MMIO/EchoCtrl - Config Register

Enumerator
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_STORE_FWD 
ECHO_PATH_THRU 
ECHO_CTRL_DISABLED 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 

Definition at line 61 of file uppercase.hpp.

61  {
62  ECHO_PATH_THRU = 0,
63  ECHO_STORE_FWD = 1,
64  ECHO_OFF = 2
65 };
@ ECHO_STORE_FWD
Definition: uppercase.hpp:63
@ ECHO_OFF
Definition: uppercase.hpp:64
@ ECHO_PATH_THRU
Definition: uppercase.hpp:62

◆ EchoCtrl [2/2]

enum EchoCtrl

SHELL/MMIO/EchoCtrl - Config Register

Enumerator
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_STORE_FWD 
ECHO_PATH_THRU 
ECHO_CTRL_DISABLED 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 

Definition at line 59 of file uppercase.hpp.

59  {
60  ECHO_PATH_THRU = 0,
61  ECHO_STORE_FWD = 1,
62  ECHO_OFF = 2
63 };

◆ UppercaseCmd

Internal uppercase accelerator command

Enumerator
STOP_CMD 
START_CMD 

Definition at line 68 of file uppercase.hpp.

68  {
69  STOP_CMD = 0,
70  START_CMD = 1
71 };
@ STOP_CMD
Definition: uppercase.hpp:69
@ START_CMD
Definition: uppercase.hpp:70

Function Documentation

◆ pPortAndDestionation()

void pPortAndDestionation ( ap_uint< 32 > *  pi_rank,
ap_uint< 32 > *  pi_size,
stream< NodeId > &  sDstNode_sig,
ap_uint< 32 > *  po_rx_ports 
)

pPortAndDestionation - Setup the port and the destination rank.

Parameters
[in]pi_rank
[in]pi_size
[out]sDstNode_sig
[out]po_rx_ports
Returns
Nothing.

Definition at line 71 of file uppercase.cpp.

77 {
78  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
79 #pragma HLS INLINE
80  //-- STATIC VARIABLES (with RESET) ------------------------------------------
81  static PortFsmType port_fsm = FSM_WRITE_NEW_DATA;
82 #pragma HLS reset variable=port_fsm
83 
84 
85  switch(port_fsm)
86  {
87  default:
88  case FSM_WRITE_NEW_DATA:
89  //Triangle app needs to be reset to process new rank
90  if(!sDstNode_sig.full())
91  {
92  NodeId dst_rank = (*pi_rank + 1) % *pi_size;
93  printf("rank: %d; size: %d; \n", (int) *pi_rank, (int) *pi_size);
94  sDstNode_sig.write(dst_rank);
95  port_fsm = FSM_DONE;
96  }
97  break;
98  case FSM_DONE:
99  *po_rx_ports = 0x1; //currently work only with default ports...
100  break;
101  }
102 
103 }
#define FSM_WRITE_NEW_DATA
Definition: memtest.hpp:78
#define FSM_DONE
Definition: memtest.hpp:79
#define PortFsmType
Definition: memtest.hpp:80
ap_uint< 8 > NodeId
Definition: network.hpp:82
Here is the caller graph for this function:

◆ pRXPath() [1/2]

void pRXPath ( stream< NetworkWord > &  siSHL_This_Data,
stream< NetworkMetaStream > &  siNrc_meta,
stream< NetworkMetaStream > &  sRxtoTx_Meta,
stream< NetworkWord > &  sRxpToProcp_Data,
NetworkMetaStream  meta_tmp,
bool *  start_stop,
unsigned int *  processed_word_rx,
unsigned int *  processed_bytes_rx 
)

Receive Path - From SHELL to THIS.

Parameters
[in]siSHL_This_Data
[in]siNrc_meta
[out]sRxtoTx_Meta
[out]sRxpToProcp_Data
[out]start_stop
[out]meta_tmp
[out]processed_word
Returns
Nothing.

Definition at line 119 of file uppercase.cpp.

129 {
130  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
131  //#pragma HLS DATAFLOW interval=1
132  #pragma HLS INLINE
133  //-- LOCAL VARIABLES ------------------------------------------------------
134  NetworkWord netWord;
135  // word_t text;
136  //UppercaseCmd fsmCmd;
137  static bool start_stop_local = false;
138 #pragma HLS reset variable=start_stop_local
139 
140  *start_stop = start_stop_local;
141  switch(enqueueFSM)
142  {
143  case WAIT_FOR_META:
144  printf("DEBUG in pRXPath: enqueueFSM - WAIT_FOR_META, *processed_word_rx=%u, *processed_bytes_rx=%u\n",
145  *processed_word_rx, *processed_bytes_rx);
146  if ( !siNrc_meta.empty() && !sRxtoTx_Meta.full() )
147  {
148  meta_tmp = siNrc_meta.read();
149  meta_tmp.tlast = 1; //just to be sure...
150  sRxtoTx_Meta.write(meta_tmp);
152  }
153  // *start_stop = start_stop_local;
154  break;
155 
156  case PROCESSING_PACKET:
157  printf("DEBUG in pRXPath: enqueueFSM - PROCESSING_PACKET, *processed_word_rx=%u, *processed_bytes_rx=%u\n",
158  *processed_word_rx, *processed_bytes_rx);
159  //*start_stop = start_stop_local;
160 
161  if ( !siSHL_This_Data.empty() && !sRxpToProcp_Data.full() )
162  {
163  //-- Read incoming data chunk
164  netWord = siSHL_This_Data.read();
165 
166  switch(netWord.tdata)
167  {
168  case(START_CMD):
169  start_stop_local=true;
170  *start_stop=true;
171  netWord.tdata=1;//28506595412;//"B_ACK";
172  break;
173  case(STOP_CMD):
174  start_stop_local=false;
175  *start_stop=false;
176  netWord.tdata=0;//358080398155;//"S_ACK" string
177  netWord.tlast = 1;
178  break;
179  default:
180  if (start_stop_local)
181  {
182  //some data manipulation here
183  }
184  break;
185 
186  }
187  sRxpToProcp_Data.write(netWord);
188  if(netWord.tlast == 1)
189  {
191  }
192  }
193  break;
194  }
195 
196 
197 }
#define PROCESSING_PACKET
Definition: memtest.hpp:73
#define WAIT_FOR_META
Definition: memtest.hpp:71
uint8_t enqueueFSM
Definition: uppercase.cpp:54
ap_uint< 1 > tlast
Definition: network.hpp:111
ap_uint< 64 > tdata
Definition: network.hpp:49
ap_uint< 1 > tlast
Definition: network.hpp:51

◆ pRXPath() [2/2]

void pRXPath ( stream< NetworkWord > &  siSHL_This_Data,
stream< NetworkMetaStream > &  siNrc_meta,
stream< NetworkMetaStream > &  sRxtoTx_Meta,
stream< NetworkWord > &  sRxpToTxp_Data,
NetworkMetaStream  meta_tmp,
unsigned int *  processed_word_rx,
unsigned int *  processed_bytes_rx 
)

Receive Path - From SHELL to THIS.

Parameters
[in]siSHL_This_Data
[in]siNrc_meta
[out]sRxtoTx_Meta
[out]img_in_axi_stream
[out]meta_tmp
[out]processed_word
Returns
Nothing.

Definition at line 117 of file uppercase.cpp.

134 {
135  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
136  //#pragma HLS DATAFLOW interval=1
137  #pragma HLS INLINE off
138  //-- LOCAL VARIABLES ------------------------------------------------------
139  NetworkWord netWord;
140  word_t text;
141 
142  switch(enqueueFSM)
143  {
144  case WAIT_FOR_META:
145  printf("DEBUG in pRXPath: enqueueFSM - WAIT_FOR_META, *processed_word_rx=%u, *processed_bytes_rx=%u\n",
146  *processed_word_rx, *processed_bytes_rx);
147  if ( !siNrc_meta.empty() && !sRxtoTx_Meta.full() )
148  {
149  meta_tmp = siNrc_meta.read();
150  meta_tmp.tlast = 1; //just to be sure...
151  sRxtoTx_Meta.write(meta_tmp);
153  }
154  break;
155 
156  case PROCESSING_PACKET:
157  printf("DEBUG in pRXPath: enqueueFSM - PROCESSING_PACKET, *processed_word_rx=%u, *processed_bytes_rx=%u\n",
158  *processed_word_rx, *processed_bytes_rx);
159  if ( !siSHL_This_Data.empty() && !sRxpToTxp_Data.full() )
160  {
161  //-- Read incoming data chunk
162  netWord = siSHL_This_Data.read();
163 
164 
165  #ifdef ENABLE_DDR
166  membus_t tmp_text;
167  ap_uint<64> tmp_64_bytes;
168  tmp_text.range(63,0) = netWord.tdata;
169  tmp_text.range(511,64) = 0;
170  lcl_mem0[0]=tmp_text;
171  tmp_text=lcl_mem0[0];
172  tmp_64_bytes = tmp_text.range(63,0);
173  memcpy(&text, &tmp_64_bytes, 64/8);
174  //#ifndef __SYNTHESIS__
175  printf("%s\n",text);
176  // #endif
177  #else
178  /* Read in one word_t */
179  memcpy((char*) text, &netWord.tdata, 64/8);
180  #endif
181 
182  /* Convert lower cases to upper cases byte per byte */
183  uppercase_conversion:
184  for (unsigned int i = 0; i < sizeof(text); i++ ) {
185  //#pragma HLS PIPELINE
186  //#pragma HLS UNROLL
187 
188  if (text[i] >= 'a' && text[i] <= 'z')
189  text[i] = text[i] - ('a' - 'A');
190  }
191  memcpy(&netWord.tdata, (char*) text, 64/8);
192 
193  sRxpToTxp_Data.write(netWord);
194  if(netWord.tlast == 1)
195  {
197  }
198  }
199  break;
200  }
201 
202 
203 }
membus_512_t membus_t
Definition: memtest.hpp:92
membus_t lcl_mem0[16384]
char word_t[8]
Definition: uppercase.cpp:59
Here is the caller graph for this function:

◆ pTHISProcessingData()

void pTHISProcessingData ( stream< NetworkWord > &  sRxpToProcp_Data,
stream< NetworkWord > &  sProcpToTxp_Data,
bool *  start_stop 
)

THIS processing the data once recieved a start command.

Parameters
[in]sRxpToProcp_Data
[out]sProcpToTxp_Data
[in]start_stop
Returns
Nothing.

Definition at line 209 of file uppercase.cpp.

213  {
214 
215  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
216 #pragma HLS INLINE off
217  //-- LOCAL VARIABLES ------------------------------------------------------
218  NetworkWord netWord;
219  word_t text;
220 
221  switch(processingFSM)
222  {
223  case FSM_PROCESSING_STOP:
224  printf("DEBUG proc FSM, I am in the stop state\n");
225  if ( !sRxpToProcp_Data.empty() && !sProcpToTxp_Data.full() )
226  {
227  //-- Read incoming data chunk
228  netWord = sRxpToProcp_Data.read();
229  sProcpToTxp_Data.write(netWord);
230  }
231  if ( *start_stop )
232  {
234  }
235  break;
236 
238  if ( !sRxpToProcp_Data.empty() && !sProcpToTxp_Data.full() )
239  {
240  //-- Read incoming data chunk
241  if ( *start_stop ) {
242  netWord = sRxpToProcp_Data.read();
243  /* Read in one word_t */
244  memcpy((char*) text, &netWord.tdata, 64/8);
245 
246  /* Convert lower cases to upper cases byte per byte */
247  uppercase_conversion:
248  for (unsigned int i = 0; i < sizeof(text); i++ ) {
249 
250  if (text[i] >= 'a' && text[i] <= 'z')
251  text[i] = text[i] - ('a' - 'A');
252  }
253  memcpy(&netWord.tdata, (char*) text, 64/8);
254 
255  sProcpToTxp_Data.write(netWord);
256  if(netWord.tlast == 1)
257  {
259  }
260  } else {
262  }
263 
264  }
265  break;
266  }
267  };
#define FSM_PROCESSING_STOP
#define FSM_PROCESSING_START
uint8_t processingFSM
Definition: uppercase.cpp:57

◆ pTXPath()

void pTXPath ( stream< NetworkWord > &  soTHIS_Shl_Data,
stream< NetworkMetaStream > &  soNrc_meta,
stream< NetworkWord > &  sProcpToTxp_Data,
stream< NetworkMetaStream > &  sRxtoTx_Meta,
stream< NodeId > &  sDstNode_sig,
unsigned int *  processed_word_tx,
ap_uint< 32 > *  pi_rank 
)

Transmit Path - From THIS to SHELL.

Parameters
[out]soTHIS_Shl_Data
[out]soNrc_meta
[in]sRxpToTxp_Data
[in]sRxtoTx_Meta
[in]pi_rank
[in]sDstNode_sig
Returns
Nothing.
Parameters
[out]soTHIS_Shl_Data
[out]soNrc_meta
[in]sProcpToTxp_Data
[in]sRxtoTx_Meta
[in]pi_rank
[in]sDstNode_sig
Returns
Nothing.

Definition at line 220 of file uppercase.cpp.

229 {
230  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
231  //#pragma HLS DATAFLOW interval=1
232  #pragma HLS INLINE
233  //-- LOCAL VARIABLES ------------------------------------------------------
234  NetworkWord netWordTx;
235  NetworkMeta meta_in = NetworkMeta();
236  static NodeId dst_rank;
237 
238  switch(dequeueFSM)
239  {
240  case WAIT_FOR_META:
241  if(!sDstNode_sig.empty())
242  {
243  dst_rank = sDstNode_sig.read();
245  //Triangle app needs to be reset to process new rank
246  }
247  break;
249  printf("DEBUG in pTXPath: dequeueFSM=%d - WAIT_FOR_STREAM_PAIR, *processed_word_tx=%u\n",
250  dequeueFSM, *processed_word_tx);
251  //-- Forward incoming chunk to SHELL
252  *processed_word_tx = 0;
253 
254  /*
255  printf("!sRxpToTxp_Data.empty()=%d\n", !sRxpToTxp_Data.empty());
256  printf("!sRxtoTx_Meta.empty()=%d\n", !sRxtoTx_Meta.empty());
257  printf("!soTHIS_Shl_Data.full()=%d\n", !soTHIS_Shl_Data.full());
258  printf("!soNrc_meta.full()=%d\n", !soNrc_meta.full());
259  */
260 
261  if (( !sRxpToTxp_Data.empty() && !sRxtoTx_Meta.empty()
262  && !soTHIS_Shl_Data.full() && !soNrc_meta.full() ))
263  {
264  netWordTx = sRxpToTxp_Data.read();
265 
266  // in case MTU=8 ensure tlast is set in WAIT_FOR_STREAM_PAIR and don't visit PROCESSING_PACKET
267  if (PACK_SIZE == 8)
268  {
269  netWordTx.tlast = 1;
270  }
271  soTHIS_Shl_Data.write(netWordTx);
272 
273  meta_in = sRxtoTx_Meta.read().tdata;
274  NetworkMetaStream meta_out_stream = NetworkMetaStream();
275  meta_out_stream.tlast = 1;
276  meta_out_stream.tkeep = 0xFF; //just to be sure
277 
278  meta_out_stream.tdata.dst_rank = dst_rank;
279  //meta_out_stream.tdata.dst_port = DEFAULT_TX_PORT;
280  meta_out_stream.tdata.src_rank = (NodeId) *pi_rank;
281  //meta_out_stream.tdata.src_port = DEFAULT_RX_PORT;
282  //printf("rank: %d; size: %d; \n", (int) *pi_rank, (int) *pi_size);
283  //printf("meat_out.dst_rank: %d\n", (int) meta_out_stream.tdata.dst_rank);
284  meta_out_stream.tdata.dst_port = meta_in.src_port;
285  meta_out_stream.tdata.src_port = meta_in.dst_port;
286 
287  //meta_out_stream.tdata.len = meta_in.len;
288  soNrc_meta.write(meta_out_stream);
289 
290  (*processed_word_tx)++;
291 
292  if(netWordTx.tlast != 1)
293  {
295  }
296  }
297  break;
298 
299  case PROCESSING_PACKET:
300  printf("DEBUG in pTXPath: dequeueFSM=%d - PROCESSING_PACKET, *processed_word_tx=%u\n",
301  dequeueFSM, *processed_word_tx);
302  if( !sRxpToTxp_Data.empty() && !soTHIS_Shl_Data.full())
303  {
304  netWordTx = sRxpToTxp_Data.read();
305 
306  // This is a normal termination of the axi stream from vitis functions
307  if(netWordTx.tlast == 1)
308  {
310  }
311 
312  // This is our own termination based on the custom MTU we have set in PACK_SIZE.
313  // TODO: We can map PACK_SIZE to a dynamically assigned value either through MMIO or header
314  // in order to have a functional bitstream for any MTU size
315  (*processed_word_tx)++;
316  if (((*processed_word_tx)*8) % PACK_SIZE == 0)
317  {
318  netWordTx.tlast = 1;
320  }
321 
322  soTHIS_Shl_Data.write(netWordTx);
323  }
324  break;
325  }
326 }
#define WAIT_FOR_STREAM_PAIR
Definition: memtest.hpp:72
#define PACK_SIZE
Definition: config.h:51
uint8_t dequeueFSM
Definition: uppercase.cpp:55
ap_uint< 8 > tkeep
Definition: network.hpp:110
NetworkMeta tdata
Definition: network.hpp:109
NodeId dst_rank
Definition: network.hpp:95
NodeId src_rank
Definition: network.hpp:97
NrcPort src_port
Definition: network.hpp:98
NrcPort dst_port
Definition: network.hpp:96
Here is the caller graph for this function:

◆ uppercase()

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.

Deprecated:
This functions is using deprecated AXI stream interface
Returns
Nothing.
Deprecated:
This functions is using deprecated AXI stream interface
Returns
Nothing.

Definition at line 335 of file uppercase.cpp.

356 {
357 
358  //-- DIRECTIVES FOR THE BLOCK ---------------------------------------------
359  //#pragma HLS INTERFACE ap_ctrl_none port=return
360 
361  //#pragma HLS INTERFACE ap_stable port=piSHL_This_MmioEchoCtrl
362 
363 #pragma HLS INTERFACE axis register both port=siSHL_This_Data
364 #pragma HLS INTERFACE axis register both port=soTHIS_Shl_Data
365 
366 #pragma HLS INTERFACE axis register both port=siNrc_meta
367 #pragma HLS INTERFACE axis register both port=soNrc_meta
368 
369 #pragma HLS INTERFACE ap_ovld register port=po_rx_ports name=poROL_NRC_Rx_ports
370 #pragma HLS INTERFACE ap_stable register port=pi_rank name=piFMC_ROL_rank
371 #pragma HLS INTERFACE ap_stable register port=pi_size name=piFMC_ROL_size
372 
373 #ifdef ENABLE_DDR
374 
375 const unsigned int ddr_mem_depth = TOTMEMDW_512;
376 const unsigned int ddr_latency = DDR_LATENCY;
377 const unsigned int num_outstanding_transactions = 256;
378 const unsigned int MAX_BURST_LENGTH_512=64;//Theoretically is 64, 64*512bit = 4096KBytes;
379 
380 // Mapping LCL_MEM0 interface to moMEM_Mp1 channel
381 #pragma HLS INTERFACE m_axi depth=ddr_mem_depth port=lcl_mem0 bundle=moMEM_Mp1\
382  max_read_burst_length=MAX_BURST_LENGTH_512 max_write_burst_length=MAX_BURST_LENGTH_512 offset=direct \
383  num_read_outstanding=num_outstanding_transactions num_write_outstanding=num_outstanding_transactions
384  // latency=ddr_latency
385 
386 // Mapping LCL_MEM1 interface to moMEM_Mp1 channel
387 #pragma HLS INTERFACE m_axi depth=ddr_mem_depth port=lcl_mem1 bundle=moMEM_Mp1 \
388  max_read_burst_length=MAX_BURST_LENGTH_512 max_write_burst_length=MAX_BURST_LENGTH_512 offset=direct \
389  num_read_outstanding=num_outstanding_transactions num_write_outstanding=num_outstanding_transactions
390  //latency=ddr_latency
391 
392 #endif
393 
394  //-- LOCAL VARIABLES ------------------------------------------------------
395  static stream<NetworkWord> sRxpToTxp_Data("sRxpToTxP_Data"); // FIXME: works even with no static
397  static stream<NetworkMetaStream> sRxtoTx_Meta("sRxtoTx_Meta");
398  static unsigned int processed_word_rx;
399  static unsigned int processed_bytes_rx;
400  static unsigned int processed_word_tx;
401  //*po_rx_ports = 0x1; //currently work only with default ports...
402  static stream<NodeId> sDstNode_sig ("sDstNode_sig");
403 
404 
405 
406  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
407 #pragma HLS DATAFLOW
408 #pragma HLS reset variable=enqueueFSM
409 #pragma HLS reset variable=dequeueFSM
410 #pragma HLS reset variable=UppercaseFSM
411 #pragma HLS reset variable=processed_word_rx
412 #pragma HLS reset variable=processed_word_tx
413 
414 
415 
416 #ifdef USE_HLSLIB_DATAFLOW
432  // Dataflow functions running in parallel
433  HLSLIB_DATAFLOW_INIT();
434 
435  HLSLIB_DATAFLOW_FUNCTION(pRXPath,
436  siSHL_This_Data,
437  siNrc_meta,
438  sRxtoTx_Meta,
439  meta_tmp,
440  sRxpToTxp_Data,
441  &processed_word_rx,
442  &processed_bytes_rx);
443 
444  HLSLIB_DATAFLOW_FUNCTION(pTXPath,
445  soTHIS_Shl_Data,
446  soNrc_meta,
447  sRxpToTxp_Data,
448  sRxtoTx_Meta,
449  &processed_word_tx,
450  pi_rank,
451  pi_size);
452 
453  HLSLIB_DATAFLOW_FINALIZE();
454 
455 #else // !USE_HLSLIB_DATAFLOW
456 
458  pi_rank,
459  pi_size,
460  sDstNode_sig,
461  po_rx_ports);
462 
463  pRXPath(
464  siSHL_This_Data,
465  siNrc_meta,
466  sRxtoTx_Meta,
467  sRxpToTxp_Data,
468  meta_tmp,
469  &processed_word_rx,
470  &processed_bytes_rx
471  #ifdef ENABLE_DDR
472  ,
473  //------------------------------------------------------
474  //-- SHELL / Role / Mem / Mp1 Interface
475  //------------------------------------------------------
476  lcl_mem0,
477  lcl_mem1
478  #endif
479  );
480 
481  pTXPath(
482  soTHIS_Shl_Data,
483  soNrc_meta,
484  sRxpToTxp_Data,
485  sRxtoTx_Meta,
486  sDstNode_sig,
487  &processed_word_tx,
488  pi_rank);
489 #endif // USE_HLSLIB_DATAFLOW
490 }
#define DDR_LATENCY
Definition: memtest.hpp:98
#define ENABLE_DDR
Definition: memtest.hpp:42
#define TOTMEMDW_512
Definition: memtest.hpp:93
membus_t lcl_mem1[16384]
void pPortAndDestionation(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NodeId > &sDstNode_sig, ap_uint< 32 > *po_rx_ports)
pPortAndDestionation - Setup the port and the destination rank.
Definition: uppercase.cpp:71
void pRXPath(stream< NetworkWord > &siSHL_This_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &sRxtoTx_Meta, stream< NetworkWord > &sRxpToTxp_Data, NetworkMetaStream meta_tmp, unsigned int *processed_word_rx, unsigned int *processed_bytes_rx)
Receive Path - From SHELL to THIS.
Definition: uppercase.cpp:117
void pTXPath(stream< NetworkWord > &soTHIS_Shl_Data, stream< NetworkMetaStream > &soNrc_meta, stream< NetworkWord > &sRxpToTxp_Data, stream< NetworkMetaStream > &sRxtoTx_Meta, stream< NodeId > &sDstNode_sig, unsigned int *processed_word_tx, ap_uint< 32 > *pi_rank)
Transmit Path - From THIS to SHELL.
Definition: uppercase.cpp:220
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ dequeueFSM [1/2]

uint8_t dequeueFSM = 0

Definition at line 55 of file uppercase.cpp.

◆ dequeueFSM [2/2]

uint8_t dequeueFSM = 1

Definition at line 55 of file uppercase.cpp.

◆ enqueueFSM [1/2]

uint8_t enqueueFSM = 0

Definition at line 54 of file uppercase.cpp.

◆ enqueueFSM [2/2]

uint8_t enqueueFSM = 0

Definition at line 54 of file uppercase.cpp.

◆ processingFSM

uint8_t processingFSM = 0

Definition at line 57 of file uppercase.cpp.

◆ UppercaseFSM [1/2]

uint8_t UppercaseFSM = 0

Definition at line 56 of file uppercase.cpp.

◆ UppercaseFSM [2/2]

uint8_t UppercaseFSM = 0

Definition at line 56 of file uppercase.cpp.