Initial gwin-skill: Gowin ACG525 full toolchain skill for agents.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Administrator
2026-09-14 20:18:41 +08:00
co-authored by Cursor
commit 1b1a68ae28
16 changed files with 765 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
param(
[Parameter(Mandatory = $true)]
[string]$ProjectDir,
[string]$FsFile = "",
[ValidateSet(2, 4, 5, 6)]
[int]$Operation = 2,
[string]$GowinRoot = ""
)
$ErrorActionPreference = "Stop"
if (-not $GowinRoot) {
$GowinRoot = "C:\Users\Administrator\Documents\fpga\tool-chain\Gowin\Gowin_V1.9.11.03_Education_x64"
}
$ProjectDir = (Resolve-Path $ProjectDir).Path
$cli = Join-Path $GowinRoot "Programmer\bin\programmer_cli.exe"
if (-not (Test-Path $cli)) { throw "programmer_cli.exe not found: $cli" }
$env:PATH = "$(Join-Path $GowinRoot 'Programmer\bin');$env:PATH"
Write-Host "Scanning cables..."
& $cli --scan
if ($LASTEXITCODE -ne 0) { throw "scan failed; check USB cable and board power" }
if (-not $FsFile) {
$fs = Get-ChildItem (Join-Path $ProjectDir "impl\pnr\*.fs") |
Sort-Object LastWriteTime -Descending | Select-Object -First 1
if (-not $fs) { throw "No .fs found; build first" }
$FsFile = $fs.FullName
} else {
$FsFile = (Resolve-Path $FsFile).Path
}
Write-Host "Programming GW5A-25A op=$Operation file=$FsFile"
& $cli -d GW5A-25A --fsFile $FsFile -r $Operation
if ($LASTEXITCODE -ne 0) { throw "program failed" }
Write-Host "Download finished."