Skip to content

Commit 3d227e5

Browse files
committed
Add docstring for create_config
1 parent d1bdd37 commit 3d227e5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

hls4ml/utils/config.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@
66

77

88
def create_config(output_dir='my-hls-test', project_name='myproject', backend='Vivado', version='1.0.0', **kwargs):
9+
"""Create an initial configuration to guide the conversion process.
10+
11+
The resulting configuration will contain general information about the project (like project name and output directory)
12+
as well as the backend-specific configuration (part numbers, clocks etc). Extra arguments of this function will be
13+
passed to the backend's ``create_initial_config``. For the possible list of arguments, check the documentation of each
14+
backend.
15+
16+
Args:
17+
output_dir (str, optional): The output directory to which the generated project will be written.
18+
Defaults to 'my-hls-test'.
19+
project_name (str, optional): The name of the project, that will be used as a top-level function in HLS designs.
20+
Defaults to 'myproject'.
21+
backend (str, optional): The backend to use. Defaults to 'Vivado'.
22+
version (str, optional): Optional string to version the generated project for backends that support it.
23+
Defaults to '1.0.0'.
24+
25+
Raises:
26+
Exception: Raised if unknown backend is specified.
27+
28+
Returns:
29+
dict: The conversion configuration.
30+
"""
931
backend_list = hls4ml.backends.get_available_backends()
1032
if backend.lower() not in backend_list:
1133
raise Exception(f'Unknown backend: {backend}')

0 commit comments

Comments
 (0)