From 549a9024246274abae6a117500a055a44bd11929 Mon Sep 17 00:00:00 2001 From: Iwbnwif Yiw Date: Fri, 9 Feb 2024 21:09:04 +0000 Subject: [PATCH 1/2] Update qucs_run_hdl.bat to use GHDL on Windows --- qucs/qucs_run_hdl.bat | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/qucs/qucs_run_hdl.bat b/qucs/qucs_run_hdl.bat index 232bc08ac..845c2df10 100644 --- a/qucs/qucs_run_hdl.bat +++ b/qucs/qucs_run_hdl.bat @@ -28,8 +28,6 @@ set NAMEOUT=%2 set TIME=%~3 set DIR=%4 set BINDIR=%5 -set VLIBS=%6 -set OPTION=%7 if not exist "%DIR%" goto nodir @@ -40,35 +38,22 @@ if not exist %NAME% goto nofile copy %NAME% digi.vhdl > NUL set NAME=digi -set CXX=g++ -set CXXFLAGS=-O2 -I"%FREEHDL%/include" -set LDFLAGS=-L"%FREEHDL%/lib" -L"%FREEHDL%/lib/freehdl" -Wl,--enable-auto-import -s -set LIBS=-lfreehdl-kernel -lfreehdl-std -lieee -lregex +echo running GHDL analysis pass... +ghdl -a %NAME%.vhdl -set PATH=%PATH%;%FREEHDL%/bin - -echo running C++ conversion... -freehdl-v2cc -m %NAME%._main_.cc -L"%FREEHDL%/share/freehdl/lib" -Lvhdl -o %NAME%.cc %NAME%.vhdl - -echo compiling functions... -%CXX% %CXXFLAGS% -c %NAME%.cc - -echo compiling main... -%CXX% %CXXFLAGS% -c %NAME%._main_.cc - -echo linking... -%CXX% %NAME%._main_.o %NAME%.o %LDFLAGS% -Lvhdl %VLIBS% %LIBS% -static-libstdc++ -o %NAME%.exe +echo running GHDL elaboration pass... +ghdl -e TestBench echo simulating... -%NAME%.exe -q -cmd "dc -f %NAME%.vcd -t 1 ps -q;d;run %TIME%;q;" < NUL +ghdl -r TestBench --vcd=digi.vcd --stop-time=%TIME% echo running VCD conversion... -vcd2qucsdat %OPTION% -if vcd -of qucsdata -i %NAME%.vcd -o %NAMEOUT% +%BINDIR%\vcd2qucsdat %OPTION% -if vcd -of qucsdata -i %NAME%.vcd -o %NAMEOUT% goto end :usage -echo Usage: %0 "