-
Notifications
You must be signed in to change notification settings - Fork 14
/
test_libv.bat
40 lines (37 loc) · 1.06 KB
/
test_libv.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@ECHO OFF
setlocal
::Check GHDL version
set TESTEDVER=26
for /f "tokens=2" %%g in ('ghdl -v ^| findstr /i "edition"') do (
set GHDLVER=%%g
)
set GHDLVER=%GHDLVER:"=%
for /f "delims=. tokens=1-2" %%v in ("%GHDLVER%") do (
set MAJORVER=%%v
set MINORVER=%%w
)
set MAJORVER=%MAJORVER:"=%
set MINORVER=%MINORVER:"=%
::Warn the user if they are using a GHDL version beyond 0.%TESTEDVER%, check if they wish to continue
if %MINORVER% GTR %TESTEDVER% (
@echo WARNING: CURRENT VERSION OF GHDL IS %MAJORVER%.%MINORVER% - test_libv.bat has only been tested using GHDL 0.25 due to known issues with simulations in later versions of GHDL for Windows
choice /M "Do you wish to continue" /c YN
if errorlevel 255 (
echo Error
) else if errorlevel 2 (
goto :no
) else if errorlevel 1 (
goto :yes
) else if errorlevel 0 (
echo Ctrl+C pressed.
)
)
::Run the original test_libv script commands
:yes
ghdl -a libv.vhd
ghdl -e tb_libv
ghdl -r tb_libv --assert-level=error
ECHO ------------------------------------------
ECHO If you see can read this, things worked OK!
:no
endlocal