Skip to content

Commit ced06f6

Browse files
fixing discrepancies post-merge
1 parent 2c35c7b commit ced06f6

File tree

4 files changed

+15
-328
lines changed

4 files changed

+15
-328
lines changed

hls4ml/backends/vitis_accelerator/vitis_accelerator_backend.py

Lines changed: 12 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,6 @@ def __init__(self):
88
self._register_layer_attributes()
99
self._register_flows()
1010

11-
def create_initial_config(
12-
self,
13-
board='alveo-u55c',
14-
part=None,
15-
clock_period=5,
16-
io_type='io_parallel',
17-
num_kernel=1,
18-
num_thread=1,
19-
batchsize=8192
20-
):
21-
'''
22-
Create initial accelerator config with default parameters
23-
24-
Args:
25-
board: one of the keys defined in supported_boards.json
26-
clock_period: clock period passed to hls project
27-
io_type: io_parallel or io_stream
28-
num_kernel: how many compute units to create on the fpga
29-
num_thread: how many threads the host cpu uses to drive the fpga
30-
Returns:
31-
populated config
32-
'''
33-
board = board if board is not None else 'alveo-u55c'
34-
config = super().create_initial_config(part, clock_period, io_type)
35-
config['AcceleratorConfig'] = {}
36-
config['AcceleratorConfig']['Board'] = board
37-
config['AcceleratorConfig']['Num_Kernel'] = num_kernel
38-
config['AcceleratorConfig']['Num_Thread'] = num_thread
39-
config['AcceleratorConfig']['Batchsize'] = batchsize
40-
return config
41-
4211
def _register_flows(self):
4312
validation_passes = [
4413
'vitisaccelerator:validate_conv_implementation',
@@ -59,18 +28,16 @@ def _register_flows(self):
5928
ip_flow_requirements.insert(ip_flow_requirements.index('vivado:apply_templates'), template_flow)
6029

6130
self._default_flow = register_flow('ip', None, requires=ip_flow_requirements, backend=self.name)
62-
31+
6332
def create_initial_config(
6433
self,
65-
board='pynq-z2',
34+
board='alveo-u55c',
6635
part=None,
6736
clock_period=5,
6837
io_type='io_parallel',
69-
interface='axi_stream',
70-
driver='python',
71-
input_type='float',
72-
output_type='float',
73-
platform='xilinx_u250_xdma_201830_2',
38+
num_kernel=1,
39+
num_thread=1,
40+
batchsize=8192
7441
):
7542
'''
7643
Create initial accelerator config with default parameters
@@ -79,32 +46,16 @@ def create_initial_config(
7946
board: one of the keys defined in supported_boards.json
8047
clock_period: clock period passed to hls project
8148
io_type: io_parallel or io_stream
82-
interface: `axi_stream`: generate hardware designs and drivers which exploit axi stream channels.
83-
`axi_master`: generate hardware designs and drivers which exploit axi master channels.
84-
`axi_lite` : generate hardware designs and drivers which exploit axi lite channels. (Don't use it
85-
to exchange large amount of data)
86-
driver: `python`: generates the python driver to use the accelerator in the PYNQ stack.
87-
`c`: generates the c driver to use the accelerator bare-metal.
88-
input_type: the wrapper input precision. Can be `float` or an `ap_type`. Note: VivadoAcceleratorBackend
89-
will round the number of bits used to the next power-of-2 value.
90-
output_type: the wrapper output precision. Can be `float` or an `ap_type`. Note:
91-
VivadoAcceleratorBackend will round the number of bits used to the next power-of-2 value.
92-
platform: development target platform
93-
49+
num_kernel: how many compute units to create on the fpga
50+
num_thread: how many threads the host cpu uses to drive the fpga
9451
Returns:
9552
populated config
9653
'''
97-
board = board if board is not None else 'pynq-z2'
54+
board = board if board is not None else 'alveo-u55c'
9855
config = super().create_initial_config(part, clock_period, io_type)
9956
config['AcceleratorConfig'] = {}
10057
config['AcceleratorConfig']['Board'] = board
101-
config['AcceleratorConfig']['Interface'] = interface # axi_stream, axi_master, axi_lite
102-
config['AcceleratorConfig']['Driver'] = driver
103-
config['AcceleratorConfig']['Precision'] = {}
104-
config['AcceleratorConfig']['Precision']['Input'] = {}
105-
config['AcceleratorConfig']['Precision']['Output'] = {}
106-
config['AcceleratorConfig']['Precision']['Input'] = input_type # float, double or ap_fixed<a,b>
107-
config['AcceleratorConfig']['Precision']['Output'] = output_type # float, double or ap_fixed<a,b>
108-
config['AcceleratorConfig']['Platform'] = platform
109-
110-
return config
58+
config['AcceleratorConfig']['Num_Kernel'] = num_kernel
59+
config['AcceleratorConfig']['Num_Thread'] = num_thread
60+
config['AcceleratorConfig']['Batchsize'] = batchsize
61+
return config

hls4ml/backends/vitis_accelerator/vitis_accelerator_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import json
2+
import os
3+
14
class VitisAcceleratorConfig:
25
def __init__(self, config):
36
self.config = config.config

hls4ml/templates/vitis_accelerator/myproject_host.cpp

Lines changed: 0 additions & 230 deletions
This file was deleted.

hls4ml/templates/vitis_accelerator/myproject_kernel.cpp

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)