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.
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": {
"verilog_sources": "<verilog_sources>",
"toplevel": "<toplevel>",
"python_module": "<python_module>"
},
"name": "cocotb_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory where the files reside. | |
| toplevel | Yes | Name of the top-level Verilog module. | |
| simulator | No | Simulator engine to use (default: 'icarus'). | |
| dump_waves | No | Whether to record VCD waveforms. | |
| timeout_ms | No | Maximum simulation timeout in milliseconds (default: 30000). | |
| python_module | Yes | Name of the Python test module (e.g. 'test_dff' for test_dff.py). | |
| verilog_sources | Yes | List of Verilog/SystemVerilog source files for the DUT. |