SuperAPI AI Directory

naja-scope

Explore elaborated SystemVerilog/Verilog designs (RTL or gate-level netlists) with najaeda: trace fan-in/fan-out, walk module hierarchy and jump to source.

Open website

About this tool

Purpose

naja-scope is an MCP (Model Context Protocol) server whose goal is to let AI assistants explore elaborated SystemVerilog designs without pasting source code into the conversation. Large designs cannot fit into a chat window, directly pasting RTL is both slow and expensive, and models also struggle to reliably trace connectivity across hierarchies. naja-scope turns the design into structured objects that agents can navigate, letting agents ask targeted questions, such as what drives a certain signal, what is inside a certain module, or where a certain net comes from, and get small, precise answers with file and line number references. It is built on top of the najaeda netlist engine.

Main capabilities

  • Trace connectivity: find the drivers and loads of any signal across module boundaries.
  • Traverse hierarchy: explore modules, instances, and ports on demand.
  • Jump to source: every answer comes with a file:line range, so agents can reference the exact RTL.
  • Logic cones: trace fan-in/fan-out combinational logic cones up to register boundaries.
  • Recover design intent: retrieve enum state names, struct/union fields, and parameter formulas that usually disappear when a design is elaborated.
  • Works for both RTL and gate-level netlists: you can load elaborated SystemVerilog, or load a synthesized structural Verilog netlist together with its Liberty standard cell library, and navigate gate-level cells in the same way. VHDL loading is beta.

All responses are token-limited: lists are paginated, and large results are truncated with clear markers, keeping context small and answers accurate.

How to use

It can be connected to Claude Code, or added to any MCP client configuration. Once connected, you can have the assistant load a design and start exploring, for example: "Load my UART design from rtl/uart.sv with top uart_top, then show me everything that drives tx_o." After the agent loads a design once, it can answer follow-up questions instantly, without repeatedly reading source code or pasting large chunks of content.

For ChatGPT, because it connects to MCP servers through an HTTP endpoint (custom connectors/developer mode), naja-scope needs to be run as an HTTP server rather than stdio. In this way, MCP will serve at http://<host>:8000/mcp. Since ChatGPT accesses this server over the network, the URL needs to be exposed somewhere ChatGPT can see it, for example by setting up a public tunnel for local runs. Then in ChatGPT's Settings → Connectors (enable developer mode if necessary), add a custom connector and paste the server URL (https://<your-host>/mcp). Once connected, you can load a design and explore it as described above. Note: the HTTP server has no built-in authentication, so it should only be exposed through a trusted tunnel; for local experiments, a short-lived tunnel is recommended.

Gate-level design and VHDL

Synthesized designs: load a structural Verilog netlist together with the Liberty library defining its standard cells, and you can navigate gate-level cells just like RTL. For example: "Load the Liberty library pdk/stdcells.lib, then the gate netlist build/top.v, and tell me what cells top is built from and what drives data_out." Hierarchy, per-cell counts (get_module_card), drivers/loads, and logic cones all work on the netlist; cones stop at sequential cells. get_source shows the line of a cell or net in the netlist. For Yosys output, load with yosys_source_attributes=True: (* src = ... *) attributes become the origin, and the RTL can be read back via get_source(path, origin=0). There are runnable examples in examples/ (stdcells.lib + counter2.v + gate_level.py).

VHDL loading is in beta. Call load_vhdl(file=["pkg.vhd", "child.vhd", "top.vhd"], top="my_entity") to explore its elaborated hierarchy and connectivity; files can be listed in any order, and each call can also give just one path (load the package first); a package-only file may return top: null before the top-level file is loaded. The frontend supports a limitedtwo-state RTL subset, and the supported constructs may change. get_intent / load_intent currently only support SystemVerilog; source ranges for VHDL are not guaranteed.

What can be queried

After loading a design, the assistant can: resolve any signal or instance by hierarchical path (with glob and spelling suggestions); find objects by pattern across the design; show the hierarchy of any module; get the driver/loads of a net (true endpoints across hierarchy, with literal drivers preserving four-state 0/1/X/Z values); trace logic cones and see register frontiers; get source (the exact SystemVerilog line behind any object); get module cards (ports, counts, clock/reset overview); recover design intent (state machine names, struct fields, parameter expressions lost during elaboration). There are runnable end-to-end demos in examples/, including versions for CVA6 (a production-grade RISC-V core cloned on demand) and CORE-V-MCU (a complete multi-vendor RISC-V SoC).

Python escape hatch (off by default)

naja-scope also has a query_python tool that can run Python directly against a loaded design, for queries that the typed tools cannot express. It is not registered unless explicitly enabled. It is an unsandboxed eval/exec inside the server process, read-only by convention but not enforced, so anyone who can reach the server can run arbitrary Python as the server user. This is especially critical under --transport streamable-http, where the server listens on a socket. Keep it off unless you really need it and trust every client that can reach the endpoint.

Supported platforms and limitations

Works on all platforms where najaeda runs (Linux, macOS, Windows). The full test suite runs against a pure pip installation of najaeda, with no native build required. The CVA6 cross-hierarchy cone regression test is slow and is skipped automatically unless a CVA6 snapshot is present. CI tests every supported Python version on Linux x86_64, and provides native platform channels for Linux x86_64/aarch64, macOS x86_64/arm64, and Windows x86_64. The macOS x86_64 channel builds najaeda from the source distribution because PyPI currently does not provide Intel macOS wheels.

Optional browser schematic

Requires naja-schematic 0.2.0 or later (a release containing the embeddable viewer API). After installation, the MCP server must be restarted. After loading a design as usual, the following can be used: open_schematic(path="top.u_cpu") returns a local browser URL and focuses that instance; omitting path points to the top level, and anonymous #id instances are supported; annotate_schematic(items=[{"path": "top.u_cpu", "message": "Check reset", "severity": "warning"}]) replaces the overlay; using kind="term" with a pin/port path annotates that terminal; annotations apply to the entire port rather than a single bus bit; passing items=[] clears them; up to 200 annotations, each with a message of up to 2000 characters; get_schematic_selection() returns the last-clicked instance as a regular naja-scope path, which can be used for source, hierarchy, and module card queries. The viewer shares the existing raw naja universe and does not expand it again. The server binds to the loopback address and returns a URL with a token. That URL should be opened on the machine running the MCP server; it is not a remote or embedded MCP UI. Treat that URL as access to the loaded design. Loading/resetting a design refreshes open viewers and clears selections, focus, and annotations. The browser server stops with naja-scope. When the schematic extension is not installed, the existing tools still work normally.

Support and licensing

If you find a bug or have a feature request, you can open an issue on GitHub; contact email contact@keplertech.io. The license is Apache-2.0, see LICENSE for details.