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)
// MCP: Agent invokes external tool via Bridge
{
"method": "tools/call",
"params": {
"name": "bridge.execute",
"arguments": {
"tool": "magic",
"command": ["drc", "check", "-design", "top"],
"sandbox": {
"memory_gb": 8,
"cpu_cores": 4,
"timeout_sec": 3600
},
"license": {
"feature": "DRC_Engine",
"priority": "normal",
"timeout_sec": 7200
},
"callback": "agent.on_tool_complete"
}
}
}
# Tcl: external tool bridge
ieda::bridge register -name magic -bin /usr/local/bin/magic
ieda::bridge version magic
# magic 8.3.463 (capabilities: drc extract lvs)
ieda::bridge call magic -args {drc check -design top} -mem 8G -timeout 3600
# result: success, 12 DRC violations, 45.3s
ieda::bridge license acquire -tool genus -feature Innovus_Impl_System
# lease-42 acquired, expires 2025-07-30T14:00:00
Input / output contract
| Direction | Field | Type | Description |
|---|---|---|---|
| Input | tool | str | Registered external tool name |
| Input | args | list[str] | Tool CLI arguments |
| Input | sandbox | SandboxConfig | Resource limits and isolation config |
| Input | input_files | dict[str, bytes] | Input file map for the tool |
| Input | license_feature | str | Required license feature name |
| Output | result | ToolResult | Structured tool execution result |
| Output | output_files | dict[str, bytes] | Output files produced by the tool |
| Output | sandbox_stats | dict | Sandbox resource usage statistics |