Script to quickly create vivado project

Script to quickly create vivado project

Realizing that the version management of the program can't be as messy as before, I slowly insisted on using Git for code management. It is really convenient to use scripts to quickly create a unified project catalog.

operating

The first step is to unzip it to the current folder;

Insert picture description here

The second step, double-click the auto_pro.bat script;

effect

After double-clicking the script, there will be a command line display. After a while, vivado will open a new project:

Insert picture description here

Create a project catalog and the contents are as follows:

├─Doc
│      Design_Log.md
│
├─IP
├─Mcs
├─Sim
├─Src
│  ├─CONS
│  ├─RTL
│  └─SIM
├─Tcl
└─Work
    │  auto_prj.bat
    │  auto_prj.tcl
    │  project_1.xpr
    │  vivado.jou
    │  vivado.log
    │  vivado_pid29340.str
    │
    ├─.Xil
    │  └─Vivado-29340-DESKTOP-52IENJH
    ├─project_1.hw
    │      project_1.lpr
    │
    ├─project_1.ip_user_files
    └─project_1.sim

Open it as a compressed file, you can clearly see the content of all levels:

Insert picture description here

The description of the contents of each folder is shown in the figure below:

Insert picture description here
Under normal circumstances, in a Git project, both the Mcs folder and the machine Work folder will be added to the gitignore text to avoid unnecessary updates;

Explanation

Explain the content of the running script;

auto_prj.batThe contents of the file are as follows:

# start "C:\Windows\System32\cmd.exe"
@echo Power By Kingstacker && Jack.
@echo Produce the vivado project.


mkdir ..\Doc ..\IP ..\Mcs ..\Src ..\Src\CONS ..\Src\RTL ..\Src\SIM ..\Sim ..\Tcl

echo # Design_Log > ..\Doc\Design_Log.md

mkdir project_1

cd project_1

set cache_floder= project_1.cache

if exist %cache_floder% (
    echo The floder is exist.
    pause
) else (
    vivado -source ../auto_prj.tcl
)

Create a folder, if it already exists, it will return to the prompt, you can leave it alone.

atuo_prj.tclThe contents of the file are as follows:

#设置器件型号
set device_model xc7k325tffg900-2

cd ../../Work/project_1
#设置工程创建位置
set dev_dir [pwd]
#确保切换到了工程位置
cd $dev_dir
puts "The home_dir is $dev_dir now!"
#创建工程
create_project project_1 $dev_dir -part $device_model
#set_property board_part milianke:dev_zynq:part0:1.2 [current_project]
set_property simulator_language Verilog [current_project]

At this time, the system will open the GUI interface of vivado, and you're done.

Script download

Script download address , please leave a message if the link fails.

reference

https://www.cnblogs.com/kingstacker/p/9810823.html

Guess you like

Origin blog.csdn.net/sinat_31206523/article/details/109208749