# Verilog Simulator API: Testbench, Waveform, Lint & Synthesis (`jumblemog/verilog-simulator`) Actor

Run a Verilog or SystemVerilog testbench in the cloud and get pass or fail, the output, a waveform picture and a table of signal changes. Lint with Verilator and synthesize with Yosys for gate, flip-flop and FPGA LUT counts and a schematic. For AI agents that write HDL, CI and teaching.

- **URL**: https://apify.com/jumblemog/verilog-simulator.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Verilog Simulator API: Testbench, Waveform, Lint & Synthesis

**Send Verilog or SystemVerilog, get back whether it works.** The testbench is really simulated, the design is linted and synthesized, and the answer comes as data a program or an AI agent can act on:

- **Pass or fail** for the testbench, with the reasons: `$error` and `$fatal` calls, the first output line that reports a failure, the first compile error with its file and line, or a timeout.
- **The simulation's output**, everything `$display` printed.
- **A waveform picture** of the run, and the **same waveform as a table** of signal values at every change, so an agent can read it without opening a viewer. The VCD file too, if you want it.
- **A lint report** from Verilator: width mismatches, unused and undriven signals, missing cases, each with its code, file, line and column.
- **A synthesis report** from Yosys: gates and flip-flops, or look-up tables, carry cells, memory and DSP blocks for Lattice iCE40, Lattice ECP5, Xilinx 7 series and Gowin FPGAs; inferred latches; and the logic depth between registers.
- **A schematic** of the design's top module, and the synthesized netlist.

![The waveform this Actor drew for its built-in example, a UART transmitter under test: a 100 MHz clock, the reset, the serial tx line sending four bytes, the bytes 55, a3, 00 and ff on the data bus, the received byte being shifted in bit by bit with unknown bits in red, and the transmitter's state, bit index and tick counter](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/verilog-simulator-example.png?signature=1d9k8oZm0n95W2zThZAu)

It runs three open-source tools that hardware engineers use every day: [Icarus Verilog](https://github.com/steveicarus/iverilog) 12 for simulation, [Verilator](https://www.veripool.org/verilator/) 5 for lint and [Yosys](https://yosyshq.net/yosys/) 0.52 for synthesis. Nothing to install, no license server, one HTTP call.

It's made for:

- **AI agents that write hardware code.** A model that writes Verilog needs to run it. Give it this Actor as a tool and it can write a module and a testbench, see what failed and on which line, read the waveform as a table, and fix it.
- **Continuous integration** for small HDL projects: point it at a repository or a ZIP and fail the pipeline when `passed` is false.
- **Teaching and homework checking**: run a class's submissions against one testbench in a batch, with a waveform picture for each.
- **Quick checks**: "does this compile", "how many LUTs is this on an iCE40", "did I infer a latch".

### How to use it

1. Paste the design into **Verilog source**. The testbench can be in the same text or in **Testbench**. Write `example` to try the built-in UART transmitter.
2. Or send several files in **More files**, or link to them: a `.v` file, a ZIP, or a GitHub folder or repository.
3. Click **Start**. The result has the verdict, the output, the waveform, the lint report and the synthesis report, with links to the pictures.

Everything else is optional: the FPGA family, which signals to show, a time window, defines and parameters.

#### What you can send

| You send | What happens |
|---|---|
| `code` with a design and its testbench | Simulated, linted and synthesized |
| `code` with only a design | Linted and synthesized; nothing to simulate |
| `code` and `testbench` | The same as one text with both |
| `files`: `{"alu.v": "...", "alu_tb.v": "...", "defs.vh": "...", "rom.hex": "..."}` | A project of several files; `` `include `` and `$readmemh` find them by name |
| A link to a `.v` or `.sv` file, or to a ZIP archive | The file, or every source file in the archive |
| A GitHub repository or folder link (`https://github.com/user/repo/tree/main/rtl`) | Every source file in it |
| `designs`: a list of the above | One result per design, in one run |
| `example` | The built-in UART transmitter and its testbench |

The testbench is found by itself: a module that nothing else uses, has no ports and has an `initial` block. The design's top module is the one the testbench instantiates. Name them with `top` and `designTop` when a project has several.

### Examples

All numbers are from this Actor, on the built-in example (a UART transmitter, 60 lines, with a testbench that sends four bytes and checks each one).

| Input | Result |
|---|---|
| `{"code": "example"}` | `passed`: 1.665 us simulated, ended by `$finish`. Lint: clean. Synthesis for generic gates: 130 cells, 30 flip-flops, 100 gates, logic depth 9 |
| `"target": "ice40"` | 90 cells: 45 LUTs, 30 flip-flops, 15 carry cells |
| `"target": "ecp5"` | 93 cells: 39 LUTs, 30 flip-flops, 8 carry cells |
| `"target": "xilinx"` | 60 cells: 16 LUTs, 30 flip-flops, 5 carry cells, logic depth 5 |
| `"target": "gowin"` | 77 cells: 25 LUTs, 30 flip-flops, 19 carry cells |
| The example with one bit inverted in the design | `failed`: "5 output line(s) report a failure; the first is: FAIL: sent 55, received aa" |
| The example with a semicolon missing | `compile error`: "uart_tx.v:42: syntax error", reported by all three tools with the line |
| `"stopAfter": "700ns"` | `stopped early` at 700 ns, with the waveform up to there |

### How-to examples

#### How to run a Verilog testbench online

Put the design and the testbench in `code` (or the testbench in `testbench`) and start the run. No simulator to install. The testbench should end with `$finish`. The result's `passed` says whether it went well, `simulation.output` has what it printed, and `waveformUrl` is the picture.

```json
{
  "code": "module counter(input clk, input rst, output reg [3:0] q);\n  always @(posedge clk) q <= rst ? 4'd0 : q + 4'd1;\nendmodule",
  "testbench": "module tb;\n  reg clk = 0, rst = 1; wire [3:0] q;\n  counter dut(clk, rst, q);\n  always #5 clk = ~clk;\n  initial begin\n    #12 rst = 0;\n    repeat (5) @(posedge clk);\n    #1 if (q !== 4'd5) $error(\"q is %0d, expected 5\", q);\n    $finish;\n  end\nendmodule"
}
```

#### How to tell whether a testbench passed

A testbench has no exit code, so this Actor reads the signs a person would:

- `$error` or `$fatal` was called: failed.
- A line of the output says `FAIL`, `failed`, `mismatch` or `error`: failed. Lines that count zero, such as `0 errors` or `Failed: 0`, don't count.
- It didn't compile, or was still running at the time limit: failed.
- Otherwise: passed.

`reasons` lists what was found. If your testbench has its own wording, set `failPattern` (a regular expression for a failing line) or `passPattern` (one the output must match, such as `ALL TESTS PASSED`). An empty `failPattern` turns the word check off, so only `$error` and `$fatal` count.

#### How to let an AI agent verify the Verilog it writes

Give the agent this Actor through the [Apify MCP server](https://mcp.apify.com) or the API. A loop that works: the agent writes the module and a self-checking testbench, calls the Actor, and reads `passed`, `reasons`, `simulation.messages` (compile errors with file and line) and `simulation.output`. When a test fails, `waveform.trace` holds the signal values at every change as rows of `[time, value, value, ...]`, which a model reads far better than a picture. Ask for the signals that matter with `waveSignals` and a time window with `waveFrom` and `waveTo` to keep it short.

#### How to count LUTs and flip-flops for an FPGA

Set `target` to `ice40`, `ecp5`, `xilinx` or `gowin`. `synthesis.luts`, `flipFlops`, `carries`, `memoryBlocks` and `dspBlocks` are the totals, and `cellsByType` has every cell by its vendor name (`SB_LUT4`, `LUT6`, `FDRE`, `CARRY4`...). Turn simulation off with `"actions": ["synthesize"]` if you only want the count.

#### How to find inferred latches and other design mistakes

Run with `"actions": ["lint", "synthesize"]`. `synthesis.latches` counts latches, and `synthesis.messages` names each signal that became one ("Latch inferred for signal q in lat: it isn't assigned on every path"). `lint.messages` has Verilator's findings with their codes: `WIDTHTRUNC` and `WIDTHEXPAND` for width mismatches, `UNUSEDSIGNAL`, `UNDRIVEN`, `CASEINCOMPLETE`, `BLKSEQ` and the rest.

#### How to get a waveform picture or a VCD file from a testbench

The picture comes by default. You don't need `$dumpfile` and `$dumpvars` in the testbench: when it has none, every signal is recorded for you. Add `"vcd"` to `outputs` for the file, which opens in GTKWave, Surfer or the WaveTrace extension of VS Code. Choose signals with `waveSignals` (`["clk", "state", "dut.fifo.*"]`), a window with `waveFrom` and `waveTo` (`"200ns"`, `"1.5us"`), and `radix` for hex, decimal or binary values.

#### How to simulate a project from GitHub

Put the repository or folder link in `urls`. Every `.v` and `.sv` file is compiled, headers and memory files are found by `` `include `` and `$readmemh`, and the testbench is picked by itself. In a repository with several testbenches, name the one to run with `top`.

#### How to check many designs in one run

Send `designs`, a list of objects with `code`, `testbench`, `files` or `urls` each, and a `name` if you like. Each one is a row in the results. Fields such as `target` or `stopAfter` can be set for all at the top, or inside one design to change it there.

### FAQ

#### Which simulator is this?

Icarus Verilog 12, with `-g2012`. It runs Verilog 1995, 2001 and 2005 fully and the everyday part of SystemVerilog: `logic`, `always_ff`, `always_comb`, enums, typedefs, packed structs, packages with `import`, immediate assertions. It does not run classes, UVM, `program` blocks with clocking, concurrent assertions (`assert property`) or assignment patterns (`'{...}`). What it can't do, it says, and that is in `simulation.messages`.

#### Does it do VHDL?

No. Verilog and SystemVerilog only.

#### Does it give a maximum clock frequency?

No. That needs place and route for one exact chip. `synthesis.logicDepth` is the next best thing without it: the longest path between two registers, counted in cells (gates, look-up tables, carry cells). Fewer levels means a faster design.

#### My testbench has no `$finish`. What happens?

A simulation with a free-running clock never ends by itself, so it runs until the time limit (30 seconds unless you change `timeoutSecs`) and is reported as `timed out`. Set `stopAfter` to a simulated time such as `10us` to end it there instead; the verdict is then `stopped early` with `passed` empty, unless you give a `passPattern`.

#### What does a red or amber part of the waveform mean?

Red is unknown (`x`): a register that hasn't been reset or a wire with no driver. Amber is high impedance (`z`). In the table and the picture, a hex digit `x` is all unknown, `z` all high impedance, and a capital `X` partly unknown.

#### Why is my clock not in the table?

`waveform.trace` leaves clocks out, because every row would be a clock edge. They are listed in `waveform.clocks` with period and frequency, and they are in the picture.

#### Is the code I send safe to run here, and is my run safe from it?

The simulation runs in a throwaway folder as an unprivileged user without the run's environment, with limits on time, output and file size. Icarus Verilog has no way to run programs from Verilog code. Each run is its own container that is deleted afterwards.

#### Can it synthesize SystemVerilog?

The part Yosys reads, which is smaller than what the simulator takes: `logic`, `always_ff`, `always_comb`, enums, typedefs and packed structs. `import pkg::*` is not read by this Yosys version. Where it stops, `synthesis.ok` is false and the message has the file and line. Simulation and lint still give their answers.

#### What does a run cost when the design is broken?

The same as when it works: one cent. A compile error with its line, or a failed test with its reason, is the answer you asked for. Only input that can't be read at all (no source, a dead link, a file that isn't text) is free.

### Input

| Field | What it is | Default |
|---|---|---|
| `code` | Verilog or SystemVerilog source, design and testbench together or the design alone. `example` runs the built-in example | |
| `testbench` | The testbench, when kept apart | |
| `files` | More files by name: sources, headers, memory files | |
| `urls` | Links to `.v` or `.sv` files, ZIP archives, GitHub files, folders or repositories | |
| `actions` | `simulate`, `lint`, `synthesize` | all three |
| `target` | `generic`, `ice40`, `ecp5`, `xilinx`, `gowin` | `generic` |
| `top` | The testbench module | found |
| `designTop` | The design's top module | found |
| `stopAfter` | End the simulation at this simulated time: `500ns`, `20us`, `1ms` | |
| `timeoutSecs` | Real seconds the simulation may run (up to 900; each 30 seconds of tool time is one cent) | 30 |
| `standard` | `2012`, `2009`, `2005-sv`, `2005`, `2001`, `1995` | `2012` |
| `defines` | Macros: `{"SIMULATION": 1}` | |
| `parameters` | Parameter values for the testbench module | |
| `designParameters` | Parameter values for the design's top module in lint and synthesis | |
| `plusargs` | Arguments for `$test$plusargs` and `$value$plusargs`: `["seed=42"]` | |
| `failPattern`, `passPattern` | Regular expressions for a failing line, and for a line the output must have | words such as FAIL |
| `outputs` | `waveform`, `vcd`, `schematic`, `netlist` | `waveform`, `schematic` |
| `waveSignals` | Signals to show, by name or pattern, in order | the testbench's own, then one level down |
| `waveFrom`, `waveTo` | The time window of the picture and the table | the whole run |
| `radix` | `hex`, `dec`, `bin` | `hex` |
| `imageWidth`, `maxSignals`, `maxTraceRows`, `maxOutputChars` | Sizes of the picture, the table and the output text | 1600, 32, 200, 20000 |
| `designs` | A list of designs for a batch | |

### Output

One row per design. The first row is also the run's `OUTPUT` record, which the `run-sync` API endpoint returns.

| Field | What it is |
|---|---|
| `passed` | `true`, `false`, or empty when nothing was simulated or the run was cut short |
| `verdict` | `passed`, `failed`, `compile error`, `timed out`, `stopped early`, `no testbench`, `not simulated` |
| `reasons` | Why it failed |
| `summary` | The whole result in a few sentences |
| `top`, `designTop`, `modules` | The testbench, the design's top module, and every module found |
| `simulation` | `compiled`, `ended` (`$finish`, `$fatal`, `$stop`, `no more events`, `stopAfter`, `time limit`, `output limit`), `errors`, `fatals`, `warnings`, `simTime`, `simTimeNs`, `output`, and `messages`: compiler errors and warnings as `{severity, file, line, message}` |
| `waveform` | `signals` (`name`, `width`, `changes`, `last`), `clocks` (`name`, `periodNs`, `frequencyMhz`), and `trace`: `columns` and `rows` of `[time, value, ...]` in `timeUnit` |
| `lint` | `clean`, `errorCount`, `warningCount`, and `messages` as `{severity, code, file, line, column, message}` |
| `synthesis` | `ok`, `target`, `cells`, `cellsByType`, `rtlCells` (adders, multiplexers and registers before mapping), `flipFlops`, `latches`, `luts`, `carries`, `memoryBlocks`, `dspBlocks`, `gates`, `memoryBits`, `logicDepth`, and `messages` |
| `waveformUrl`, `vcdUrl` | The waveform picture and file |
| `schematicUrl`, `schematicPngUrl` | The schematic as SVG and PNG |
| `netlistUrl`, `netlistVerilogUrl` | The synthesized netlist as Yosys JSON and as Verilog |
| `logUrl` | The whole output, when it was too long for the row |
| `tools`, `toolSeconds` | The versions of the three tools, and the seconds they ran (what the price follows) |
| `status`, `error` | `ok` when the design was checked; `failed` with the reason when the input couldn't be used |

### How it works

1. The source is read just far enough to find its modules, which one is the testbench and which the design.
2. Icarus Verilog compiles everything and runs the testbench. If the testbench doesn't record a waveform itself, a recorder is added beside it without touching your code or its timing.
3. The waveform file is read: the signals to show are chosen, clocks are recognised, and the picture and the table are made.
4. The design, without the testbench, goes to Verilator with all warnings on, and to Yosys, which maps it to gates or to the FPGA family you chose. The schematic is drawn by Graphviz from the design before mapping.
5. The verdict is worked out from the compile result, `$error` and `$fatal`, the output and the time limit.

### Pricing

**$0.01 per design checked**, whichever of the three steps you ask for, with the waveform, schematic and files included. That covers 30 seconds of work by the tools, and almost every design needs a second or two. A long simulation or a large synthesis is $0.01 more for each further 30 seconds (`toolSeconds` in the result says how long they ran), so with the default time limit a design costs one cent, or two when its simulation runs into the 30-second limit. A design that doesn't compile or fails its test is a result and counts. Input that can't be read is not charged. There is no start fee.

### Speed

The built-in example takes about 2 seconds for everything at the default 2 GB of memory: under 0.1 s to compile and simulate, the rest for lint, synthesis and the pictures. Synthesis for Xilinx takes a second or two longer than the other targets. A run also has a few seconds of start-up, so a call that waits for the answer takes about 10 seconds. Long simulations run at the speed of Icarus Verilog on one core; run the Actor with 4 GB of memory, its most, for a full core.

### Tips and limits

- End the testbench with `$finish`, and report failures with `$error`, `$fatal` or a line that says `FAIL`.
- `%t` and `$time` print in your testbench's own `` `timescale ``.
- The simulation's output is kept up to 4 MB and the recorded waveform up to 150 MB; beyond that the simulation is stopped or the waveform ends early, and the result says so. For long runs, record less: a `stopAfter`, or your own `$dumpvars` on the part you need.
- The schematic is drawn for top modules of up to 400 cells. A larger one can't be read as a picture; use the netlist.
- Source up to 20 MB and 2,000 files per design.
- Encrypted IP, vendor primitives without their simulation models, and mixed VHDL projects don't work.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool. Pass `code` and `testbench`, and read `passed`, `reasons`, `summary`, `simulation.output`, `simulation.messages` and `waveform.trace`. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~verilog-simulator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code": "module inv(input a, output y); assign y = ~a; endmodule", "testbench": "module tb; reg a; wire y; inv dut(a, y); initial begin a = 0; #1 if (y !== 1) $error(\"y should be 1\"); a = 1; #1 if (y !== 0) $error(\"y should be 0\"); $finish; end endmodule"}'
```

`run-sync` instead returns the run's `OUTPUT`: the first design's row as JSON.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/verilog-simulator").call(run_input={
    "files": {"alu.v": open("alu.v").read(), "alu_tb.v": open("alu_tb.v").read()},
    "target": "ice40",
    "waveSignals": ["clk", "op", "a", "b", "result", "dut.carry"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["verdict"], item["reasons"])
    print(item["simulation"]["output"])
    print(item["synthesis"]["luts"], item["synthesis"]["flipFlops"], item["waveformUrl"])
```

### Credits

- Simulation: [Icarus Verilog](https://github.com/steveicarus/iverilog) by Stephen Williams (GPL-2.0).
- Lint: [Verilator](https://www.veripool.org/verilator/) by Wilson Snyder and contributors (LGPL-3.0 or Artistic-2.0).
- Synthesis: [Yosys](https://github.com/YosysHQ/yosys) by Claire Wolf and contributors (ISC), with [ABC](https://github.com/berkeley-abc/abc) from Berkeley.
- Schematics: [Graphviz](https://graphviz.org) (EPL). Waveform pictures: [Pillow](https://python-pillow.org).
- All four tools are used unmodified, as packaged by Debian; their source code is at the links.
- The example design is this Actor's own.

# Actor input Schema

## `code` (type: `string`):

The design, with or without its testbench in the same text. Verilog or SystemVerilog. Write `example` to try the built-in example, a UART transmitter with its testbench.

## `testbench` (type: `string`):

The testbench, when you keep it apart from the design: a module without ports that drives the design and ends with $finish. Report failures with $error, $fatal or a line that says FAIL.

## `files` (type: `object`):

Source, header and memory files by name, such as {"alu.v": "module alu ...", "defs.vh": "`define W 8", "rom.hex": "00\n1f"}. `include and $readmemh find them by these names.

## `urls` (type: `array`):

Links to .v or .sv files or to ZIP archives of a project. GitHub file, folder and repository links, GitLab file links, Google Drive and Dropbox share links work.

## `uploads` (type: `array`):

Upload .v or .sv files, or a ZIP archive of a project, from your computer.

## `actions` (type: `array`):

All three by default. Simulation needs a testbench; lint and synthesis need a design module.

## `target` (type: `string`):

What the design is mapped to. Generic counts AND, OR, XOR, multiplexer gates and flip-flops; the FPGA families count look-up tables, flip-flops, carry cells, memory and DSP blocks.

## `top` (type: `string`):

The module to simulate. Left empty, it is found: a module nothing else uses, without ports, with an initial block.

## `designTop` (type: `string`):

The module to lint and synthesize. Left empty, it is the module the testbench instantiates, or the one nothing else uses.

## `stopAfter` (type: `string`):

A simulated time such as 500ns, 20us or 1ms, for a testbench that never calls $finish or to look at the start of a long one. A plain number counts nanoseconds (time units, when the source has no \`timescale).

## `timeoutSecs` (type: `integer`):

Real seconds the simulation may run. A simulation that is still running then is stopped and reported as timed out, with the output and waveform it made so far. One cent covers 30 seconds of tool time; each further 30 seconds is one cent more.

## `standard` (type: `string`):

What the simulator accepts. SystemVerilog 2012 also takes plain Verilog; pick an older one to check that a design keeps to it.

## `defines` (type: `object`):

Macros for all three tools, as with +define+: {"SIMULATION": 1, "WIDTH": 16}.

## `parameters` (type: `object`):

Values for parameters of the testbench module: {"CYCLES": 1000}.

## `designParameters` (type: `object`):

Values for parameters of the design's top module in lint and synthesis: {"WIDTH": 32}. The simulation uses what the testbench sets.

## `plusargs` (type: `array`):

Arguments the testbench reads with $test$plusargs or $value$plusargs, such as seed=42 or verbose.

## `failPattern` (type: `string`):

A regular expression: an output line that matches means the test failed. Left empty, lines with the words fail, failed, mismatch or error count, except those that report zero ("0 errors"). $error and $fatal always count. Send an empty text in the API to turn the word check off.

## `passPattern` (type: `string`):

A regular expression that the output must match for the test to pass, such as ALL TESTS PASSED.

## `outputs` (type: `array`):

The results always come as data. These are the files on top.

## `waveSignals` (type: `array`):

Names or patterns, in the order to show them: clk, state, dut.\*, dut.fifo.count. Left empty: the testbench's own signals, clocks and resets first, then the design's signals one level down.

## `waveFrom` (type: `string`):

Start of the picture and the table, such as 200ns. Left empty: the start of the simulation.

## `waveTo` (type: `string`):

End of the picture and the table, such as 450ns. Left empty: the end of the simulation.

## `radix` (type: `string`):

How multi-bit values are written in the picture and the table.

## `imageWidth` (type: `integer`):

Width of the waveform picture.

## `maxSignals` (type: `integer`):

Most signals in the picture and the table.

## `maxTraceRows` (type: `integer`):

Most rows of the table of signal changes in the result. 0 leaves the table out.

## `maxOutputChars` (type: `integer`):

Longer simulation output is shortened in the result (start and end kept) and saved in full as a file.

## `designs` (type: `array`):

Check several designs in one run: a list of objects with code, testbench, files or urls, and optionally a name and any other field of this form to override it, such as \[{"name": "adder", "code": "...", "testbench": "..."}, {"urls": \["https://.../fifo.zip"], "target": "ice40"}].

## `maxDesigns` (type: `integer`):

A safety limit for batches.

## Actor input object example

```json
{
  "code": "example",
  "actions": [
    "simulate",
    "lint",
    "synthesize"
  ],
  "target": "generic",
  "timeoutSecs": 30,
  "standard": "2012",
  "outputs": [
    "waveform",
    "schematic"
  ],
  "radix": "hex",
  "imageWidth": 1600,
  "maxSignals": 32,
  "maxTraceRows": 200,
  "maxOutputChars": 20000,
  "maxDesigns": 100
}
```

# Actor output Schema

## `results` (type: `string`):

One item per design: verdict, simulation output, signal changes, lint messages, synthesis counts and links to the files.

## `files` (type: `string`):

The waveform pictures, VCD files, schematics and netlists in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "code": "example"
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/verilog-simulator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "code": "example" }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/verilog-simulator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "code": "example"
}' |
apify call jumblemog/verilog-simulator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/verilog-simulator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hIycnhVLoguKeClOz/builds/91hgIddh87Yv3vgi5/openapi.json
