API & MCP
Everything a person can do on Ohmforge Logic Simulator (VCD), a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://ohmforgelogicsimulator.usefulweb.site/api/v1/calculate– run Ohmforge Logic Simulator (VCD)GET https://ohmforgelogicsimulator.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Ohmforge Logic Simulator (VCD)
Simulate a digital circuit written as a small text netlist: gates, tri-state buffers, multiplexers, latches, D/JK/T flip-flops, counters and shift registers with propagation delays and four-valued logic (0, 1, x, z). You get a timing diagram, a timing table, a VCD file for GTKWave or PulseView, setup/hold violations and, for combinational circuits, the truth table.
| Field | Type | Default | Description |
|---|---|---|---|
netlist | textarea | "name Half adder\ninput A B\noutput S C\nxor U1 S A B delay=2\nand U2 C A B dela | Netlist. Native format or a structural Verilog subset (one module of single-bit nets: input/output/wire/reg, gate primitives, assign with & | ^ ~ ?: and #delay, always @(posedge clk [or posedge rst]) with <= and if/else; stimuli then go into the extra lines). Native format, one statement per line. Elements: TYPE NAME then nets (output first) or PIN=net, plus delay=N (or rise=/fall=), e.g. "and U1 Y A B delay=2", "dff F1 Q=q D=d CLK=clk RST=r setup=3". Types: and or nand nor xor xnor not buf bufif1 bufif0 notif1 notif0 mux2 mux4 dlatch srlatch dff jkff tff counter shiftreg. Sources: input, clock NET period=10 duty=0.5, stim NET 0:0 10:1, count A B period=10, const NET 1. Also output, bus, timescale, duration, name. # starts a comment. |
stimuli | textarea | — | Extra stimulus lines (optional). Appended to the netlist, e.g. "stim A 0:0 15:1 30:x". Handy for trying other inputs on the same circuit. |
duration | integer | 0 | Duration (time units, 0 = from the netlist). Integer time units of the timescale. 0 uses the netlist's duration line, the end of a count pattern, or 1.25 × the last stimulus. |
signals | text | — | Signals to show (optional). Comma-separated net or bus names for the diagram and table; empty shows all. The VCD always contains every net. |
Example request
Half adder with gate delays (XOR glitch window)
curl -X POST https://ohmforgelogicsimulator.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"netlist":"name Half adder\ninput A B\noutput S C\nxor U1 S A B delay=2\nand U2 C A B delay=1\ncount A B period=10"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://ohmforgelogicsimulator.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
ohmforge_logic_simulator - Local stdio connector:
node src/mcp-stdio.ts --tool=ohmforge-logic-simulator
{
"mcpServers": {
"ohmforge-logic-simulator": { "type": "http", "url": "https://ohmforgelogicsimulator.usefulweb.site/mcp" }
}
}