cg_check
Parse and type-check C⏚ source code to detect errors before simulation. Fix all reported diagnostics in your draft to ensure correct hardware design.
Instructions
Parse, scope, and type-check C⏚ source without running it. Returns
{ok, diagnostics:[{file,line,message}], summary}. Call this first on
any draft; fix every diagnostic before simulating. extra_files maps
filename → content for imported bundles/tasks (e.g. {"Defs.cg": "..."}).
For a MULTI-FILE project, pass package_dir (the folder holding your
.cg files, e.g. "fpga/src/main/cg", relative to the project root): the
tool then reads every sibling .cg there, so tasks defined in other files
of the same package resolve — just like the IDE. A task you only got from
cg_example is text; it must be saved to a file in that dir to resolve.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| extra_files | No | ||
| package_dir | No |