| name | frontend-eda-env-setup |
| description | Detect available EDA tools on the current system and generate a working Makefile for front-end RTL compilation, simulation, and lint. Use when the user needs to set up or switch the build environment before compiling or simulating. |
| license | PolyForm-Noncommercial-1.0.0 |
| metadata | {"author":"中科麒芯","organization":"中科麒芯智能技术(南京)有限公司","homepage":"https://www.ickylin.com/","contact":"info@ickylin.com"} |
Frontend EDA Env Setup
Use this skill to turn the integration plan into an actual build environment with a working Makefile.
Boundaries
- Do not execute compile or simulation commands -that is
frontend-compile-sim-run's job.
- Do not modify RTL or testbench source files.
- Do not generate filelist content -that comes from
frontend-integration-and-bringup.
- Never modify
.cshrc, .bashrc, or module files. Never install EDA tools.
- Always backup before overwriting. Never delete backup directories.
This skill is also valid as a standalone setup skill whenever the user already has RTL source files and needs a Makefile to compile and simulate.
Good Outcome
Produce a working build environment that includes:
- detected EDA tool inventory with paths and versions
- selected simulator, lint tool, and waveform viewer
- a generated Makefile with compile, sim, sim_wave, wave, lint, and clean targets
- backup of previous Makefile if one existed and the simulator changed
Input Artifacts
| Artifact | Source | Required |
|---|
stage7_integration_plan.json | <docs.dir>/ | No (pipeline mode; standalone: use existing flist and RTL directly) |
input_config.json | Project root | Yes (for sim.dir, sim.simulator). Auto-generated by Stage 1 if absent; if still missing, generate from template with defaults inferred from upstream artifacts |
flist | <sim.dir>/ | Yes |
Output Artifacts
| Artifact | Path | Description |
|---|
eda_detection.json | <docs.dir>/ | Raw EDA tool detection result from detect_eda_env.py --output |
stage8_eda_env.json | <docs.dir>/ | Detected tools, selected tool set, waveform config, Makefile generation status. Schema: output_schema.json |
Makefile | <sim.dir>/ | Generated Makefile with compile/sim/clean targets |
Stage Entry Criteria
Use this stage when at least one of the following is true:
- integration plan or filelist already exists
- RTL source files are available and need a build environment
- the user wants to switch to a different simulator
- the existing Makefile is stale or missing
Workflow
-
Standalone entry check: If input_config.json is absent, prompt the user for:
- Simulation working directory (default:
sim/)
- Preferred simulator (
auto, vcs, xcelium, or questa; default: auto)
Present the inferred config to the user for confirmation before writing. Write input_config.json after user confirms.
-
Detect available EDA tools dynamically.
The detection script reads the tool registry (references/simulators/tools_registry.json),
runs PATH check and version query for each tool, and scans module avail for additional modules.
python3 scripts/detect_eda_env.py --output <docs.dir>/eda_detection.json
For each tool in the registry, the script executes:
which <binary> to check PATH availability
- Tool-specific version command (e.g.,
vcs -full64 -ID, xrun -version, spyglass -version)
module avail scan for supplementary discovery
The output JSON contains: detected tools with paths and versions, execution log with every
command invoked, and module avail scan results. The execution log provides an audit trail
showing exactly which EDA tool commands were called.
To add new tools: edit references/simulators/tools_registry.json -no code change needed.
To run with full smoke tests: add --smoke flag.
-
Select tools for each role based on availability and input_config.json ->sim.simulator:
- If
auto: detect and select per tool-selection-rules.md
- If a specific tool: use it if available, fallback if not
- Roles: simulator (VCS/Xcelium), lint (SpyGlass), waveform (Verdi/DVE)
-
Check existing sim/Makefile:
sim/Makefile exists?
Yes -> read header "# Simulator: <name>"
Same tool -> skip regeneration, report done
Different -> backup sim/ -> clean -> proceed to step 4
No -> proceed to step 4
-
Read the simulator template from references/simulators/<tool>.md for command fields.
-
Generate sim/Makefile using assets/makefile_skeleton.mk as base:
- replace placeholders with values from the simulator template
- write header comment with tool name, template path, and timestamp
- reference
-f flist for file list, do not inline source files
-
Verify:
sim/Makefile exists with correct header
sim/flist exists or warn that it is missing
- selected tool is callable from current shell
Bundled References
Simulator and tool templates:
Use the bundled script for structured detection:
Completion Gate
This stage is complete when:
- available EDA tools are identified with paths and versions
- a simulator is selected
sim/Makefile exists with correct targets and header
- previous Makefile is backed up if the simulator changed
- missing dependencies (flist, source files) are reported as warnings
Reusable Outputs
- EDA tool inventory (tool, path, version, role)
- selected tool set
sim/Makefile
- backup directory path (if backup occurred)
Decision Rules
- If both VCS and Xcelium are available and the user has no preference, prefer VCS.
- If only Questa is available, use Questa. Questa uses a two-step compile flow (vlog + vopt); see
references/simulators/questa.md.
- If a tool is not in PATH, scan
module avail for matching modules and report them. Prompt the user to run module load <module> manually if a match is found. Do not execute module load automatically.
- Never modify
.cshrc, .bashrc, or module files.
- Never install EDA tools. Only detect existing environment.
- Platform prerequisite: Detection relies on Linux utilities (
which, module avail, bash). On non-Linux systems, only PATH-based detection is available.
- If
sim/Makefile exists and the simulator has not changed, skip regeneration entirely.
- Always backup before overwriting. Never delete backup directories.
- Makefile always uses
-f flist reference, not inlined file list. If flist changes later, Makefile does not need regeneration.
Suggested Response Structure
Detected tools
Selected tool set
Makefile generation status
Backup status
Warnings or missing dependencies
Recommended next step