3.1.25.2.2. waf_tools.hcg.process_hcg

waf_tools.hcg.process_hcg(self: task_gen, node: Node) → int

Create a HALCoGen code generation task from a .hcg source node.

Parses the .hcg XML file to discover all generated outputs, loads the remove-list from the YAML file specified by self.remove, resolves the corresponding .dil device file and creates an hcg_compiler task that performs the actual code generation.

A copy of the FreeRTOS sources is provided in the repository. Therefore the generated FreeRTOS sources are not needed and these files must be removed as otherwise the wrong files may be included.

The only information needed from the generated sources is the configCPU_CLOCK_HZ. This information is extracted from the sources (see hcg_compiler.run() for details) and written into the configuration header config_cpu_clock_hz.h

If the c or asm features are active on the task generator, the generated source files are appended to self.source so that they are compiled in subsequent build steps. A .clang-format file disabling formatting is placed in the output directory to prevent accidental reformatting of generated code.

Parameters:
  • self – The task generator instance.

  • node – The .hcg source node that triggered this extension handler.

Returns:

0 on success, 1 on failure.