小脚丫Lattice FPGA自动下载脚本
这是一个名为 "flash.bat" 的批处理脚本,由ChanRa1n编写,用于将指定文件夹('impl1'子文件夹)中的所有JED文件复制到名为 "STEPLink" 的磁盘中。以下是该脚本的详细介绍:
@echo off
echo ------------------------------------------------------------------------
echo Script Name: flash.bat
echo Description: This batch script copies all JED files from the 'impl1'
echo subfolder to the 'STEPLink' disk.
echo Author: ChanRa1n
echo Website: https://www.myfpga.cn
echo Version: 1.0
echo ------------------------------------------------------------------------
setlocal enabledelayedexpansion
REM Get the current script directory
set "scriptDir=%~dp0"
REM Set the source folder path
set "sourceFolder=%scriptDir%impl1"
REM Check the drive letter of the STEPLink disk
for /f "tokens=2 delims==" %%d in ('wmic logicaldisk where "volumename='STEPLink'" get caption /format:value ^| find "="') do (
set "destDrive=%%d"
)
REM Check if the STEPLink disk exists
if not defined destDrive (
echo STEPLink disk does not exist or cannot be accessed.
pause
exit /b
)
REM Set the destination folder path
set "destFolder=!destDrive!\"
REM Check if the source folder exists
if not exist "%sourceFolder%\" (
echo Source folder does not exist.
pause
exit /b
)
REM Create the destination folder
if not exist "%destFolder%" mkdir "%destFolder%"
REM Copy all JED files to the destination folder
copy "%sourceFolder%\*.jed" "%destFolder%"
echo Operation completed.
pause
exit /b使用时将该bat文件放置于相关工程根目录下,双击运行即可实现自动程序烧录。



