cg-agent-kit
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CG_JAR | Yes | Path to the C⏚ language server jar file. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| cg_checkA | 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. |
| cg_simulateA | Simulate C⏚ source. Returns {ok, simulator, timed_out, diagnostics,
output}.
For a MULTI-FILE project, pass
|
| cg_generate_verilogA | Generate synthesizable HDL from C⏚. target is 'verilog' (default) or 'vhdl'. Returns {ok, file_count, files:{path:content}}. Use after cg_simulate passes, to hand off RTL. Pass For a MULTI-FILE project, pass |
| cg_exampleA | Get a VERIFIED C⏚ base to seed-and-adapt from (don't synthesize hard
kernels from scratch — adapt a known-good one). This is a curated
dictionary of validated code with scored lazy lookup, NOT free-form
search. No pattern → a compact index (name + kind + use_when + tags). A
pattern → the single best-matching source plus its metadata and 1-2
Matching is specificity-weighted (exact name ≫ name word ≫ full tag
phrase ≫ partial overlap), so e.g. "1/sqrt" → RSqrt while a bare "sqrt"
→ FixedSqrt. |
| cg_suggest_for_errorA | Map a compiler error/diagnostic to the recipe that demonstrates the
synthesizable pattern for what was rejected. Returns {ok, recipe, hint,
source}. div/shift-by-a-variable → Recip (bit-serial long division);
a data-dependent/runtime loop bound → SeqDiv (sequential FSM divider).
cg_check/cg_simulate/cg_generate_verilog already auto-attach this as a
|
| cg_synthA | Synthesize the generated Verilog with yosys — the strongest signal
that a design maps to real hardware (catches non-synthesizable
constructs that simulate/iverilog accept). Returns {ok, verdict, top,
flow, cells, arith_ops, latches, warnings, stat, problems, output}.
NOT a correctness oracle: a REAL verdict means real (synthesizable)
hardware, NOT correct hardware — it can't tell a good sequential FSM
from a buggy one.
|
| cg_reportA | Finalize the FPGA report: (re)render /report.html — a self-contained HTML with the synthesis table (REAL/FOLDED/SUSPECT verdict
This does NO synthesis — the rows are built incrementally by passing the
SAME |
| cg_fsmC | Show a task's compiled state machine (states + transitions). Useful to confirm an FSM has the intended number of states. |
| cg_graphB | Show a network's compiled graph (instances, ports with widths and interfaces, connections). Useful to confirm wiring. |
| cg_docsA | Fetch a markdown knowledge doc. No topic → an index of available topics with descriptions; a topic → its full content. Topics: 'context' (the core C⏚ language pack — load before writing any Cg) and 'riscv' (the worked RV32I CPU reference: the loadable single-cycle core and the reusable patterns for CPU-shaped hardware in Cg — barrel shifter, signed/unsigned widening, sub-word load/store, count-prefixed boot-stream program loading, and the lossless-capture / address-filtered testbench patterns). Read 'riscv' when building or extending a processor, instruction decoder, datapath, or stack machine. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 10 tools
Each tool targets a distinct stage in the C⏚ hardware design workflow: type-checking, documentation, example retrieval, FSM analysis, HDL generation, graph visualization, reporting, simulation, error-to-recipe mapping, and synthesis. No overlaps are apparent.
All tools share the 'cg_' prefix. Most follow a verb_noun pattern (e.g., cg_check, cg_generate_verilog, cg_simulate), but a few use nouns alone (cg_docs, cg_example, cg_fsm, cg_graph). This minor inconsistency slightly reduces clarity but remains acceptable.
With exactly 10 tools, the set is well-scoped for a hardware design assistant. It covers the full front-to-back workflow without being overwhelming or too sparse.
The tool surface provides complete lifecycle coverage: code checking, example retrieval, simulation, synthesis, Verilog generation, report finalization, plus supplementary tools for debugging (FSM, graph) and error guidance. No obvious gaps for the stated purpose.