Skip to content

External Tool Bridge · Secure external tool integration

Independent process sandboxes, protocol result parsing, version detection, and license management per commercial/open-source external tool. Lets Agents safely invoke non-iEDA-native tools.

Agent Service · D0/DRAFT · Wave 0 Planned · D0 iEDA.ai L4
bridge — sandbox — protocol
# sandboxed external tool invocation
$ bridge.call("magic", args=["drc", "check"])
[sandbox] process isolated, mem=4G
[parse]  DRC violations → structured
→ agent never touches raw tool I/O
iMapsynthesisiFPfloorplaniPDNpoweriPLplacementiCTSclockiTOoptimizationiRTroutingiSTAtimingAiEDAdesign dataiPCLlayout modeliMapsynthesisiFPfloorplaniPDNpoweriPLplacementiCTSclockiTOoptimizationiRTroutingiSTAtimingAiEDAdesign dataiPCLlayout model

Core capabilities

1. Process Sandbox

Each external tool runs in an isolated sandbox with resource limits (CPU cores, memory, disk I/O, runtime). Sandboxes are fully isolated—one crash does not affect others or the iEDA main process. Supports containerized (Docker/Podman) and native cgroups modes.

2. Protocol Adapter

Standardize external tool I/O. Each adapter defines input_schema and output_schema. Adapters convert iDB data to external tool formats and parse outputs back to iEDA representation.

3. Version Detection

Auto-detect external tool version and capabilities. Parse --version at startup. Maintain capability registry: feature introduction and parameter deprecation by version. Pre-call version compatibility checks.

4. License Management

License pooling, lease, and preemption for commercial tools. Agents acquire timed license leases before invocation. Priority queue allows high-priority preemption with safe exit. Continuous license monitoring and audit logging.

5. Result Parsing

Structured parsing of external tool reports and logs into unified ToolResult: status, violations, metrics, raw_log.

Agent calling patterns

from ieda.agent import ExternalToolBridge, SandboxConfig

bridge = ExternalToolBridge()

# Register external tool adapter
bridge.register(
    name="magic",
    binary="/usr/local/bin/magic",
    adapter="magic_adapter_v2",
    sandbox=SandboxConfig(
        cpu_cores=4, memory_gb=8, timeout_sec=3600,
        isolation="docker"
    )
)

# Version detection
version = bridge.detect_version("magic")
# version: {major: 8, minor: 3, patch: 463, capabilities: [...]}

# Acquire license (commercial tools)
lease = bridge.acquire_license(
    tool="genus", feature="Innovus_Impl_System", timeout_sec=7200
)
# lease: {id: "lease-42", expires: "2025-07-30T14:00:00", priority: "normal"}

# Invoke external tool safely
result = bridge.call(
    tool="magic",
    args=["drc", "check", "-design", "top"],
    input_files={"/in/top.def": def_bytes},
    sandbox=SandboxConfig(memory_gb=4)
)
# result: ToolResult {
#   status: "success",
#   violations: [{type: "min_width", layer: "m2", location: ...}],
#   metrics: {total_drc: 12, elapsed_sec: 45.3}
# }

# Release license
bridge.release_license(lease.id)

Input / output contract

DirectionFieldTypeDescription
InputtoolstrRegistered external tool name
Inputargslist[str]Tool CLI arguments
InputsandboxSandboxConfigResource limits and isolation config
Inputinput_filesdict[str, bytes]Input file map for the tool
Inputlicense_featurestrRequired license feature name
OutputresultToolResultStructured tool execution result
Outputoutput_filesdict[str, bytes]Output files produced by the tool
Outputsandbox_statsdictSandbox resource usage statistics