4.1 Vivado使用技巧(3):手把手教你 創建工程,存檔工程


目錄

step 1. Creating a Project

step 2. Creating Design Sources

step4 . Simulation

part 5 . Add constraint files

part 6 . Add IP Sources

part 7 .Creating a New Block Design

part 8 .打開/新建原理圖schematic

知識點.  給一個工程存檔

建立一個工程(Tcl版)


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可以查看綜合后的完整網表結構。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM