vivado: resolve install path from ~/skills_env.md instead of hardcoding D:\Xilinx

The Vivado install root differs per machine (C:\Xilinx here, D:\Xilinx on the
box these skills were written on), so every hardcoded path was already wrong
on this machine.

- new fpga_flash/scripts/vivado_env.py: resolves --vivado-dir > env var >
  VIVADO_ROOT (falling back to VIVADO_PATH) from ~/skills_env.md
- gen_mcs / program_flash / check_flash_csv: --vivado-dir now optional
- fpga_update/gen_update_mcs.py: same precedence for --vivado
- fpga_flash / smod_atsc_dev / vivado-prj-create SKILL.md: document the
  lookup instead of naming a drive letter
- skills_env template: VIVADO_ROOT/VIVADO_PATH are now blanks to fill in,
  so a new machine can't inherit a wrong default

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Myfro9
2026-07-20 07:48:04 -05:00
co-authored by Claude Opus 4.8
parent fbfa060b67
commit 88f96fa5fa
9 changed files with 138 additions and 32 deletions
+13 -8
View File
@@ -28,23 +28,28 @@ This skill helps you generate TCL scripts for automatically creating Xilinx Viva
## IMPORTANT: Vivado Installation Check (Step 0 - REQUIRED)
**Before asking any questions, you MUST first check if Vivado is installed at the default location.**
**Before asking any questions, you MUST first resolve and verify the Vivado install path.**
Use the Bash tool to check if the default Vivado installation path exists:
The install path is machine-local and is **never hardcoded in this skill**. Read
`VIVADO_ROOT` from `~/skills_env.md` (an env var of the same name overrides it),
then verify it:
```bash
test -d "d:/Xilinx/Vivado/2018.1/bin" && echo "EXISTS" || echo "NOT_FOUND"
VIVADO_ROOT=$(sed -n 's/^[[:space:]]*VIVADO_ROOT[[:space:]]*=[[:space:]]*//p' ~/skills_env.md | head -1)
test -d "$VIVADO_ROOT/bin" && echo "EXISTS: $VIVADO_ROOT" || echo "NOT_FOUND"
```
- If the result is `EXISTS`: Proceed to Step 1 (interactive questions)
- If the result is `EXISTS`: use that value as `{{VIVADO_PATH}}`, proceed to Step 1
- If the result is `NOT_FOUND`: **Stop and report error to the user:**
```
错误 / Error: Vivado 没有正确安装!
错误 / Error: 找不到 Vivado 安装!
请确认 Vivado 已安装在默认路径: d:\Xilinx\Vivado\2018.1\bin\
请在 ~/skills_env.md 中把 VIVADO_ROOT 设为实际的 Vivado 安装根目录
(该目录下应有 bin\vivado.bat)。
Please ensure Vivado is installed at: d:\Xilinx\Vivado\2018.1\bin\
Please set VIVADO_ROOT in ~/skills_env.md to your actual Vivado install root
(the directory containing bin\vivado.bat).
```
## IMPORTANT: Interactive Question Requirements
@@ -549,7 +554,7 @@ Replace the template variables with user-provided values:
| Variable | Description |
|----------|-------------|
| `{{VIVADO_PATH}}` | Vivado installation path (always: `D:/Xilinx/Vivado/2018.1`) |
| `{{VIVADO_PATH}}` | Vivado installation path — resolved in Step 0 from `VIVADO_ROOT` in `~/skills_env.md`; never hardcode a drive letter |
| `{{PROJECT_NAME}}` | Project name |
| `{{DEVICE_PART}}` | FPGA part number |
| `{{TIMESTAMP}}` | Current date/time |