@@ -28,3 +28,52 @@ def _register_flows(self):
2828 ip_flow_requirements .insert (ip_flow_requirements .index ('vivado:apply_templates' ), template_flow )
2929
3030 self ._default_flow = register_flow ('ip' , None , requires = ip_flow_requirements , backend = self .name )
31+
32+ def create_initial_config (
33+ self ,
34+ board = 'pynq-z2' ,
35+ part = None ,
36+ clock_period = 5 ,
37+ io_type = 'io_parallel' ,
38+ interface = 'axi_stream' ,
39+ driver = 'python' ,
40+ input_type = 'float' ,
41+ output_type = 'float' ,
42+ platform = 'xilinx_u250_xdma_201830_2' ,
43+ ):
44+ '''
45+ Create initial accelerator config with default parameters
46+
47+ Args:
48+ board: one of the keys defined in supported_boards.json
49+ clock_period: clock period passed to hls project
50+ io_type: io_parallel or io_stream
51+ interface: `axi_stream`: generate hardware designs and drivers which exploit axi stream channels.
52+ `axi_master`: generate hardware designs and drivers which exploit axi master channels.
53+ `axi_lite` : generate hardware designs and drivers which exploit axi lite channels. (Don't use it
54+ to exchange large amount of data)
55+ driver: `python`: generates the python driver to use the accelerator in the PYNQ stack.
56+ `c`: generates the c driver to use the accelerator bare-metal.
57+ input_type: the wrapper input precision. Can be `float` or an `ap_type`. Note: VivadoAcceleratorBackend
58+ will round the number of bits used to the next power-of-2 value.
59+ output_type: the wrapper output precision. Can be `float` or an `ap_type`. Note:
60+ VivadoAcceleratorBackend will round the number of bits used to the next power-of-2 value.
61+ platform: development target platform
62+
63+ Returns:
64+ populated config
65+ '''
66+ board = board if board is not None else 'pynq-z2'
67+ config = super ().create_initial_config (part , clock_period , io_type )
68+ config ['AcceleratorConfig' ] = {}
69+ config ['AcceleratorConfig' ]['Board' ] = board
70+ config ['AcceleratorConfig' ]['Interface' ] = interface # axi_stream, axi_master, axi_lite
71+ config ['AcceleratorConfig' ]['Driver' ] = driver
72+ config ['AcceleratorConfig' ]['Precision' ] = {}
73+ config ['AcceleratorConfig' ]['Precision' ]['Input' ] = {}
74+ config ['AcceleratorConfig' ]['Precision' ]['Output' ] = {}
75+ config ['AcceleratorConfig' ]['Precision' ]['Input' ] = input_type # float, double or ap_fixed<a,b>
76+ config ['AcceleratorConfig' ]['Precision' ]['Output' ] = output_type # float, double or ap_fixed<a,b>
77+ config ['AcceleratorConfig' ]['Platform' ] = platform
78+
79+ return config
0 commit comments