Skill: Infrastructure Setup
Invocation
- If invoked by a user presenting a setup task: immediately spawn the
digital-chip-design-agents:infrastructure-orchestratoragent and pass the full user request and any available context. Do not execute stages directly. - If invoked by the
infrastructure-orchestratormid-flow: do not spawn a new agent. Treat this file as read-only — return the requested stage rules, sign-off criteria, or loop-back guidance to the calling orchestrator.
Spawning the orchestrator from within an active orchestrator run causes recursive delegation and must never happen.
Purpose
Detect open-source and proprietary EDA tools, generate an installation script for missing tools, deploy output-filtering shell wrappers that emit compact JSON instead of raw 10,000–50,000-line logs, configure MCP server templates, and validate the complete environment before any domain orchestrator begins work.
Supported EDA Tools
Open-Source
- Verilator (
verilator) — fast RTL simulator and linter - Slang (
slang) — SystemVerilog compiler and language server - Surelog (
surelog) — SystemVerilog pre-processor and parser - sv2v (
sv2v) — SystemVerilog to Verilog converter - Icarus Verilog (
iverilog) — Verilog simulator - Yosys (
yosys) — open synthesis framework - ABC (
abc) — logic synthesis and verification tool - OpenROAD (
openroad) — RTL-to-GDS flow - LibreLane / OpenLane2 (
openlane) — open-source ASIC flow - KLayout (
klayout) — GDS/OASIS viewer and DRC engine - OpenSTA (
sta) — gate-level static timing analysis - SymbiYosys (
sby) — formal hardware verification - gem5 (
gem5) — full-system micro-architectural simulator - Bambu HLS (
bambu-hls) — high-level synthesis from C/C++ - nextpnr (
nextpnr) — FPGA place-and-route - openFPGALoader (
openFPGALoader) — FPGA programming tool - cocotb (Python package
cocotb) — Python-based RTL co-simulation - LLVM (
llvm-config) — compiler infrastructure - GCC (
gcc) — GNU compiler collection - OpenOCD (
openocd) — on-chip debugger - xschem (
xschem) — schematic capture and simulation netlist tool - GTKWave (
gtkwave) — waveform viewer for VCD/FST simulation output - uv (
uv) — fast Python package and project manager (required for cocotb installs)
Proprietary (detect only — never install)
- Synopsys VCS (
vcs) — industry-standard RTL simulator - Cadence Xcelium (
xrun, alt:xmsim) — next-generation simulation platform - Synopsys Design Compiler (
dc_shell, alt:dc_shell-t) — logic synthesis - Cadence Innovus (
innovus) — physical implementation - Mentor QuestaSim (
vsim, alt:questa,questasim) — advanced simulation and verification - Synopsys PrimeTime (
pt_shell, alt:pt_shell64) — sign-off static timing analysis - Synopsys Formality (
formality, alt:fm_shell) — formal equivalence checking
MCP Architecture — Two Tiers
Tier 1: Batch MCP servers (short, self-contained runs)
Use these for tools whose output fits inside a single request/response cycle (seconds to a few minutes). Each call spawns the wrapper script, captures its compact JSON output, and returns it.
| MCP config | Tool | Typical duration |
|---|---|---|
mcp-yosys.json |
Yosys synthesis | seconds–minutes |
mcp-openroad.json |
Single OpenROAD stage | minutes |
mcp-opensta.json |
OpenSTA batch report | seconds–minutes |
mcp-klayout.json |
KLayout DRC/LVS | minutes |
mcp-verilator.json |
Verilator lint or sim | seconds–minutes |
mcp-bambu.json |
Bambu HLS synthesis | minutes |
mcp-gem5.json |
gem5 short benchmark run | minutes (set TOOL_TIMEOUT_S) |
mcp-symbiflow.json |
SymbiYosys bounded proof | minutes–hours (set TOOL_TIMEOUT_S) |
The adapter is plugins/infrastructure/tools/mcp-adapter.py.
Tier 2: Interactive session MCP servers (stateful, query-based)
Use these when an agent iterates many times over an already-loaded design (e.g. ECO timing loops). The process stays alive between calls — no re-loading per query.
| MCP config | Tool | Exposed tools |
|---|---|---|
mcp-openroad-session.json |
OpenROAD Tcl session | load_design, query_timing, query_drc, get_design_area, get_power, run_tcl, close_design |
mcp-opensta-session.json |
OpenSTA Tcl session | load_design, report_timing, report_slack_histogram, check_timing, run_tcl, close_design |
The adapter is plugins/infrastructure/tools/mcp-session-adapter.py.
Full-flow tools — do NOT use MCP
These tools run for 30 min–2+ hours and produce structured output files on disk. Agents must launch them via Bash and read the output files directly.
| Tool | Launch command | Read these files |
|---|---|---|
| LibreLane / OpenLane 2 | openlane config.json |
runs/<design>/<tag>/metrics.json |
| ORFS / OpenROAD Flow Scripts | make DESIGN_CONFIG=... finish |
reports/<platform>/<design>/metrics.json |
| gem5 full-system simulation | gem5 config.py ... |
m5out/stats.txt, m5out/simout |
Execution Hierarchy (per domain agent)
- Tier 2 session MCP — if the tool supports a session and the design is already loaded
- Tier 1 batch MCP — if the tool has a batch MCP server configured
- Wrapper script — if MCP is not configured; wrapper emits compact JSON
- Direct execution — last resort; raw logs consume significant context
Domain agents must check whether the relevant MCP server is active in .claude/settings.json
before falling back to the wrapper or direct execution.
Stage: tool_discovery
Domain Rules
Run
which <command>and<command> --version(or-version) for every open-source toolPython interpreter detection — run once at the start of tool_discovery, before checking any Python packages. Detection order (first match wins):
Step A — Module system probe (runs before PATH check): a. Check if a module system is available: test
$MODULESHOMEis set ORmodulecmdexists in PATH. b. If a module system is available, runmodule avail 2>&1and search for entries matchingpythonorpython3(case-insensitive). c. If one or more Python module entries are found: select the latest version (highest semver/lexicographic), load it viamodule load <python-module>, then runwhich python3to resolvePYTHON_EXEC. Setpython_env.type = "module"and recordpython_env.module_namewith the loaded module name. Keep the module loaded for the entire orchestrator run — do not unload it; subsequent stages (tool_installation, wrapper_deployment, environment_validation) all depend onPYTHON_EXECbeing resolvable. The generatedload-modules.shhandles persistent loading for future shell sessions. d. If no module system is available, or no Python module entries are found: proceed to Step B.Step B — PATH-based fallback: e. Run
which python3to get the interpreter path; store asPYTHON_EXEC. f. Ifwhich python3fails or returns empty: recordpython3asMISSINGintool-status.jsonand FAIL immediately (required for all wrapper scripts and Python packages). g. Classify the interpreter:system→PYTHON_EXEC==/usr/bin/python3custom→ any other path (pyenv, conda, virtualenv, custom prefix, etc.)
Step C — Finalize: h. Set
PYTHON_BIN_DIR = $(dirname "$PYTHON_EXEC")regardless of howPYTHON_EXECwas resolved. i. Record under a top-level keypython_envintool-status.json:{ "python_env": { "exec": "<absolute path>", "type": "module | system | custom", "bin_dir": "<absolute dir>", "module_name": "<module name, or null if not module-based>" } }j. Capture
"$PYTHON_EXEC" --versionand store it as a regular entry in thetoolsarray (with"tool": "python3","command": "python3","status": "FOUND","version": "<output>","path": "<PYTHON_EXEC>"). This makespython3visible tomodule_discoveryfor module-status upgrades (FOUND_PREFER_MODULE).Exception — Python packages:
- cocotb: detection depends on the Python interpreter type determined in rule 2:
- If
python_env.type == "custom"or"module": check"$PYTHON_BIN_DIR/cocotb-config" --versionfirst; if that exits zero, record FOUND with the returned version string. Only if absent or non-zero, fall back tococotb-config --version(PATH-based). - If
python_env.type == "system": usecocotb-config --version(PATH-based) only. - Report MISSING if all attempted checks fail.
- If
- openlane: run
"$PYTHON_EXEC" -m pip show openlane 2>/dev/null; if exit code 0 andName: openlaneappears in output, record FOUND and extract theVersion:field; otherwise MISSING. - uv: if
python_env.type == "custom"or"module": check"$PYTHON_BIN_DIR/uv" --versionfirst; fall back touv --version(PATH). Ifpython_env.type == "system": useuv --versiononly.
- cocotb: detection depends on the Python interpreter type determined in rule 2:
For proprietary tools: check PATH using
which <primary-executable>only (see executable names in the Proprietary section above); never attempt install; record asPROPRIETARY_ONLYif found,MISSINGotherwiseRecord each tool as one of:
FOUND,MISSING, orPROPRIETARY_ONLYCapture exact version string for each
FOUNDtoolNever attempt installation in this stage
Write results to
tool-status.jsonbefore advancing
QoR Metrics to Evaluate
tools_detected: count of FOUND tools (target ≥ 10 for a functional open-source flow)tools_missing: count of MISSING open-source toolsproprietary_found: count of PROPRIETARY_ONLY tools detected in PATH
Output Required
tool-status.json— contains two top-level keys:python_env:{ "exec": "", "type": "module|system|custom", "bin_dir": "", "module_name": "" }— populated by rule 2tools: array of{ "tool": "", "command": "", "status": "FOUND|MISSING|PROPRIETARY_ONLY", "version": "", "path": "" }
Note: module-based availability (FOUND_PREFER_MODULE, MISSING_LOAD_MODULE) and the module_names/versions_available fields are added in the next stage (module_discovery).
Stage: module_discovery
Domain Rules
Module system detection (in order of preference)
- Classic Environment Modules (TCL) — check
$MODULESHOMEis set, ormodulecmdbinary exists in PATH - Neither — set
module_system: "none", emit WARN, skip remaining rules, write emptymodule-status.json, advance totool_installation
Module listing commands
- Classic:
module avail 2>&1— parse text; entries appear as<name>/<version> - If the listing command exits non-zero: emit WARN, record the error, proceed
Module-to-tool mapping table
| Tool command | Module name patterns to match (case-insensitive substring) |
|---|---|
vcs |
vcs, synopsys-vcs, synopsys/vcs |
xrun |
xcelium, cadence-xcelium, cadence/xcelium |
dc_shell |
design-compiler, synopsys/dc, dc_shell |
innovus |
innovus, cadence/innovus, cadence-innovus |
vsim |
questa, questasim, mentor/questa |
pt_shell |
primetime, synopsys/pt, pt_shell |
formality |
formality, synopsys/formality |
verilator |
verilator |
yosys |
yosys |
openroad |
openroad |
klayout |
klayout |
iverilog |
icarus, iverilog |
sta |
opensta |
gcc |
gcc |
llvm-config |
llvm |
xschem |
xschem |
gtkwave |
gtkwave |
uv |
uv |
python3 |
python, python3 |
slang |
slang |
surelog |
surelog |
sv2v |
sv2v |
sby |
symbiyosys, sby, yosyshq/sby |
bambu-hls |
bambu, bambu-hls, panda-bambu |
nextpnr |
nextpnr |
openFPGALoader |
openfpgaloader |
openocd |
openocd |
Rules
- Detect module system using the detection order above
- Run the appropriate listing command for the detected system
- For each entry in the listing, test against the mapping table (case-insensitive)
- For each matched tool, collect all available version strings
- Write
module-status.jsonbefore advancing - For each tool marked
FOUNDintool-status.jsonthat also has a module available: change status toFOUND_PREFER_MODULE, addmodule_namesandversions_availablefields, include inload-modules.sh— module takes precedence over PATH version - For each tool marked
MISSINGintool-status.jsonthat has modules available: change status toMISSING_LOAD_MODULE, addmodule_namesandversions_availablefields - Generate
load-modules.shfor allFOUND_PREFER_MODULEandMISSING_LOAD_MODULEtools; default to the latest version (highest semver/lexicographic); comment out alternative versions inline - Never auto-run
load-modules.sh— print: "Review and sourceload-modules.shto load EDA modules, then re-run the flow"
Extended tool-status.json schema
Fields added by this stage to each entry in the tools array (backward-compatible additions):
{
"tool": "",
"command": "",
"status": "FOUND | FOUND_PREFER_MODULE | MISSING | MISSING_LOAD_MODULE | PROPRIETARY_ONLY",
"version": "",
"path": "",
"module_names": [],
"versions_available": []
}
Note: The top-level python_env object is preserved unchanged during this stage — only entries in the tools array are modified. The python3 tool entry is treated like any other: if python_env.type == "module", its tools array status is upgraded from FOUND to FOUND_PREFER_MODULE and it is included in load-modules.sh.
QoR Metrics to Evaluate
module_system_detected: bool — true if classic Environment Modules (TCL) foundtools_found_via_modules: count of tools with statusMISSING_LOAD_MODULEorFOUND_PREFER_MODULE
Stage Output Summary
Print a human-readable table before advancing:
Module system : Environment Modules 4.8.0 (TCL)
Tools in PATH : 12
Tools via modules : 5
vcs — synopsys/vcs/2020.03, synopsys/vcs/2021.01
xrun — cadence/xcelium/20.09
dc_shell — synopsys/dc/2022.03
innovus — cadence/innovus/21.1
pt_shell — synopsys/primetime/2022.06
Output Required
module-status.json— module system details and per-tool module listings- Updated
tool-status.json— statuses and module fields added for matched tools load-modules.sh— generated when any tool has statusFOUND_PREFER_MODULEorMISSING_LOAD_MODULE; omitted whenmodule_systemis"none"
module-status.json schema:
{
"module_system": "tclmod | none",
"module_system_version": "",
"tools_via_modules": [
{
"tool": "<command>",
"module_names": ["synopsys/vcs/2020.03", "synopsys/vcs/2021.01"],
"versions_available": ["2020.03", "2021.01"]
}
]
}
load-modules.sh format:
#!/usr/bin/env bash
# Generated by module_discovery — source this file to load EDA tool modules
# Usage: source load-modules.sh
module load synopsys/vcs/2021.01 # latest; alternatives: 2020.03
module load cadence/xcelium/20.09
# module load cadence/innovus/21.1 # uncomment if needed
Stage: tool_installation
Domain Rules
- Never auto-run installs — only generate per-tool install scripts
- If
python3is missing: FAIL immediately and escalate — required for all wrapper scripts - Generate one
install-<toolname>.shfor every tool with statusMISSING; skip tools with statusFOUND,FOUND_PREFER_MODULE,MISSING_LOAD_MODULE, orPROPRIETARY_ONLY - Each script follows the Per-Tool Script Structure below
- Use the Package Name Mapping Table to emit correct install commands for the detected OS/PM
- Python package install scripts (
openlane,cocotb,uv): readpython_env.execfromtool-status.jsonand substitute it for<PYTHON_EXEC>(andpython_env.bin_dirfor<PYTHON_BIN_DIR>). At the top of each Python package install script, emit:
UsePYTHON_EXEC="<value of python_env.exec>" # Verify this is the intended interpreter before running"$PYTHON_EXEC" -m pip install <package>as the install command. Never use barepip installwhenpython_env.typeis"custom"or"module". - Proprietary tools: no script generated — record a note in the sign-off summary only
- Modulefile format: always TCL classic (no file extension); always generate modulefiles unconditionally — if
module_system == "none", emit WARN that automatic module loading is unavailable but still output the modulefile - Each script must end with guidance for registering
$EDA_MODULEFILES_ROOTin$MODULEPATHif not already present - Write all
install-<toolname>.shscripts to theinstall-missing-tools/directory; create the directory if it does not exist; do not create the directory or any scripts if no tools areMISSING
Common Issues & Fixes
| Issue | Fix |
|---|---|
python3 not found |
Escalate immediately — all wrapper scripts depend on it |
| OpenROAD build required | Refer to https://github.com/The-OpenROAD-Project/OpenROAD |
| Bambu HLS Linux only | Wrap with status: WARN on macOS/Windows |
Install Directory Layout
$EDA_TOOLS_ROOT/ (default: /tools)
<toolname>/<version>/ e.g. /tools/verilator/5.028/
bin/
lib/
share/
$EDA_MODULEFILES_ROOT/ (default: /tools/toolmgr/env/modulefiles)
<toolname>/<version> e.g. /tools/toolmgr/env/modulefiles/verilator/5.028
Both roots are read from env vars at script runtime with the defaults above.
Per-Tool Script Structure
Each install-<toolname>.sh — file: $EDA_MODULEFILES_ROOT/<toolname>/<version> (TCL, no extension):
#!/usr/bin/env bash
# install-<toolname>.sh — generated by infrastructure-orchestrator
# Installs <Tool Full Name> to $EDA_TOOLS_ROOT/<toolname>/<version>
# and generates a TCL modulefile at $EDA_MODULEFILES_ROOT/<toolname>/<version>
set -euo pipefail
TOOL_NAME="<toolname>"
TOOL_VERSION="<detected-or-latest>"
EDA_TOOLS_ROOT="${EDA_TOOLS_ROOT:-/tools}"
EDA_MODULEFILES_ROOT="${EDA_MODULEFILES_ROOT:-/tools/toolmgr/env/modulefiles}"
INSTALL_DIR="${EDA_TOOLS_ROOT}/${TOOL_NAME}/${TOOL_VERSION}"
# --- Install ---
# Build-from-source: pass --prefix="${INSTALL_DIR}" to configure/cmake
# Package manager: use apt-get/brew/pacman (see mapping table below)
# --- Generate TCL modulefile ---
MODFILE_DIR="${EDA_MODULEFILES_ROOT}/${TOOL_NAME}"
mkdir -p "${MODFILE_DIR}"
cat > "${MODFILE_DIR}/${TOOL_VERSION}" <<EOF
#%Module1.0
proc ModulesHelp { } {
puts stderr "<Tool Full Name> ${TOOL_VERSION}"
}
module-whatis "<Tool Full Name> ${TOOL_VERSION} — <one-line description>"
set prefix ${INSTALL_DIR}
prepend-path PATH \$prefix/bin
prepend-path LD_LIBRARY_PATH \$prefix/lib
prepend-path MANPATH \$prefix/share/man
# add PYTHONPATH, PKG_CONFIG_PATH, or tool-specific setenv as needed
EOF
echo "Modulefile written: ${MODFILE_DIR}/${TOOL_VERSION}"
# --- Register modulefiles root (if not already set) ---
# export MODULEPATH=${EDA_MODULEFILES_ROOT}:${MODULEPATH}
# Add the above line to ~/.bashrc or /etc/profile.d/eda-modules.sh
If module_system == "none": emit WARN in stage output that automatic module loading is unavailable, but still generate the modulefile block in the install script.
Modulefile content rules:
- Minimum env vars in every modulefile:
PATH,LD_LIBRARY_PATH - Add where applicable:
MANPATH,PKG_CONFIG_PATH,PYTHONPATH - Tool-specific root vars (set these when present):
- Verilator →
VERILATOR_ROOT - Yosys →
YOSYS_DATDIR - LLVM →
LLVM_DIR - cocotb →
COCOTB_SHARE_DIR
- Verilator →
Package Name Mapping Table
| Tool command | apt package(s) | brew formula | pacman pkg | fallback / notes |
|---|---|---|---|---|
verilator |
verilator |
verilator |
verilator |
— |
slang |
build-from-source | — | — | https://github.com/MikePopoloski/slang |
surelog |
build-from-source | — | — | https://github.com/chipsalliance/Surelog |
sv2v |
build-from-source | — | — | https://github.com/zachjs/sv2v |
iverilog |
iverilog |
icarus-verilog |
iverilog |
— |
yosys |
yosys |
yosys |
yosys |
— |
abc |
build-from-source | berkeley-abc |
— | https://github.com/berkeley-abc/abc |
openroad |
build-from-source | — | — | https://github.com/The-OpenROAD-Project/OpenROAD |
openlane |
<PYTHON_EXEC> -m pip install openlane |
<PYTHON_EXEC> -m pip install openlane |
<PYTHON_EXEC> -m pip install openlane |
Python package; substitute <PYTHON_EXEC> with python_env.exec from tool-status.json |
klayout |
klayout |
klayout |
klayout (AUR) |
— |
sta |
build-from-source | — | — | https://github.com/The-OpenROAD-Project/OpenSTA |
sby |
symbiyosys |
— | — | https://github.com/YosysHQ/sby |
gem5 |
build-from-source | — | — | https://github.com/gem5/gem5 |
bambu-hls |
vendor download (Linux only) | — | — | https://github.com/ferrandi/PandA-bambu; WARN on macOS/Windows |
nextpnr |
nextpnr-ice40 nextpnr-ecp5 |
nextpnr |
nextpnr |
— |
openFPGALoader |
openfpgaloader |
— | — | https://github.com/trabucayre/openFPGALoader |
cocotb |
<PYTHON_EXEC> -m pip install cocotb |
<PYTHON_EXEC> -m pip install cocotb |
<PYTHON_EXEC> -m pip install cocotb |
Python package; use <PYTHON_BIN_DIR>/cocotb-config or cocotb-config to detect |
llvm-config |
llvm-dev |
llvm |
llvm |
— |
gcc |
build-essential |
gcc |
gcc |
— |
openocd |
openocd |
open-ocd |
openocd |
— |
xschem |
xschem |
build-from-source | — | https://github.com/StefanSchippers/xschem |
gtkwave |
gtkwave |
gtkwave |
gtkwave |
— |
uv |
curl -LsSf https://astral.sh/uv/install.sh | sh (standalone) or <PYTHON_EXEC> -m pip install uv |
uv (brew) or <PYTHON_EXEC> -m pip install uv |
<PYTHON_EXEC> -m pip install uv |
Prefer standalone astral.sh installer; pip fallback when custom/module Python is active |
Output Required
- One
install-<toolname>.shper MISSING tool written toinstall-missing-tools/(no single combined script)
Stage: wrapper_deployment
Domain Rules
- Deploy all 8 wrapper scripts to
plugins/infrastructure/tools/ - Run
chmod +xon every wrapper; if permission denied: FAIL and escalate withsudo chmod +xinstructions - Every wrapper must emit JSON conforming to the schema below regardless of exit code
- Test each wrapper with
--versionor--helpafter deploy; tolerate MISSING tools (wrappers must handle tool-not-found gracefully withstatus: "FAIL") - Never suppress the tool's original exit code
Wrapper JSON Output Schema
Every wrapper script must print exactly this JSON structure to stdout:
{
"tool": "<tool-name>",
"exit_code": 0,
"status": "PASS|FAIL|WARN",
"summary": {},
"errors": [],
"warnings": [],
"raw_log": "/tmp/<tool>-XXXXXX.log"
}
Fields:
status:PASSif exit_code == 0 and no errors;FAILif exit_code != 0 or tool not found;WARNif exit_code == 0 with warningssummary: tool-specific metrics (cells, timing, coverage, etc.)raw_log: absolute path to temp file containing full unfiltered output
QoR Metrics to Evaluate
wrappers_deployed: count of wrapper scripts with executable bit set (target: 8)
Output Required
- 8 executable wrapper scripts in
plugins/infrastructure/tools/
Stage: mcp_configuration
Domain Rules
- Emit MCP config snippets for all 10 MCP configs (8 batch + 2 session)
- All batch configs use
"command": "python3"withmcp-adapter.py— never point directly to the wrapper script as the command; wrapper scripts are not MCP servers - Session configs use
mcp-session-adapter.pywith--tool openroador--tool opensta - Resolve the absolute adapter and wrapper paths at runtime using
realpathorpwd— never leave the placeholder/absolute/path/to/in the emitted snippets - Print each snippet with explicit instruction:
"Paste the
mcpServersblock into your.claude/settings.json" - Write the snippet files to
plugins/infrastructure/mcp/ - Do not modify
.claude/settings.jsonautomatically — user must do this manually
MCP Config Template
{
"mcpServers": {
"<tool>": {
"type": "stdio",
"command": "/absolute/path/to/plugins/infrastructure/tools/wrap-<tool>.sh",
"args": []
}
}
}
QoR Metrics to Evaluate
mcp_servers_configured: count of MCP snippet files written (target: 10)
Output Required
Batch MCP configs (Tier 1):
plugins/infrastructure/mcp/mcp-yosys.jsonplugins/infrastructure/mcp/mcp-openroad.jsonplugins/infrastructure/mcp/mcp-opensta.jsonplugins/infrastructure/mcp/mcp-klayout.jsonplugins/infrastructure/mcp/mcp-verilator.jsonplugins/infrastructure/mcp/mcp-bambu.jsonplugins/infrastructure/mcp/mcp-gem5.jsonplugins/infrastructure/mcp/mcp-symbiflow.json
Session MCP configs (Tier 2):
plugins/infrastructure/mcp/mcp-openroad-session.jsonplugins/infrastructure/mcp/mcp-opensta-session.json
Adapter scripts (required — MCP servers will not start without these):
plugins/infrastructure/tools/mcp-adapter.pyplugins/infrastructure/tools/mcp-session-adapter.py
Printed MCP config snippets for each tool with resolved absolute paths
Stage: environment_validation
Domain Rules
- Python environment check — before any other check: read
python_envfromtool-status.json:- If
python_env.type == "module": runwhich python3to verify the module is still loaded. If it fails, FAIL immediately with:"Python environment not active — source load-modules.sh (module: <python_env.module_name>) and re-run environment_validation." - If
python_env.type == "custom"or"system": runwhich python3and verify the path matchespython_env.exec; emit WARN if it differs.
- If
- Re-run tool presence checks using the same Python-aware detection as
tool_discoveryrules 2–3: use"$PYTHON_EXEC" -m pip showforopenlane,"$PYTHON_BIN_DIR/cocotb-config"forcocotb,"$PYTHON_BIN_DIR/uv"foruv— do not fall back to barewhichfor Python packages. Compare results againsttool-manifest.json. - Verify all 8 wrapper scripts exist and have executable bit set
- Verify MCP snippet files are present in
plugins/infrastructure/mcp/(all 10 snippets) and thatmcp-adapter.py+mcp-session-adapter.pyare present inplugins/infrastructure/tools/ - FAIL if any critical-path tool (Yosys, Verilator, OpenROAD, OpenSTA) is still
MISSING - For each tool with status
MISSING_LOAD_MODULEintool-status.json: emit a WARN issue with description"<tool> not in PATH — available via module"and fix"source load-modules.sh, then re-run environment_validation" - If any critical-path tool (Yosys, Verilator, OpenROAD, OpenSTA) has status
MISSING_LOAD_MODULE: emit WARN and setsuggested_next_step: "escalate"with message"Critical tool <tool> requires module load before downstream flows can run. Source load-modules.sh and re-run environment_validation." - Print final sign-off summary: tools detected, tools via modules, wrappers deployed, MCP servers configured
Sign-off Checklist
-
tool-status.jsonwritten with all tools surveyed (includespython_envobject) -
module-status.jsonwritten (even ifmodule_systemis"none") -
install-<toolname>.shscripts generated for all MISSING tools ininstall-missing-tools/(auto-run is user's choice) -
load-modules.shgenerated if any module-available tools found (auto-run is user's choice) -
tool-manifest.jsonwritten - All 8 wrappers deployed and executable
-
mcp-adapter.pyandmcp-session-adapter.pypresent inplugins/infrastructure/tools/ - All 10 MCP config snippets written with resolved absolute paths and printed
- No critical-path tools with status
MISSINGorMISSING_LOAD_MODULE
Output Required
- Printed environment validation report
- Updated
tool-manifest.jsonwith final confirmed state