48 result = result + window[
x];
59 float window1[NUM_ELEM/2] = {0.0};
60 float window2[NUM_ELEM/4] = {0.0};
61 float window3[NUM_ELEM/8] = {0.0};
62 float window4[NUM_ELEM/16]= {0.0};
63 float window5[NUM_ELEM/32]= {0.0};
64 float window6[NUM_ELEM/64]= {0.0};
68 L1:
for(ap_uint<7>
x=0;
x.to_uint()<NUM_ELEM/2;
x++)
71 window1[
x] = window0[
x] + window0[NUM_ELEM/2+
x];
73 L2:
for(ap_uint<7>
x=0;
x.to_uint()<NUM_ELEM/4;
x++)
77 window2[
x] = window1[
x] + window1[NUM_ELEM/4+
x];
79 L3:
for(ap_uint<7>
x=0;
x.to_uint()<NUM_ELEM/8;
x++)
83 window3[
x] = window2[
x] + window2[NUM_ELEM/8+
x];
85 L4:
for(ap_uint<7>
x=0;
x.to_uint()<NUM_ELEM/16;
x++)
89 window4[
x] = window3[
x] + window3[NUM_ELEM/16+
x];
91 L5:
for(ap_uint<7>
x=0;
x.to_uint()<NUM_ELEM/32;
x++)
95 window5[
x] = window4[
x] + window4[NUM_ELEM/32+
x];
97 L6:
for(ap_uint<7>
x=0;
x.to_uint()<NUM_ELEM/64;
x++)
101 window6[
x] = window5[
x] + window5[NUM_ELEM/64+
x];
104 result = window6[0] + window6[1];
121 result = result + window[
x];
134 static unsigned long int k = 0;
135 static unsigned long int series;
138 unsigned long long mult;
140 const unsigned long long int x0 = 3;
141 const unsigned long long int a = 16807;
142 const unsigned int c = 1;
143 const unsigned int module = 4294967295ULL;
144 const float recipr_module = (float) 2.3283064e-10f;
155 series = (mult+c) % module;
161 result = (float) series * recipr_module;
175 float threshold = ((float)1.0)/1024;
180 hls_window[
x] = ref_window[
x] ;
191 float total_error = 9.5367e-07f;
193 float diff = ref_res - hls_res;
194 if (diff < threshold) diff = 0-diff;
195 if (diff > threshold)
197 total_error += (float) diff;
200 printf(
"\n%010.4f\t%010.4f\t%010.4f\n", ref_res, hls_res, total_error);
203 if (total_error < 1.0)
206 printf(
"TEST OK!\n");
211 printf(
"TEST FAILED!\n");
float hls_fp_accumulator(float window0[NUM_ELEM])
static const uint32_t k[]
float ref_fp_accumulator(float window[NUM_ELEM])
x
Return the smallest n such that 2^n >= _x.
This class describes a generic module.