docstr: Write the C++ layer config file (parameters.h)
  
  Args:
      model (ModelGraph): the hls4ml model.
docstr_tok: ["Write","the","C++","layer","config","file","(","parameters.h",")","Args",":","model","(","ModelGraph",")",":","the","hls4ml","model","."]
code: def write_parameters(self, model):
      """Write the C++ layer config file (parameters.h)
  
      Args:
          model (ModelGraph): the hls4ml model.
      """
      filedir = os.path.dirname(os.path.abspath(__file__))
      f = open(
          os.path.join(
              filedir, "../templates/quartus/firmware/parameters.h"
          )
      )
      fout = open(
          f"{model.config.get_output_dir()}/firmware/parameters.h", "w"
      )
  
      for line in f.readlines():
          if "// hls-fpga-machine-learning insert includes" in line:
              newline = line
              for include in sorted(
                  set(
                      sum(
                          (
                              layer.get_attr("include_header", [])
                              for layer in model.get_layers()
                          ),
                          [],
                      )
                  )
              ):
                  newline += '#include "%s"\n' % include
  
          elif (
              "// hls-fpga-machine-learning insert layer-config" in line
          ):
              newline = line
              for layer in model.get_layers():
                  config = layer.get_attr("config_cpp", None)
                  if config:
                      newline += config + "\n"
          else:
              newline = line
          fout.write(newline)
      f.close()
      fout.close()
  
imports: import glob
  import os
  import tarfile
  from collections import OrderedDict
  from shutil import copyfile, copytree, rmtree
  import numpy
  import yaml
  from hls4ml.backends import get_backend
  from hls4ml.model.layers import Conv1D, Conv2D, Conv2DBatchnorm, Dense
  from hls4ml.utils.fixed_point_utils import FixedPointEmulator, ceil_log2, uint_to_binary
  from hls4ml.writer.writers import Writer
label_desc: Use image node_id 9 for calling the QuartusWriter obj's underlying member method code with example usage: obj.write_parameters(model) without return types