VTR Flow Python library

The VTR flow can be imported and implemented as a python library. Below are the descriptions of the useful functions.

VTR flow

Module to run the VTR flow. This module calls other modules that then access the tools like VPR.

vtr.flow.run(architecture_file, circuit_file, power_tech_file=None, start_stage=<VtrStage.odin: 1>, end_stage=<VtrStage.vpr: 4>, command_runner=<vtr.util.CommandRunner object>, temp_dir=PosixPath('temp'), odin_args=None, abc_args=None, vpr_args=None, keep_intermediate_files=True, keep_result_files=True, min_hard_mult_size=3, min_hard_adder_size=1, check_equivalent=False, check_incremental_sta_consistency=False, use_old_abc_script=False, relax_w_factor=1.3)

Runs the VTR CAD flow to map the specified circuit_file onto the target architecture_file

Note

Usage: vtr.run(<architecture_file>,<circuit_file>,[OPTIONS])

Parameters
  • architecture_file – Architecture file to target

  • circuit_file – Circuit to implement

Other Parameters
  • power_tech_file – Technology power file. Enables power analysis and runs ace

  • start_stage – Stage of the flow to start at

  • end_stage – Stage of the flow to finish at

  • temp_dir – Directory to run in (created if non-existent)

  • command_runner – A CommandRunner object used to run system commands

  • verbosity – whether to output error description or not

  • odin_args – A dictionary of keyword arguments to pass on to ODIN II

  • abc_args – A dictionary of keyword arguments to pass on to ABC

  • vpr_args – A dictionary of keyword arguments to pass on to VPR

  • keep_intermediate_files – Determines if intermediate files are kept or deleted

  • keep_result_files – Determines if the result files are kept or deleted

  • min_hard_mult_size – Tells ODIN II the minimum multiplier size that should be implemented using hard multiplier (if available)

  • min_hard_adder_size – Tells ODIN II the minimum adder size that should be implemented using hard adder (if available).

  • check_equivalent – Enables Logical Equivalence Checks

  • use_old_abc_script – Enables the use of the old ABC script

  • relax_w_factor – Factor by which to relax minimum channel width for critical path delay routing

  • check_incremental_sta_consistency – Do a second-run of the incremental analysis to compare the result files

ODIN II

Module to run ODIN II with its various arguments

vtr.odin.odin.run(architecture_file, circuit_file, output_netlist, command_runner=<vtr.util.CommandRunner object>, temp_dir=PosixPath('.'), odin_args='--adder_type default', log_filename='odin.out', odin_exec=None, odin_config=None, min_hard_mult_size=3, min_hard_adder_size=1)

Runs ODIN II on the specified architecture file and circuit file

Note

Usage: vtr.odin.run(<architecture_file>,<circuit_file>,<output_netlist>,[OPTIONS])

Parameters
  • architecture_file – Architecture file to target

  • circuit_file – Circuit file to optimize

  • output_netlist – File name to output the resulting circuit to

Other Parameters
  • command_runner – A CommandRunner object used to run system commands

  • temp_dir – Directory to run in (created if non-existent)

  • odin_args – A dictionary of keyword arguments to pass on to ODIN II

  • log_filename – File to log result to

  • odin_exec – ODIN II executable to be run

  • odin_config – The ODIN II configuration file

  • min_hard_mult_size – Tells ODIN II the minimum multiplier size that should be implemented using hard multiplier (if available)

  • min_hard_adder_size – Tells ODIN II the minimum adder size that should be implemented using hard adder (if available).

ABC

Module to run ABC with its various options

vtr.abc.abc.run(architecture_file, circuit_file, output_netlist, command_runner=<vtr.util.CommandRunner object>, temp_dir=PosixPath('.'), log_filename='abc.out', abc_exec=None, abc_script=None, abc_rc=None, use_old_abc_script=False, abc_args=None, keep_intermediate_files=True)

Runs ABC to optimize specified file.

Note

Usage: vtr.abc.run(<architecture_file>,<circuit_file>,<output_netlist>,[OPTIONS])

Parameters
  • architecture_file – Architecture file to target

  • circuit_file – Circuit file to optimize

  • output_netlist – File name to output the resulting circuit to

Other Parameters
  • command_runner – A CommandRunner object used to run system commands

  • temp_dir – Directory to run in (created if non-existent)

  • log_filename – File to log result to

  • abc_exec – ABC executable to be run

  • abc_script – The script to be run on abc

  • abc_rc – The ABC rc file

  • use_old_abc_script – Enables the use of the old ABC script

  • abc_args – A dictionary of keyword arguments to pass on to ABC

  • keep_intermediate_files – Determines if intermediate files are kept or deleted

vtr.abc.abc.run_lec(reference_netlist, implementation_netlist, command_runner=<vtr.util.CommandRunner object>, temp_dir=PosixPath('.'), log_filename='abc.lec.out', abc_exec=None)

Run Logical Equivalence Checking (LEC) between two netlists using ABC

Note

Usage: vtr.abc.run_lec(<reference_netlist>,<implementation_netlist>,[OPTIONS])

Parameters
  • reference_netlist – The reference netlist to be commpared to

  • implementation_netlist – The implemeted netlist to compare to the reference netlist

Other Parameters
  • command_runner – A CommandRunner object used to run system commands

  • temp_dir – Directory to run in (created if non-existent)

  • log_filename – File to log result to

  • abc_exec – ABC executable to be run

ACE

Module to run ACE with its various options

vtr.ace.ace.run(circuit_file, old_netlist, output_netlist, output_activity_file, command_runner=<vtr.util.CommandRunner object>, temp_dir=PosixPath('.'), log_filename='ace.out', ace_exec=None, ace_seed=1)

Runs ACE for activity estimation

Note

Usage: vtr.ace.run(<circuit_file>,<output_netlist>,<output_activity_file>,[OPTIONS])

Parameters
  • circuit_file – Circuit file to optimize

  • old_netlist – netlist to be anylized

  • output_netlist – File name to output the resulting circuit to

  • output_activity_file – The output activity file

Other Parameters
  • command_runner – A CommandRunner object used to run system commands

  • temp_dir – Directory to run in (created if non-existent)

  • log_filename – File to log result to

  • ace_exec – ACE executable to be run

  • ace_seed – The ACE seed

VPR

Module to interact with VPR and its various options

vtr.vpr.vpr.cmp_full_vs_incr_sta(architecture, circuit, circuit_name=None, command_runner=<vtr.util.CommandRunner object>, vpr_args=None, temp_dir=PosixPath('.'), vpr_exec=None)

Sanity check that full STA and the incremental STA produce the same *.net, *.place, *.route files as well as identical timing report files

Note

Use: vtr.vpr.cmp_full_vs_incr_sta(<architecture>,<circuit_name>,<circuit>,[OPTIONS])

Parameters
  • architecture – Architecture file

  • circuit – Input circuit file

Other Parameters
  • circuit_name – Name of the circuit file

  • command_runner – CommandRunner object

  • temp_dir – Directory to run in

  • vpr_exec – Path to the VPR executable

  • vpr_args – Extra arguments for VPR

vtr.vpr.vpr.run(architecture, circuit, circuit_name=None, command_runner=<vtr.util.CommandRunner object>, temp_dir=PosixPath('.'), log_filename='vpr.out', vpr_exec=None, vpr_args=None)

Runs VPR with the specified configuration

Note

Usage: vtr.vpr.run(<architecture>,<circuit>,[OPTIONS])

Parameters
  • architecture – Architecture file

  • circuit – Input circuit file

Other Parameters
  • circuit_name – Name of the circuit file

  • command_runner – CommandRunner object

  • temp_dir – Directory to run in

  • log_filename – File to log result to

  • vpr_exec – Path to the VPR executable

  • vpr_args – Extra arguments for VPR

vtr.vpr.vpr.run_relax_w(architecture, circuit, circuit_name=None, command_runner=<vtr.util.CommandRunner object>, temp_dir=PosixPath('.'), relax_w_factor=1.3, vpr_exec=None, logfile_base='vpr', vpr_args=None)

Runs VPR twice:

1st: To find the minimum channel width

2nd: At relaxed channel width (e.g. for critical path delay)

Note

Use: vtr.vpr.run_relax_w(<architecture_file>,<circuit_file>,[OPTIONS])

Parameters
  • architecture – Architecture file

  • circuit – Input circuit netlist

Other Parameters
  • circuit_name – Name of the circuit file

  • command_runner – CommandRunner object

  • temp_dir – Directory to run in

  • relax_w_factor – Factor by which to relax minimum channel width for critical path delay routing

  • vpr_exec – Path to the VPR executable

  • logfile_base – Base name for log files (e.g. “vpr” produces vpr.min_w.out, vpr.relaxed_w.out)

  • vpr_args – Extra arguments for VPR

vtr.vpr.vpr.run_second_time(architecture, circuit, circuit_name=None, command_runner=<vtr.util.CommandRunner object>, temp_dir=PosixPath('.'), vpr_exec=None, second_run_args=None, rr_graph_ext='.xml')

Run vpr again with additional parameters. This is used to ensure that files generated by VPR can be re-loaded by it

Note

Usage: vtr.vpr.run_second_time(<architecture>,<circuit>,[OPTIONS])

Parameters
  • architecture – Architecture file

  • circuit – Input circuit file

Other Parameters
  • circuit_name – Name of the circuit file

  • command_runner – CommandRunner object

  • temp_dir – Directory to run in

  • log_filename – File to log result to

  • vpr_exec – Path to the VPR executable

  • second_run_args – Extra arguments for VPR