forked from dillonhuff/clockwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplex_mem_pond_input_compute.h
More file actions
59 lines (42 loc) · 2.75 KB
/
complex_mem_pond_input_compute.h
File metadata and controls
59 lines (42 loc) · 2.75 KB
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
#pragma once
#include "hw_classes.h"
#include "clockwork_standard_compute_units.h"
//store is: input_cgra.stencil(0, input_cgra_s0_x, input_cgra_s0_y) = input_host.stencil(0, input_cgra_s0_x, input_cgra_s0_y)
hw_uint<16> hcompute_input_cgra_stencil(hw_uint<16>& input_host_stencil) {
int16_t _input_host_stencil_1 = (int16_t) input_host_stencil.extract<0, 15>();
return _input_host_stencil_1;
}
//store is: kernel_cgra.stencil(0, 0, kernel_cgra_s0_x, kernel_cgra_s0_y) = kernel_host.stencil(0, 0, kernel_cgra_s0_x, kernel_cgra_s0_y)
hw_uint<16> hcompute_kernel_cgra_stencil(hw_uint<16>& kernel_host_stencil) {
int16_t _kernel_host_stencil_1 = (int16_t) kernel_host_stencil.extract<0, 15>();
return _kernel_host_stencil_1;
}
//store is: output_cgra.stencil(0, output_cgra_s0_x, output_cgra_s0_y) = (int16)0
hw_uint<16> hcompute_output_cgra_stencil() {
int16_t _664 = (int16_t)(0);
return _664;
}
//store is: input_pond.stencil(0, ((input_pond_s0_x + output_cgra_s1_x) - output_cgra_s1_x), ((input_pond_s0_y + output_cgra_s1_y) - output_cgra_s1_y)) = input_cgra.stencil(0, (input_pond_s0_x + output_cgra_s1_x), (input_pond_s0_y + output_cgra_s1_y))
hw_uint<16> hcompute_input_pond_stencil(hw_uint<16>& input_cgra_stencil) {
int16_t _input_cgra_stencil_1 = (int16_t) input_cgra_stencil.extract<0, 15>();
return _input_cgra_stencil_1;
}
//store is: kernel_pond.stencil(0, 0, kernel_pond_s0_x, kernel_pond_s0_y) = kernel_cgra.stencil(0, 0, kernel_pond_s0_x, kernel_pond_s0_y)
hw_uint<16> hcompute_kernel_pond_stencil(hw_uint<16>& kernel_cgra_stencil) {
int16_t _kernel_cgra_stencil_1 = (int16_t) kernel_cgra_stencil.extract<0, 15>();
return _kernel_cgra_stencil_1;
}
//store is: output_cgra.stencil(0, output_cgra_s1_x, output_cgra_s1_y) = (output_cgra.stencil(0, output_cgra_s1_x, output_cgra_s1_y) + (kernel_pond.stencil(0, 0, output_cgra_s1_r_x, output_cgra_s1_r_y)*input_pond.stencil(0, output_cgra_s1_r_x, output_cgra_s1_r_y)))
hw_uint<16> hcompute_output_cgra_stencil_1(hw_uint<16>& input_pond_stencil, hw_uint<16>& kernel_pond_stencil, hw_uint<16>& output_cgra_stencil) {
int16_t _input_pond_stencil_1 = (int16_t) input_pond_stencil.extract<0, 15>();
int16_t _kernel_pond_stencil_1 = (int16_t) kernel_pond_stencil.extract<0, 15>();
int16_t _output_cgra_stencil_1 = (int16_t) output_cgra_stencil.extract<0, 15>();
int16_t _673 = _kernel_pond_stencil_1 * _input_pond_stencil_1;
int16_t _674 = _output_cgra_stencil_1 + _673;
return _674;
}
//store is: hw_output.stencil(0, hw_output_s0_x_xi, hw_output_s0_y_yi) = output_cgra.stencil(0, hw_output_s0_x_xi, hw_output_s0_y_yi)
hw_uint<16> hcompute_hw_output_stencil(hw_uint<16>& output_cgra_stencil) {
int16_t _output_cgra_stencil_2 = (int16_t) output_cgra_stencil.extract<0, 15>();
return _output_cgra_stencil_2;
}