cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
gammacorrection.hpp
Go to the documentation of this file.
1 
22 #ifndef _ROLE_GAMMACORRECTION_H_
23 #define _ROLE_GAMMACORRECTION_H_
24 
25 #include <stdio.h>
26 #include <iostream>
27 #include <fstream>
28 #include <string>
29 #include <math.h>
30 #include <hls_stream.h>
31 #include "ap_int.h"
32 #include <stdint.h>
33 
34 #include "network.hpp"
35 
36 using namespace hls;
37 
38 
39 #define WAIT_FOR_META 0
40 #define WAIT_FOR_STREAM_PAIR 1
41 #define PROCESSING_PACKET 2
42 #define GAMMACORRECTION_RETURN_RESULTS 3
43 
44 #define PacketFsmType uint8_t
45 
46 
47 #define DEFAULT_TX_PORT 2718
48 #define DEFAULT_RX_PORT 2718
49 
50 
51 #define MEMDW 64 // 512 or 128 or 64 // Bus width in bits for Host memory
52 #define BPERDW (MEMDW/8) // Bytes per Data Word if MEMDW=512 => BPERDW = 64, if MEMDW=64 => BPERDW = 16
53 
54 #define MAX_NB_OF_ELMT_READ 16
55 typedef uint8_t mat_elmt_t; // change to float or double depending on your needs
56 
57 #define MAX_NB_OF_WORDS_READ (MAX_NB_OF_ELMT_READ*sizeof(mat_elmt_t)/BPERDW) // =2 if double =1 if float
58 #define MAX_NB_OF_ELMT_PERDW (BPERDW/sizeof(mat_elmt_t)) // =8 if double =16 if float
59 
60 
61 void gammacorrection(
62 
63  ap_uint<32> *pi_rank,
64  ap_uint<32> *pi_size,
65  //------------------------------------------------------
66  //-- SHELL / This / Udp/TCP Interfaces
67  //------------------------------------------------------
68  stream<NetworkWord> &siSHL_This_Data,
69  stream<NetworkWord> &soTHIS_Shl_Data,
70  stream<NetworkMetaStream> &siNrc_meta,
71  stream<NetworkMetaStream> &soNrc_meta,
72  ap_uint<32> *po_rx_ports
73 );
74 
75 
76 #endif
77 
78 
void gammacorrection(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 Gammacorrection Application directives.
uint8_t mat_elmt_t