docstr: Write the tcl scripts and kernel sources to create a Vivado IPI project for the VivadoAccelerator
docstr_tok: ["Write","the","tcl","scripts","and","kernel","sources","to","create","a","Vivado","IPI","project","for","the","VivadoAccelerator"]
code: def write_board_script(self, model):
      """
      Write the tcl scripts and kernel sources to create a Vivado IPI project for the VivadoAccelerator
      """
      filedir = os.path.dirname(os.path.abspath(__file__))
      copyfile(
          os.path.join(
              filedir,
              self.vivado_accelerator_config.get_tcl_file_path(),
          ),
          f"{model.config.get_output_dir()}/design.tcl",
      )
      # Generic alveo board
      if self.vivado_accelerator_config.get_board().startswith("alveo"):
          src_dir = os.path.join(
              filedir,
              self.vivado_accelerator_config.get_krnl_rtl_src_dir(),
          )
          dst_dir = (
              os.path.abspath(model.config.get_output_dir()) + "/src"
          )
          copy_tree(src_dir, dst_dir)
  
      ###################
      # project.tcl
      ###################
      f = open(f"{model.config.get_output_dir()}/project.tcl", "w")
      f.write("variable project_name\n")
      f.write(f'set project_name "{model.config.get_project_name()}"\n')
      f.write("variable backend\n")
      f.write('set backend "vivadoaccelerator"\n')
      f.write("variable part\n")
      f.write(
          f'set part "{self.vivado_accelerator_config.get_part()}"\n'
      )
      f.write("variable clock_period\n")
      f.write(
          "set clock_period {}\n".format(
              model.config.get_config_value("ClockPeriod")
          )
      )
      f.write("variable clock_uncertainty\n")
      f.write(
          "set clock_uncertainty {}\n".format(
              model.config.get_config_value("ClockUncertainty", "12.5%")
          )
      )
      f.write("variable version\n")
      f.write(
          'set version "{}"\n'.format(
              model.config.get_config_value("Version", "1.0.0")
          )
      )
      if self.vivado_accelerator_config.get_interface() == "axi_stream":
          (
              in_bit,
              out_bit,
          ) = self.vivado_accelerator_config.get_io_bitwidth()
          f.write(f"set bit_width_hls_output {in_bit}\n")
          f.write(f"set bit_width_hls_input {out_bit}\n")
      f.close()
  
file_path: hls4ml/hls4ml/writer/vivado_accelerator_writer.py
imports: import os
  from distutils.dir_util import copy_tree
  from shutil import copyfile
  from hls4ml.writer.vivado_writer import VivadoWriter
label_desc: Use image node_id 5 for calling the VivadoAcceleratorWriter obj's underlying member method code with example usage: obj.write_board_script(model) without return types