4.1 Vivado使用技巧(3):手把手教你 创建工程,存档工程
发布日期:2022-04-04 06:36:33 浏览次数:1 分类:博客文章

本文共 3340 字,大约阅读时间需要 11 分钟。

目录


step 1. Creating a Project

4.选择RTL,可以打勾/也可以不勾选,此出我勾选了,NEXT。

5.选择你的芯片型号,NEXT , FINISH。稍等几秒后,界面变为

 

step 2. Creating Design Sources

从上文可以看出,开发一个完整项目可以包含很多的sources(黄色高亮)。绿色高亮注释的是project mode和No-project mode的区别。

1右键后,创建。或者select File > Add Sources.

2.按下图操作

3 弹出添加引脚的设置窗,可以先不添加,之后再修改。点击OK

此处我的程序为:

 

4 添加仿真文件

5 此处点击OK , YES

6.修改程序

7 此出界面变成了,成功创建了一个简单的工程!

 

step4 . Simulation

1.完成以上步骤后,就可以仿真了!为了验证代码是否正确,可以对代码进行行为仿真。

2.得到结果

 

建立一个复杂的项目时,就需要用到接下来的几步了。(比如把项目导入开发板)

 

part 5 . Add constraint files

此步,添加约束文件。

1.click Add Sources > select Add or Create Constraints >click Next.   >  create file

2. 生成了.xdc文件 Xilinx design constraint (XDC)

3. 设置你的芯片型号(其实最开始就选好了型号,选错/修改的话,执行此步)

4. 

 

part 6 . Add IP Sources

1 点击左侧的 IP Catalog,选好IP核后双击左键open the Customize IP dialog box for the selected IP core.

2 上图设置好后,点击OK > OK > generate

3 此时在IP SOURCES里能看到我们新添加的IP,Hierarchy里也能看到(.xci后缀的文件)

4 也可以添加existing XCI files,步骤和step2里添加方法一样。

5 生成后,在“IP Source->IP->num_rom->Instantiation Template”可以看到实例化文件。可将该IP实例化到工程中。

6 完成工程代码编写后,工程会自动检查与非错误,或者右击文件,选择“Refresh Hierarchy”以使vivado检查语法错误。

    若有语法错误,则图示几处会给出错误提示。

7 You can run Reports > Report IP Status to and review the state of the newly added IP.

 

part 7 .Creating a New Block Design

1. In the Flow Navigator, expand IP Integrator.

2. Select Create Block Design.

3. 点击“+”添加IP吧~~

4.Generating Output Products for Block Designs

     select Generate Block Design from the Flow Navigator

5.实例化到你的设计中

 

 

part 8 .打开/新建原理图schematic

  • Select Flow > Open Elaborated Design.
  • In the RTL Analysis section of the Flow Navigator, select Open Elaborated Design to load the elaborated netlist, the active constraint set, and the target device into memory.

  • Select Flow > New Elaborated Design.
  • In the Flow Navigator, select New Elaborated Design from the RTL Analysis right-clickmenu

(打开的是top.v的原理图噢)

 

 

 

 

 

 

 

 

知识点.  给一个工程存档

Select File > Project > Archive

会创建一个压缩包在选择的目录下,成功存档。

 

 

建立一个工程(Tcl版)

1.File -->  New project --> RTL project(Do not specify sources at this time) --> choose your xilinx device --> finish.

2.在Design sources 选择add Sources --> Add or creat design sources --> create file --> finish

3.此时会弹出Define Module --> 添加、设计你所需要的输入输出端口 --> OK

4.在Sources窗口下双击你刚建立的工程,我的 :top.v

5.编写程序,我选择的是Verilog语言,写好程序后保存top.v

module top(    input clk,    input a,    input b,    output reg [5:0] z    );    reg a_tmp,b_tmp;    reg [5:0] z_tmp;    always @(posedge clk)    begin        a_tmp <=a;        b_tmp <=b;    end        always @(*)    begin        z_tmp[0] = a_tmp & b_tmp;        z_tmp[1] = ~(a_tmp & b_tmp);        z_tmp[2] = a_tmp | b_tmp;        z_tmp[3] = ~(a_tmp | b_tmp);        z_tmp[4] = a_tmp ^ b_tmp;        z_tmp[5] = ~(a_tmp ^ b_tmp);    end        always @(posedge clk)    begin    z <= z_tmp;    end;    endmodule

6.在Flow Nevigator下选择--> RTL ANALYSIS --> 单击Open Elaborated Design ,等待片刻后自动打开Schematic界面

【定制Tcl脚本命令】

7.  Tools --> Custom Commands --> Customize Commands --> + --> Enter name: generate hdl template --> Run command[window input:]:xilinx::designutils::write_template -verilog  --> OK 此时在Vivado主界面工具栏中出现TCL按钮。

【生成顶层模块】

8.1 top.v右键 --> Set As Top 

8.2 Flow Nevigator --> RTL ANALYSIS --> Open Elaborated Design --> 点击TCL按钮

表示生成了top模块的模板。

8.3 在上图的控制台中输入Tcl脚本命令:read_verilog C:/Users/lulu/AppData/Roaming/Xilinx/Vivado/top.v  -->Enter

 

【执行设计综合】

1.Flow Navigator --> SYNTHESIS --> Run Synthesis --> ... 全部完成后,

SYNTHESIS 窗口有一下选项,点击Schematie可以查看综合后的完整网表结构。

转载地址:https://www.cnblogs.com/l20902/p/10610908.html 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:4.2 Vivado Embedded Design (Zynq-7000 series)
下一篇:4.1 Vivado使用技巧(2):使用Vivado DocNav

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年03月18日 14时01分41秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章