forked from dillonhuff/clockwork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conv_1_2_compute.h
39 lines (29 loc) · 1.68 KB
/
conv_1_2_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
#pragma once
#include "hw_classes.h"
#include "conv_3x3.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) {
uint16_t _hw_input_stencil_1 = (uint16_t) hw_input_stencil.extract<0, 15>();
return _hw_input_stencil_1;
}
//store is: conv.stencil(conv_s0_x, conv_s0_y) = (uint16)0
hw_uint<16> hcompute_conv_stencil() {
uint16_t _257 = (uint16_t)(0);
return _257;
}
//store is: conv.stencil(conv_s1_x, conv_s1_y) = (hw_input_global_wrapper.stencil(conv_s1_x, conv_s1_y) + (conv.stencil(conv_s1_x, conv_s1_y) + (hw_input_global_wrapper.stencil((conv_s1_x + 1), conv_s1_y)*(uint16)3)))
hw_uint<16> hcompute_conv_stencil_1(hw_uint<16>& conv_stencil, hw_uint<32>& hw_input_global_wrapper_stencil) {
uint16_t _conv_stencil_1 = (uint16_t) conv_stencil.extract<0, 15>();
uint16_t _hw_input_global_wrapper_stencil_1 = (uint16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
uint16_t _hw_input_global_wrapper_stencil_2 = (uint16_t) hw_input_global_wrapper_stencil.extract<16, 31>();
uint16_t _260 = (uint16_t)(3);
uint16_t _261 = _hw_input_global_wrapper_stencil_2 * _260;
uint16_t _262 = _conv_stencil_1 + _261;
uint16_t _263 = _hw_input_global_wrapper_stencil_1 + _262;
return _263;
}
//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) {
uint16_t _conv_stencil_2 = (uint16_t) conv_stencil.extract<0, 15>();
return _conv_stencil_2;
}