Skip to main content
Glama

cg_generate_verilog

Generate synthesizable Verilog from C-like HDL (C⏚) source. Supports multi-file projects with package resolution and optional disk output for RTL handoff.

Instructions

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 output_dir (e.g. "fpga/build/verilog", relative to the project root) to WRITE the files to disk and KEEP them — the result then also carries {output_dir, written:[paths]}. Without it the files are only returned inline and the temp dir is cleaned. Prefer output_dir when the host needs the .v on disk (to inspect or run yosys).

For a MULTI-FILE project, pass package_dir (the folder with your .cg files) so sibling tasks in the same package resolve during generation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
targetNoverilog
output_dirNo
extra_filesNo
package_dirNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses return format, file writing vs inline behavior, and temp directory cleanup. Lacks info on overwrite behavior or permissions, but covers main behavioral traits well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three well-focused paragraphs. Front-loaded with purpose, then parameter details. No redundant sentences. Efficient and readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers main functionality, return values, key parameters, and usage context. Lacks details on source format or error handling, but sufficient for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, description explains target, output_dir, and package_dir clearly. Source is implied but not explicitly described. extra_files not mentioned. Good but not complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Generate synthesizable HDL from C⏚' and specifies target languages. It distinguishes from siblings by positioning as the step after cg_simulate passes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use after cg_simulate passes, to hand off RTL.' Provides when to use output_dir vs not, and package_dir for multi-file projects. Clear context for appropriate use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Neosyn-Logic/cg-agent-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server