3.1.25.2.4. waf_tools.hcg.hcg_compiler
- class waf_tools.hcg.hcg_compiler(*k, **kw)
Bases:
TaskTask that executes the HALCoGen code generator.
Copies the
.hcgand.dilinput files to the build directory, invokes HALCoGen to generate the HAL sources, extracts the CPU clock frequency from the generatedFreeRTOSConfig.h, validates theHL_sys_startup.chash, removes unwanted files, and synchronizes timestamps.- Task attributes (set by
process_hcg()): remove (list[str]): File paths to delete after generation.
uses_freertos (bool): Whether to extract the CPU clock define.
- run() int
Execute the HALCoGen code generator and post-process outputs.
Performs the following steps:
Copy the
.hcgand.dilsources into the build directory.Run HALCoGen to generate HAL source files.
If FreeRTOS is enabled, extract
configCPU_CLOCK_HZfrom the generatedFreeRTOSConfig.hand write it intoconfig_cpu_clock_hz.h.Validate the hash of
HL_sys_startup.cagainst the expected hash stored inself.generator.startup_hash.Remove unwanted generated files listed in
self.remove.Re-copy the original
.hcg/.dilfiles to overwrite the timestamps that HALCoGen modified during generation, keeping the source and build directories synchronized.
- Returns:
0 on success, 1 if the startup file hash validation fails.
- Task attributes (set by