hls4ml.backends.vivado package

Subpackages

Submodules

hls4ml.backends.vivado.vivado_backend module

class hls4ml.backends.vivado.vivado_backend.VivadoBackend(name='Vivado')

Bases: FPGABackend

build(model, reset=False, csim=True, synth=True, cosim=False, validation=False, export=False, vsynth=False, fifo_opt=False, pnr=False)

Build the HLS project, running the steps that are enabled.

Parameters:
  • model (ModelGraph) – The model to build.

  • reset (bool, optional) – Start a new HLS project, removing the previous one. Defaults to False.

  • csim (bool, optional) – Run C simulation. Defaults to True.

  • synth (bool, optional) – Run C synthesis. Defaults to True.

  • cosim (bool, optional) – Run C/RTL co-simulation. Defaults to False.

  • validation (bool, optional) – Compare the outputs of C simulation and co-simulation. Defaults to False.

  • export (bool, optional) – Export the design as an IP. Defaults to False.

  • vsynth (bool, optional) – Synthesize the generated Verilog with Vivado, out of context. If synthesis leaves the cascade input of a DSP unconnected (design rule DSPS-2), the design is synthesized again with -cascade_dsp tree, which can change the resources. Defaults to False.

  • fifo_opt (bool, optional) – Record the FIFO occupancy during co-simulation, used by the FIFO depth optimization flow. Defaults to False.

  • pnr (bool, optional) – Also place and route the design after Vivado synthesis, for the resources, timing and power after implementation. Vivado estimates the power from default switching activity, not from a simulation of the design, so most of the total can be the static power of the device. Implies vsynth. Defaults to False.

Returns:

The reports read from the project, see hls4ml.report.parse_vivado_report.

Return type:

dict

Raises:

Exception – If vivado_hls is not on PATH, or if a step of the build fails.

create_initial_config(part='xcvu13p-flga2577-2-e', clock_period=5, clock_uncertainty='12.5%', io_type='io_parallel', namespace=None, write_weights_txt=True, write_tar=False, tb_output_stream='both', **_)

Create initial configuration of the Vivado backend.

Parameters:
  • part (str, optional) – The FPGA part to be used. Defaults to ‘xcvu13p-flga2577-2-e’.

  • clock_period (int, optional) – The clock period. Defaults to 5.

  • clock_uncertainty (str, optional) – The clock uncertainty. Defaults to 12.5%.

  • io_type (str, optional) – Type of implementation used. One of ‘io_parallel’ or ‘io_stream’. Defaults to ‘io_parallel’.

  • namespace (str, optional) – If defined, place all generated code within a namespace. Defaults to None.

  • write_weights_txt (bool, optional) – If True, writes weights to .txt files which speeds up compilation. Defaults to True.

  • write_tar (bool, optional) – If True, compresses the output directory into a .tar.gz file. Defaults to False.

  • tb_output_stream (str, optional) – Controls where to write the output. Options are ‘stdout’, ‘file’ and ‘both’. Defaults to ‘both’.

Returns:

initial configuration.

Return type:

dict

get_default_flow()

The name of the default flow of the backend.

Default flow is used as the conversion target if the target flow has not been specified.

get_writer_flow()
init_base_layer(layer)
init_bidirectional(layer)
init_conv1d(layer)
init_conv1d_transpose(layer)
init_conv2d(layer)
init_conv2d_transpose(layer)
init_dense(layer)
init_depconv1d(layer)
init_depconv2d(layer)
init_einsum(layer: Einsum) → None
init_einsum_dense(layer: EinsumDense) → None
init_embed(layer)
init_garnet(layer)
init_garnet_stack(layer)
init_gru(layer)
init_lstm(layer)
init_pooling1d(layer)
init_pooling2d(layer)
init_sepconv1d(layer)
init_sepconv2d(layer)
init_simple_rnn(layer)
init_time_distributed(layer)

hls4ml.backends.vivado.vivado_types module

class hls4ml.backends.vivado.vivado_types.VivadoArrayVariableConverter(type_converter)

Bases: ArrayVariableConverter

class hls4ml.backends.vivado.vivado_types.VivadoArrayVariableDefinition

Bases: VariableDefinition

definition_cpp(name_suffix='', as_reference=False)
class hls4ml.backends.vivado.vivado_types.VivadoInplaceArrayVariableConverter(type_converter)

Bases: ArrayVariableConverter

class hls4ml.backends.vivado.vivado_types.VivadoInplaceArrayVariableDefinition

Bases: VariableDefinition

definition_cpp()
class hls4ml.backends.vivado.vivado_types.VivadoInplaceStreamVariableConverter(type_converter)

Bases: InplaceStreamVariableConverter

class hls4ml.backends.vivado.vivado_types.VivadoInplaceStreamVariableDefinition

Bases: VariableDefinition

definition_cpp()
class hls4ml.backends.vivado.vivado_types.VivadoScalarStreamVariableConverter(type_converter)

Bases: ScalarStreamVariableConverter

class hls4ml.backends.vivado.vivado_types.VivadoStreamVariableConverter(type_converter)

Bases: StreamVariableConverter

class hls4ml.backends.vivado.vivado_types.VivadoStreamVariableDefinition

Bases: VariableDefinition

definition_cpp(name_suffix='', as_reference=False)

Module contents