-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvolution.hpp
72 lines (57 loc) · 1.03 KB
/
convolution.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <cstdlib>
#include <string>
#include <cmath>
#include <ap_int.h>
#include <ap_axi_sdata.h>
#include <hls_stream.h>
using namespace std;
using namespace hls;
#define IFM_MAX 64
#define OFM_MAX 64
#define KERNEL 3
#define TN 16
#define TM 64
typedef signed char dtype;
union s8_s32
{
signed char union_s8[4];
signed int union_s32;
};
struct AXI_VAL_I{
dtype data[16];
};
struct AXI_VAL_O{
dtype data[16];
bool last;
};
struct BindingType{
dtype data[16];
};
struct Layer_Type{
int layer_id;
int RC_block_num;
int RC_block_size;
int RC_real_size;
int RC_out_size;
int CHI_block_num;
int CHI_block_size;
int CHI_real_size;
int CHO_block_num;
int CHO_block_size;
int CHO_real_size;
int kernel;
int stride;
float scaler;
bool is_yolo;
};
void convolution(
Layer_Type layer,
AXI_VAL_I * str_in_0, // HP0
AXI_VAL_I * str_in_1, // HP1
AXI_VAL_O * str_out_0, // HP2
AXI_VAL_O * str_out_1); // HP3