Vivado簡單調試技能


Vivado簡單調試技能

1.關於VIO核的使用

首先配置VIO核:

配置輸入輸出口的數量5,5

配置輸入口的位寬

配置輸出口位寬和初始值。

例化與使用:

vio_0 U1 (
  .clk(clk_27M),                // input wire clk
  .probe_in0(),    // input wire [0 : 0] probe_in0
  .probe_in1(),    // input wire [0 : 0] probe_in1
  .probe_in2(),    // input wire [0 : 0] probe_in2
  .probe_in3(),    // input wire [0 : 0] probe_in3
  .probe_in4(),    // input wire [0 : 0] probe_in4
  .probe_out0(),  // output wire [0 : 0] probe_out0
  .probe_out1(qpllreset),  // output wire [0 : 0] probe_out1
  .probe_out2(),  // output wire [0 : 0] probe_out2
  .probe_out3(),  // output wire [0 : 0] probe_out3
  .probe_out4()  // output wire [0 : 0] probe_out4
); 

    一定要注意的是,准確給定這個核的時鍾,probe_in端口目前還不知道怎么用,只使用了probe_out端口。使用場景就是讓這個核輸出某個數值到相關的信號線,比如:.probe_out1(qpllreset),  // output wire [0 : 0] probe_out1;可以在調試階段控制這個核輸出0或者1qpllreset信號,由此我們可以手動對QPLL進行復位控制了。

 

2.ILA核的使用

 

配置ILA核:

 

配置probes的個數,和數據采樣的深度。

分別配置每個probe的位寬。

 

例化與使用ILA核:

 

ila_0 U5 (
    .clk(drpclk), // input wire clk
    .probe0(current_state_W), // input wire [0:0]  probe0  
    .probe1(next_state_W), // input wire [0:0]  probe1 
    .probe2(timeout_cntr_W),
    .probe3(clear_timeout_cntr_W), // input wire [0:0]  probe3 
    .probe4(plllock_timeout_W), // input wire [0:0]  probe4
    .probe5(reset_timeout_W), // input wire [0:0]  probe5 
    .probe6(init_period_done_W), // input wire [0:0]  probe6 
    .probe7(refclk_stable_ss_W), // input wire [2:0]  probe7 
    .probe8(refclk_stable_s), // input wire [0:0]  probe8 
    .probe9(pll_lock_ss_W), // input wire [2:0]  probe9
    .probe10(pll_lock_s), // input wire [0:0]  probe10 
    .probe11(rxresetdone_ss_W), // input wire [2:0]  probe11 
    .probe12(assert_pll_reset_W), // input wire [0:0]  probe12 
    .probe13(assert_gt_reset_W), // input wire [0:0]  probe13 
    .probe14(assert_done_W), // input wire [0:0]  probe14 
    .probe15(assert_fail_W), // input wire [0:0]  probe15 
    .probe16(assert_drp_req_W), // input wire [0:0]  probe16 
    .probe17(assert_drp_busy_out_W), // input wire [0:0]  probe17 
    .probe18(inc_retry_cntr_W), // input wire [0:0]  probe18 
    .probe19(clear_retry_cntr_W), // input wire [0:0]  probe19 
    .probe20(max_retries), // input wire [0:0]  probe20
    .probe21(rxresetdone_s) // input wire [0:0]  probe21
);

 

    同樣,也需要給這個核輸入時鍾,probe()端口需要接入wire類型的信號,在調試的過程中我們經常需要抓取reg類型的信號進行分析,因此可以這樣處理,將reg型轉為wire型:

 

 

reg                                 assert_pll_reset;
wire assert_pll_reset_W;
assign assert_pll_reset_W = assert_pll_reset;

reg                                 assert_gt_reset;
wire assert_gt_reset_W;
assign assert_gt_reset_W = assert_gt_reset;

reg                                 assert_done;
wire assert_done_W;
assign assert_done_W = assert_done;

reg                                 assert_fail;
wire assert_fail_W;
assign assert_fail_W = assert_fail;

reg                                 assert_drp_req;
wire assert_drp_req_W;
assign assert_drp_req_W = assert_drp_req;

    燒寫完程序之后,就可以抓這些信號的波形,得到的波形圖如下:

3.關於set up debug的使用:

Set up debug算是一種自動添加ILA核的方法。在下面的對話框中加入我們要查看的信號,然后重新進行綜合布局布線生成bit文件,燒寫程序完成后出現波形界面。

注意其中信號的時鍾域不同,生成的ILA核就不同:

手動添加的ILA核

 

時鍾域為clk_27M

時鍾域為:SDI0/SDI/CLK

時鍾域為:SDI0/SDI/CLK


免責聲明!

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



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