Skip to main content
Glama

cg_synth

Synthesize Verilog with yosys to verify a design maps to real hardware, catching non-synthesizable constructs and silent failures such as constant-folded datapaths or inferred latches. Run after simulation passes.

Instructions

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}. verdict is the one-word classification so you can't confabulate success: REAL (a genuine datapath), FOLDED (0 datapath cells — inputs weren't on ports, dead hardware), SUSPECT (latches inferred — a data-dependent loop / missing reset), or ERROR (yosys failed). cells is the gate count; problems lists any ERROR/Warning lines.

warnings flags the two silent failure modes: a DEGENERATE datapath (arith_ops == 0 → the design constant-folded; drive it with input ports) and inferred LATCHES (latches > 0 → a data-dependent loop bound or incomplete assignment; expected a clocked FSM). A clean synth has ok: true, a sensible cells, arith_ops > 0, and empty warnings.

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_simulate (the asserting test network) is the correctness check; run it FIRST, then cg_synth to confirm the hardware is real, not folded or latched.

top defaults to the first non-testbench task/network (the DUT); pass it when a file holds several designs. flow selects the synthesis flow: 'generic' (default, portable check) or a vendor FPGA family — 'ice40', 'ecp5', 'xilinx', 'gowin', 'intel' — to map to that part's primitives. Override the yosys binary with the $YOSYS env var. Run after cg_simulate passes. A constant-bound for synthesizes (it's unrolled); a data-dependent loop becomes an FSM (also fine).

report_dir DEFAULTS to "fpga/build", so each synth automatically records THIS kernel's verdict + cell counts as a row in /report.html — synthesizing the kernels builds the whole report as a byproduct, no separate step (see cg_report). Pass report_dir="" to disable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
flowNogeneric
sourceYes
timeoutNo
report_dirNofpga/build
extra_filesNo
package_dirNo
Behavior5/5

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

With no annotations, the description fully shoulders the burden. It details the return value structure (ok, verdict, top, flow, cells, etc.), explains failure modes (FOLDED, SUSPECT, ERROR), and warns about silent failures (warnings for degenerate datapath and latches). It also notes the default report_dir behavior and how to disable it, offering comprehensive behavioral insight.

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

Conciseness4/5

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

The description is long but well-structured, starting with purpose, then return value, usage warnings, parameter details, and defaults. Every sentence provides useful information. While it could be slightly more concise, the detail is justified given the tool's complexity.

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?

Given the tool's complexity (synthesis, 7 parameters, rich output) and lack of output schema and annotations, the description is quite complete. It thoroughly explains return values, failure modes, usage order relative to siblings, and key parameters. It misses explanations for a few parameters (timeout, extra_files, package_dir), but overall provides sufficient context for correct invocation.

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

Parameters4/5

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

Schema coverage is 0%, so the description must add meaning. It explains key parameters: top (defaults to first non-testbench task), flow (lists options like generic, ice40, etc.), and report_dir (defaults to 'fpga/build', can disable with ''). However, it does not cover all 7 parameters; missing explanations for source, timeout, extra_files, and package_dir. Still, it adds significant context beyond the schema for the most critical parameters.

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 the tool's purpose: 'Synthesize the generated Verilog with yosys — the strongest signal that a design maps to real hardware.' It explicitly distinguishes from cg_simulate, which checks correctness, and explains what each verdict means, making the purpose unambiguous.

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?

The description provides explicit usage guidance: 'Run after cg_simulate passes.' It clarifies that the tool is not a correctness oracle and directs to cg_simulate for that. It also gives advice on when to adjust parameters like top and flow, and how to interpret results to know if the tool was used correctly.

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