Skip to main content
Glama

build_gateware

Compiles an Amaranth design into an ECP5 .bit bitstream for the Cynthion via yosys, nextpnr-ecp5, and ecppack, then load it with configure_bitstream. Reports failures with the build log tail.

Instructions

Build an Amaranth design for the Cynthion ECP5 into a .bit bitstream in a subprocess (yosys -> nextpnr-ecp5 -> ecppack), with progress. Never touches the board; load the result with configure_bitstream(path=). Design/toolchain failures are reported as [BUILD_FAILED] with the log tail.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source": "<source>"
    },
    "name": "build_gateware"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNoTop-level attribute (class, instance or zero-arg factory). Default: auto-detect top/Top/create_top() or the single Elaboratable.
sourceYesPath to a Python (.py) file defining an Amaranth design.
timeout_sNoKill the build after this many seconds.
extra_argsNoAmaranth toolchain overrides: dict, JSON object or ['key=value', ...], e.g. {'nextpnr_opts': '--seed 2', 'verbose': true}.
output_dirNoBuild directory (default: a timestamped folder in the server output directory).
elaborate_onlyNoOnly elaborate and write the build plan (RTLIL, LPF, scripts); no toolchain needed.
platform_revisionNoCynthion hardware revision, e.g. 'r1.4' (default r1.4).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnly=false, openWorld=false, destructive=false; the description adds substantive context beyond them: execution happens in a subprocess, progress is reported, hardware state is never modified, and failures surface as [BUILD_FAILED] with a log tail. That failure-mode disclosure is exactly the kind of behavioral detail an agent needs to interpret errors without guessing.

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 tight sentences with the core purpose front-loaded, followed by the safety boundary and the failure contract. No filler, no restatement of the name, and each sentence contributes a distinct fact.

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

Completeness5/5

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

With an output schema present the description needn't explain return values, and full schema coverage handles parameters. Against that bar the description covers what remains: pipeline, subprocess isolation, board safety, failure signaling, and the next step to use the artifact — nothing an agent needs to invoke it correctly is missing.

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?

Schema description coverage is 100%, so per-parameter meaning (top auto-detection, extra_args formats, timeout bounds, elaborate_only, platform_revision) is already fully documented in structured fields. The description adds only indirect color by naming the toolchain, implying what extra_args overrides target; it adds no syntax or constraint detail beyond the schema, so baseline 3 applies.

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?

Names a specific verb (Build), the input (Amaranth design for the Cynthion ECP5), the output artifact (.bit bitstream), and the underlying toolchain stages (yosys -> nextpnr-ecp5 -> ecppack). The closing clause explicitly separates it from board-touching siblings like configure_bitstream, so an agent can distinguish it without inspecting schemas.

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?

States the positive case (turn a design into a bitstream), the negative case ("Never touches the board"), and the follow-up alternative ("load the result with configure_bitstream(path=<bitstream>)"). It also implicitly scopes out runtime/flash operations, leaving no ambiguity about when this tool is the wrong choice.

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