docstr: Builds the project using Intel HLS compiler.
  
  Args:
      model (ModelGraph): The model to build
      synth, optional: Whether to run HLS synthesis
      fpgasynth, optional:  Whether to run FPGA synthesis (Quartus Compile)
      log_level, optional: Logging level to be displayed during HLS synthesis (0, 1, 2)
      cont_if_large_area: Instruct the HLS compiler to continue synthesis if the estimated resource usage exceeds
          device resources
  Errors raise exceptions
docstr_tok: ["Builds","the","project","using","Intel","HLS","compiler",".","Args",":","model","(","ModelGraph",")",":","The","model","to","build","synth",",","optional",":","Whether","to","run","HLS","synthesis","fpgasynth",",","optional",":","Whether","to","run","FPGA","synthesis","(","Quartus","Compile",")","log_level",",","optional",":","Logging","level","to","be","displayed","during","HLS","synthesis","(","0",",","1",",","2",")","cont_if_large_area",":","Instruct","the","HLS","compiler","to","continue","synthesis","if","the","estimated","resource","usage","exceeds","device","resources","Errors","raise","exceptions"]
code: def build(
      self,
      model,
      synth=True,
      fpgasynth=False,
      log_level=1,
      cont_if_large_area=False,
  ):
      """
      Builds the project using Intel HLS compiler.
  
      Args:
          model (ModelGraph): The model to build
          synth, optional: Whether to run HLS synthesis
          fpgasynth, optional:  Whether to run FPGA synthesis (Quartus Compile)
          log_level, optional: Logging level to be displayed during HLS synthesis (0, 1, 2)
          cont_if_large_area: Instruct the HLS compiler to continue synthesis if the estimated resource usage exceeds
              device resources
      Errors raise exceptions
      """
  
      # Check software needed is present
      found = os.system("command -v i++ > /dev/null")
      if found != 0:
          raise Exception(
              'Intel HLS installation not found. Make sure "i++" is on PATH.'
          )
  
      if fpgasynth:
          if fpgasynth and not synth:
              raise Exception(
                  "HLS Synthesis needs to be run before FPGA synthesis"
              )
          found = os.system("command -v quartus_sh > /dev/null")
          if found != 0:
              raise Exception(
                  'Quartus installation not found. Make sure "quartus_sh" is on PATH.'
              )
  
      with chdir(model.config.get_output_dir()):
          if synth:
              quartus_compile = (
                  "QUARTUS_COMPILE=--quartus-compile"
                  if fpgasynth
                  else ""
              )
              cont_synth = (
                  "CONT_IF_LARGE_AREA=--dont-error-if-large-area-est"
                  if cont_if_large_area
                  else ""
              )
              log_1 = "LOGGING_1=-v " if log_level >= 1 else ""
              log_2 = "LOGGING_2=-v " if log_level >= 2 else ""
              os.system(
                  f"make {model.config.get_project_name()}-fpga {log_1} {log_2} {cont_synth} {quartus_compile}"
              )
  
              # If running i++ through a container, such a singularity, this command will throw an exception, because the
              # host OS doesn't have access to HLS simulation tools. To avoid the exception, shell into the container
              # (e.g. singularity shell ....) and then execute the following command manually
              # This command simply tests the IP using a simulation tool and obtains the latency and initiation interval
              os.system(f"./{model.config.get_project_name()}-fpga")
  
      return parse_quartus_report(model.config.get_output_dir())
  
imports: import os
  from contextlib import contextmanager
  import numpy
  from hls4ml.backends import FPGABackend
  from hls4ml.model.attributes import ConfigurableAttribute, TypeAttribute
  from hls4ml.model.flow import register_flow
  from hls4ml.model.layers import GRU, LSTM, Activation, Conv1D, Conv2D, Dense, Embedding, Layer, SimpleRNN, Softmax
  from hls4ml.model.optimizer import get_backend_passes, layer_optimizer
  from hls4ml.model.types import FixedPrecisionType, IntegerPrecisionType, NamedType
  from hls4ml.report import parse_quartus_report
label_desc: Use image node_id 7 for calling the QuartusBackend obj's underlying member method code with example usage: obj.build(model, synth, fpgasynth, log_level, cont_if_large_area) and returns: parse_quartus_report