|
39 | 39 | static const bool store_weights_in_bram = false; |
40 | 40 | static const unsigned strategy = nnet::{strategy}; |
41 | 41 | static const nnet::conv_implementation implementation = nnet::conv_implementation::{implementation}; |
| 42 | + static const unsigned resource_implementation = nnet::{dense_resource_implementation}; |
| 43 | + template<class data_T, class res_T, class CONFIG_T> |
| 44 | + using dense_unrolled = nnet::{unrolled_function}<data_T, res_T, CONFIG_T>; |
42 | 45 | static const unsigned min_width = {min_width}; |
43 | 46 | static const ap_uint<filt_width> pixels[min_width]; |
44 | 47 | static const unsigned n_partitions = {n_partitions}; |
@@ -80,6 +83,8 @@ def format(self, node): |
80 | 83 | params['fill_fn'] = f'fill_buffer_{node.index}' |
81 | 84 | else: |
82 | 85 | params['fill_fn'] = 'FillConv1DBuffer' |
| 86 | + # TODO - Extend unrolled Dense Resource to Conv1D |
| 87 | + params['unrolled_function'] = 'DenseResourceUnrolled' |
83 | 88 |
|
84 | 89 | conv_config = self.template.format(**params) |
85 | 90 |
|
@@ -292,6 +297,8 @@ def format(self, node): |
292 | 297 | params['scale_index_type'] = 'scale_index_regular' |
293 | 298 |
|
294 | 299 | params['config_t'] = f'config{node.index}_depthwise_mult' |
| 300 | + # TODO - Extend unrolled Dense Resource |
| 301 | + params['unrolled_function'] = 'DenseResourceUnrolled' |
295 | 302 | depthwise_config = self.depthwise_template.format(**params) |
296 | 303 |
|
297 | 304 | # Depthwise mult config |
@@ -334,6 +341,8 @@ def format(self, node): |
334 | 341 | params['scale_index_type'] = 'scale_index_regular' |
335 | 342 |
|
336 | 343 | params['config_t'] = f'config{node.index}_pointwise_mult' |
| 344 | + # TODO - Extend unrolled Dense Resource |
| 345 | + params['unrolled_function'] = 'DenseResourceUnrolled' |
337 | 346 | pointwise_config = self.pointwise_template.format(**params) |
338 | 347 |
|
339 | 348 | # Pointwise mult config |
@@ -419,6 +428,8 @@ def format(self, node): |
419 | 428 | params['scale_index_width_type'] = 'scale_index_regular' |
420 | 429 |
|
421 | 430 | params['config_t'] = f'config{node.index}_depthwise_mult' |
| 431 | + # TODO - Extend unrolled Dense Resource |
| 432 | + params['unrolled_function'] = 'DenseResourceUnrolled' |
422 | 433 | depthwise_config = self.depthwise_template.format(**params) |
423 | 434 |
|
424 | 435 | # Depthwise mult config |
@@ -464,6 +475,8 @@ def format(self, node): |
464 | 475 | else: |
465 | 476 | params['scale_index_width_type'] = 'scale_index_regular' |
466 | 477 | params['config_t'] = f'config{node.index}_pointwise_mult' |
| 478 | + # TODO - Extend unrolled Dense Resource |
| 479 | + params['unrolled_function'] = 'DenseResourceUnrolled' |
467 | 480 | pointwise_config = self.pointwise_template.format(**params) |
468 | 481 |
|
469 | 482 | # Pointwise mult config |
|
0 commit comments