Skip to main content
Glama

cocotb_run

Run Cocotb co-simulation tests by compiling Verilog sources, executing a Python testbench, and returning structured JSON pass/fail results with tracebacks.

Instructions

Compiles a Verilog DUT, executes an asynchronous Python cocotb testbench, and parses results into structured JSON test reports with assertion tracebacks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory where the files reside.
toplevelYesName of the top-level Verilog module.
simulatorNoSimulator engine to use (default: 'icarus').
dump_wavesNoWhether to record VCD waveforms.
timeout_msNoMaximum simulation timeout in milliseconds (default: 30000).
python_moduleYesName of the Python test module (e.g. 'test_dff' for test_dff.py).
verilog_sourcesYesList of Verilog/SystemVerilog source files for the DUT.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It transparently states the main flow — compile, execute, parse — and even names the output shape. However, it omits side effects for a tool that compiles and runs external simulators: build artifacts, VCD files when dump_waves is set, spawned processes, timeout termination behavior, and compile-failure handling.

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?

A single well-structured sentence with zero filler. Each clause earns its place: compilation, execution, then result parsing with a specific output detail. The main action is front-loaded and the sentence is easily scannable.

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

Completeness3/5

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

For a complex 7-parameter tool with no annotations and no output schema, the description covers the core flow and hints at the return value (JSON reports with tracebacks), which is a good start. But it is incomplete: no mention of prerequisites (simulator binaries, cocotb installation), filesystem side effects, failure modes, or how tests are discovered within python_module.

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 coverage is 100%, so every parameter already has a description, yielding a baseline of 3. The tool description adds marginal pipeline context (e.g., 'compiles the Verilog DUT' maps to verilog_sources and toplevel) but does not clarify parameter formats, defaults, or constraints beyond what the schema already provides.

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 names three specific actions (compiles, executes, parses), specific resources (Verilog DUT, cocotb testbench), and a concrete output (structured JSON reports with assertion tracebacks). This clearly distinguishes it from siblings like cocotb_list_tests, cocotb_generate_runner, and cocotb_toolchain_info, which cover discovery, scaffolding, and environment info rather than the full simulation run.

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

Usage Guidelines3/5

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

The pipeline description implies usage: call this when you want to compile a DUT, run a testbench, and get JSON results. However, it never states when to prefer this over siblings (e.g., list tests first with cocotb_list_tests, generate a runner with cocotb_generate_runner) and gives no exclusions or prerequisites such as simulator installation.

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

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/zesun33/mcp-cocotb'

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