forked from gatsby/embedded-autobuild
feat(platform/xilinx): add a command interface to acquire tool installation path
This commit is contained in:
@@ -14,11 +14,18 @@ set "xilinx_version=%1"
|
|||||||
set "version_pattern=20[12][01234789][.][12]"
|
set "version_pattern=20[12][01234789][.][12]"
|
||||||
echo %xilinx_version% | findstr /r /c:"%version_pattern%" >nul
|
echo %xilinx_version% | findstr /r /c:"%version_pattern%" >nul
|
||||||
if %errorlevel% NEQ 0 (
|
if %errorlevel% NEQ 0 (
|
||||||
echo Error: %xilinx_version% is not a valid version coede ^(e.g., 2019.1^)
|
echo Error: %xilinx_version% is not a valid version code ^(e.g., 2019.1^)
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
REM Convert it to a integer
|
REM Prompt user for Xilinx installation path, default to C:\Xilinx if not provided
|
||||||
|
set "default_path=C:\Xilinx"
|
||||||
|
set /p "xilinx_path=Enter Xilinx installation path (press Enter for default: %default_path%): "
|
||||||
|
if "%xilinx_path%"=="" (
|
||||||
|
set "xilinx_path=%default_path%"
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Convert version to integer
|
||||||
for /f "tokens=1,2 delims=." %%a in ("%xilinx_version%") do (
|
for /f "tokens=1,2 delims=." %%a in ("%xilinx_version%") do (
|
||||||
set major=%%a
|
set major=%%a
|
||||||
set minor=%%b
|
set minor=%%b
|
||||||
@@ -26,13 +33,13 @@ for /f "tokens=1,2 delims=." %%a in ("%xilinx_version%") do (
|
|||||||
set /a version_number=%major%%minor%
|
set /a version_number=%major%%minor%
|
||||||
set /a lowest_vitis_version=20192
|
set /a lowest_vitis_version=20192
|
||||||
|
|
||||||
REM Determine the correct settings.bat path based on the Xilinx version
|
REM Determine the correct settings.bat path based on the Xilinx version and user path
|
||||||
if %version_number% lss %lowest_vitis_version% (
|
if %version_number% lss %lowest_vitis_version% (
|
||||||
echo Setup enviroment for Xilinx SDK.
|
echo Setting up environment for Xilinx SDK.
|
||||||
set settings_bat=C:\Xilinx\SDK\%xilinx_version%\settings64.bat
|
set settings_bat=%xilinx_path%\SDK\%xilinx_version%\settings64.bat
|
||||||
) else (
|
) else (
|
||||||
echo Setup enviroment for Xilinx Vitis.
|
echo Setting up environment for Xilinx Vitis.
|
||||||
set settings_bat=C:\Xilinx\Vitis\%xilinx_version%\settings64.bat
|
set settings_bat=%xilinx_path%\Vitis\%xilinx_version%\settings64.bat
|
||||||
)
|
)
|
||||||
|
|
||||||
REM Check if the settings.bat file exists
|
REM Check if the settings.bat file exists
|
||||||
|
|||||||
Reference in New Issue
Block a user