@echo offrem Batch generates bitfile for Logic Analyser Demoremrem Parameters:remrem 18x1024|9x2048 ... select analyser size (width and depth)remrem Do not modify srouce files directory structureremrem Tested with Xilinx ISE WebPack 14.5 with ChipScope Licenseremrem ----- first parameterset product=%1%if "%product%"=="18x1024" (echo 18x1024) else if "%product%" == "9x2048" (echo 9x2048) else (echo Missing parameter %product%echo usage: %0% 18x1024^|9x2048pauseexit 1)echo.echo Product: %product%echo.rem ----- Set core (top VHDL entity) nameset core=S3AN01_ChipScoperem ----- Set FPGA partset fpgaPart=xc3s50an-tqg144-4rem ----- Find and Set Xilinx Toolscall FindXilinxTools.cmdrem ----- Set WORK dirif exist WORK_%core%_%product% rmdir /S /Q WORK_%core%_%product%mkdir WORK_%core%_%product%cd WORK_%core%_%product%rem ----- Set TEMP dir (relative to WORK dir)mkdir TMPset TMP=TMPrem ----- INPUT UCF and VHDL files (linux format c:/.../... )set srcPath=../..set ucfFile=VHDL/S3AN01_ChipScope.ucfecho vhdl work "%srcPath%/COREGEN/ChipScope_ICON.vhd" > srcFiles.prjecho vhdl work "%srcPath%/COREGEN/ChipScope_VIO_FreqSel.vhd" >>srcFiles.prjecho vhdl work "%srcPath%/COREGEN/ChipScope_ILA_9_2048.vhd" >>srcFiles.prjecho vhdl work "%srcPath%/VHDL/S3AN01_ChipScope.vhd" >>srcFiles.prjrem ----- SET XST settingecho set -xsthdpdir "xst" > setXst.xstecho run >>setXst.xstecho -ifn "srcFiles.prj" >>setXst.xstecho -ofn %core% >>setXst.xstecho -ofmt NGC >>setXst.xstecho -top %core% >>setXst.xstecho -iob True >>setXst.xstecho -p %fpgaPart% >>setXst.xstif "%product%"=="18x1024" (echo -generics { ILA_WIDE=TRUE } >>setXst.xst) else (echo -generics { ILA_WIDE=FALSE } >>setXst.xst)rem ----- SET BITGEN settingecho -w > setBitGen.utecho -g ConfigRate:25 >>setBitGen.utecho -g UnusedPin:PullUp >>setBitGen.utecho -g DriveDone:Yes >>setBitGen.utcall xst -ifn "setXst.xst" -ofn "%core%.log"if %errorlevel% NEQ 0 (echo.echo.echo ERROR in xstecho ============pauseexit 1)call ngdbuild -intstyle ise -dd _ngo -sd ../../COREGEN -nt timestamp -uc "%srcPath%/%ucfFile%" -p %fpgaPart% %core%.ngc %core%.ngdif %errorlevel% NEQ 0 (echo.echo.echo ERROR in ngdbuildecho =================pauseexit 1)call map -intstyle ise -p %fpgaPart% -cm area -ir off -pr off -c 100 -o %core%.ncd %core%.ngd %core%.pcfif %errorlevel% NEQ 0 (echo.echo.echo ERROR in mapecho ============pauseexit 1)call par -w -intstyle ise -ol high -t 1 %core%.ncd %core%.ncd %core%.pcfif %errorlevel% NEQ 0 (echo.echo.echo ERROR in parecho ============pauseexit 1)call trce -intstyle ise -v 3 -s 4 -n 3 -fastpaths -xml %core%.twx %core%.ncd -o %core%.twr %core%.pcfif %errorlevel% NEQ 0 (echo.echo.echo ERROR in traceecho ==============pauseexit 1)call bitgen -f "setBitGen.ut" %core%.ncdif %errorlevel% NEQ 0 (echo.echo.echo ERROR in bidgenecho ===============pauseexit 1)rem ----- Verify Timingfindstr /B /C:"All constraints were met." %core%.parif %errorlevel% NEQ 0 (echo.echo.echo ERROR in Timingecho ===============pauseexit 1)if exist ..\BIN\%XILINX_VERSION% (rem ----- Copy result to BIN\{ISE_VER} directorycopy /Y %core%.bit ..\BIN\%XILINX_VERSION%\%core%_%product%.bitrem copy /Y %core%.par ..\BIN\%XILINX_VERSION%\%core%_%product%.parrem ----- Remove WORK dirrem (bitgen starts wbtc.exe as a secondary process)cd ..rem Wait for xwebtalk has finished its work (sending stat data to Xilinx)echo | set /p=Waiting for WebTalk...:StartLooptasklist | findstr /i /c:"wbtc.exe" > nulif %errorlevel% NEQ 0 (goto ExitLoop)sleep 1echo | set /p=*goto StartLoop):ExitLooprem Tohle nefunguje, protoe výstup wmic je UTF-16 a to finstr neumírem wmic process | findstr /c:"%core%_%product%"rem wmic process > ..\"%core%_%product%".wmicrmdir /S /Q WORK_%core%_%product%exit 0)exit 1