docstr: Write the generated code (nnet_code_gen.h)
  
  Args:
      model (ModelGraph): the hls4ml model.
docstr_tok: ["Write","the","generated","code","(","nnet_code_gen.h",")","Args",":","model","(","ModelGraph",")",":","the","hls4ml","model","."]
code: def write_generated_code(self, model):
      """Write the generated code (nnet_code_gen.h)
  
      Args:
          model (ModelGraph): the hls4ml model.
      """
      path = f"{model.config.get_output_dir()}/firmware/nnet_utils/nnet_code_gen.h"
      f = open(path)
      contents = f.readlines()
      f.close()
      f = open(path, "w")
  
      for line in contents:
          if "// hls4ml insert code" in line:
              newline = line
              for layer in model.get_layers():
                  for generated_code in layer.code.values():
                      newline += str(generated_code)
          else:
              newline = line
          f.write(newline)
      f.close()
  
imports: import glob
  import os
  import tarfile
  from collections import OrderedDict
  from shutil import copyfile, copytree, rmtree
  import numpy
  import yaml
  from hls4ml.writer.writers import Writer
label_desc: Use image node_id 14 for calling the VivadoWriter obj's underlying member method code with example usage: obj.write_generated_code(model) without return types