-
Notifications
You must be signed in to change notification settings - Fork 12
/
bc_repeat_compute.h
140 lines (109 loc) · 8.39 KB
/
bc_repeat_compute.h
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#pragma once
#include "hw_classes.h"
#include "clockwork_standard_compute_units.h"
//store is: hw_input_global_wrapper.stencil(hw_input_global_wrapper_s0_x, hw_input_global_wrapper_s0_y) = hw_input.stencil(hw_input_global_wrapper_s0_x, hw_input_global_wrapper_s0_y)
hw_uint<16> hcompute_hw_input_global_wrapper_stencil(hw_uint<16>& hw_input_stencil) {
int16_t _hw_input_stencil_1 = (int16_t) hw_input_stencil.extract<0, 15>();
return _hw_input_stencil_1;
}
//store is: repeat_edge.stencil((repeat_edge_s0_x + 1), 0) = hw_input_global_wrapper.stencil(max(min(repeat_edge_s0_x, 63), 0), 0)
hw_uint<16> hcompute_repeat_edge_stencil(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_1 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_1;
}
//store is: repeat_edge.stencil(0, (repeat_edge_s0_y + 1)) = hw_input_global_wrapper.stencil(0, repeat_edge_s0_y)
hw_uint<16> hcompute_repeat_edge_stencil_1(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_2 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_2;
}
//store is: repeat_edge.stencil((repeat_edge_s0_x_1 + 1), (repeat_edge_s0_y + 1)) = hw_input_global_wrapper.stencil(repeat_edge_s0_x_1, repeat_edge_s0_y)
hw_uint<16> hcompute_repeat_edge_stencil_2(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_3 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_3;
}
//store is: repeat_edge.stencil(65, (repeat_edge_s0_y + 1)) = hw_input_global_wrapper.stencil(63, repeat_edge_s0_y)
hw_uint<16> hcompute_repeat_edge_stencil_3(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_4 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_4;
}
//store is: repeat_edge.stencil((repeat_edge_s0_x_2 + 1), 65) = hw_input_global_wrapper.stencil(max(min(repeat_edge_s0_x_2, 63), 0), 63)
hw_uint<16> hcompute_repeat_edge_stencil_4(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_5 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_5;
}
//store is: repeat_image.stencil((repeat_image_s0_x + 1), 0) = hw_input_global_wrapper.stencil(select(((64 <= repeat_image_s0_x) || (repeat_image_s0_x < 0)), (repeat_image_s0_x % 64), max(min(repeat_image_s0_x, 63), 0)), 63)
hw_uint<16> hcompute_repeat_image_stencil(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_6 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_6;
}
//store is: repeat_image.stencil(0, (repeat_image_s0_y + 1)) = hw_input_global_wrapper.stencil(63, repeat_image_s0_y)
hw_uint<16> hcompute_repeat_image_stencil_1(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_7 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_7;
}
//store is: repeat_image.stencil((repeat_image_s0_x_1 + 1), (repeat_image_s0_y + 1)) = hw_input_global_wrapper.stencil(repeat_image_s0_x_1, repeat_image_s0_y)
hw_uint<16> hcompute_repeat_image_stencil_2(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_8 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_8;
}
//store is: repeat_image.stencil(65, (repeat_image_s0_y + 1)) = hw_input_global_wrapper.stencil(0, repeat_image_s0_y)
hw_uint<16> hcompute_repeat_image_stencil_3(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_9 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_9;
}
//store is: repeat_image.stencil((repeat_image_s0_x_2 + 1), 65) = hw_input_global_wrapper.stencil(select(((64 <= repeat_image_s0_x_2) || (repeat_image_s0_x_2 < 0)), (repeat_image_s0_x_2 % 64), max(min(repeat_image_s0_x_2, 63), 0)), 0)
hw_uint<16> hcompute_repeat_image_stencil_4(hw_uint<16>& hw_input_global_wrapper_stencil) {
int16_t _hw_input_global_wrapper_stencil_10 = (int16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
return _hw_input_global_wrapper_stencil_10;
}
//store is: conv.stencil(conv_s0_x, conv_s0_y) = (int16)0
hw_uint<16> hcompute_conv_stencil() {
int16_t _297 = (int16_t)(0);
return _297;
}
//store is: conv.stencil(conv_s1_x, conv_s1_y) = (repeat_image.stencil((conv_s1_x + 2), (conv_s1_y + 2)) + (repeat_edge.stencil((conv_s1_x + 2), (conv_s1_y + 2)) + (repeat_image.stencil((conv_s1_x + 1), (conv_s1_y + 2)) + (repeat_edge.stencil((conv_s1_x + 1), (conv_s1_y + 2)) + (repeat_image.stencil(conv_s1_x, (conv_s1_y + 2)) + (repeat_edge.stencil(conv_s1_x, (conv_s1_y + 2)) + (repeat_image.stencil((conv_s1_x + 2), (conv_s1_y + 1)) + (repeat_edge.stencil((conv_s1_x + 2), (conv_s1_y + 1)) + (repeat_image.stencil((conv_s1_x + 1), (conv_s1_y + 1)) + (repeat_edge.stencil((conv_s1_x + 1), (conv_s1_y + 1)) + (repeat_image.stencil(conv_s1_x, (conv_s1_y + 1)) + (repeat_edge.stencil(conv_s1_x, (conv_s1_y + 1)) + (repeat_image.stencil((conv_s1_x + 2), conv_s1_y) + (repeat_edge.stencil((conv_s1_x + 2), conv_s1_y) + (repeat_image.stencil((conv_s1_x + 1), conv_s1_y) + (repeat_edge.stencil((conv_s1_x + 1), conv_s1_y) + (repeat_image.stencil(conv_s1_x, conv_s1_y) + (conv.stencil(conv_s1_x, conv_s1_y) + repeat_edge.stencil(conv_s1_x, conv_s1_y)))))))))))))))))))
hw_uint<16> hcompute_conv_stencil_1(hw_uint<16>& conv_stencil, hw_uint<144>& repeat_edge_stencil, hw_uint<144>& repeat_image_stencil) {
int16_t _conv_stencil_1 = (int16_t) conv_stencil.extract<0, 15>();
int16_t _repeat_edge_stencil_1 = (int16_t) repeat_edge_stencil.extract<0, 15>();
int16_t _repeat_edge_stencil_2 = (int16_t) repeat_edge_stencil.extract<16, 31>();
int16_t _repeat_edge_stencil_3 = (int16_t) repeat_edge_stencil.extract<32, 47>();
int16_t _repeat_edge_stencil_4 = (int16_t) repeat_edge_stencil.extract<48, 63>();
int16_t _repeat_edge_stencil_5 = (int16_t) repeat_edge_stencil.extract<64, 79>();
int16_t _repeat_edge_stencil_6 = (int16_t) repeat_edge_stencil.extract<80, 95>();
int16_t _repeat_edge_stencil_7 = (int16_t) repeat_edge_stencil.extract<96, 111>();
int16_t _repeat_edge_stencil_8 = (int16_t) repeat_edge_stencil.extract<112, 127>();
int16_t _repeat_edge_stencil_9 = (int16_t) repeat_edge_stencil.extract<128, 143>();
int16_t _repeat_image_stencil_1 = (int16_t) repeat_image_stencil.extract<0, 15>();
int16_t _repeat_image_stencil_2 = (int16_t) repeat_image_stencil.extract<16, 31>();
int16_t _repeat_image_stencil_3 = (int16_t) repeat_image_stencil.extract<32, 47>();
int16_t _repeat_image_stencil_4 = (int16_t) repeat_image_stencil.extract<48, 63>();
int16_t _repeat_image_stencil_5 = (int16_t) repeat_image_stencil.extract<64, 79>();
int16_t _repeat_image_stencil_6 = (int16_t) repeat_image_stencil.extract<80, 95>();
int16_t _repeat_image_stencil_7 = (int16_t) repeat_image_stencil.extract<96, 111>();
int16_t _repeat_image_stencil_8 = (int16_t) repeat_image_stencil.extract<112, 127>();
int16_t _repeat_image_stencil_9 = (int16_t) repeat_image_stencil.extract<128, 143>();
int16_t _300 = _conv_stencil_1 + _repeat_edge_stencil_9;
int16_t _301 = _repeat_image_stencil_9 + _300;
int16_t _302 = _repeat_edge_stencil_8 + _301;
int16_t _303 = _repeat_image_stencil_8 + _302;
int16_t _304 = _repeat_edge_stencil_7 + _303;
int16_t _305 = _repeat_image_stencil_7 + _304;
int16_t _306 = _repeat_edge_stencil_6 + _305;
int16_t _307 = _repeat_image_stencil_6 + _306;
int16_t _308 = _repeat_edge_stencil_5 + _307;
int16_t _309 = _repeat_image_stencil_5 + _308;
int16_t _310 = _repeat_edge_stencil_4 + _309;
int16_t _311 = _repeat_image_stencil_4 + _310;
int16_t _312 = _repeat_edge_stencil_3 + _311;
int16_t _313 = _repeat_image_stencil_3 + _312;
int16_t _314 = _repeat_edge_stencil_2 + _313;
int16_t _315 = _repeat_image_stencil_2 + _314;
int16_t _316 = _repeat_edge_stencil_1 + _315;
int16_t _317 = _repeat_image_stencil_1 + _316;
return _317;
}
//store is: hw_output.stencil(hw_output_s0_x_xi, hw_output_s0_y_yi) = conv.stencil(hw_output_s0_x_xi, hw_output_s0_y_yi)
hw_uint<16> hcompute_hw_output_stencil(hw_uint<16>& conv_stencil) {
int16_t _conv_stencil_2 = (int16_t) conv_stencil.extract<0, 15>();
return _conv_stencil_2;
}