Skip to content

Commit

Permalink
Add docstring for create_config
Browse files Browse the repository at this point in the history
  • Loading branch information
vloncar committed Aug 22, 2023
1 parent d1bdd37 commit 3d227e5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions hls4ml/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@


def create_config(output_dir='my-hls-test', project_name='myproject', backend='Vivado', version='1.0.0', **kwargs):
"""Create an initial configuration to guide the conversion process.
The resulting configuration will contain general information about the project (like project name and output directory)
as well as the backend-specific configuration (part numbers, clocks etc). Extra arguments of this function will be
passed to the backend's ``create_initial_config``. For the possible list of arguments, check the documentation of each
backend.
Args:
output_dir (str, optional): The output directory to which the generated project will be written.
Defaults to 'my-hls-test'.
project_name (str, optional): The name of the project, that will be used as a top-level function in HLS designs.
Defaults to 'myproject'.
backend (str, optional): The backend to use. Defaults to 'Vivado'.
version (str, optional): Optional string to version the generated project for backends that support it.
Defaults to '1.0.0'.
Raises:
Exception: Raised if unknown backend is specified.
Returns:
dict: The conversion configuration.
"""
backend_list = hls4ml.backends.get_available_backends()
if backend.lower() not in backend_list:
raise Exception(f'Unknown backend: {backend}')
Expand Down

0 comments on commit 3d227e5

Please sign in to comment.