tcl脚本实现ILA(逻辑分析仪)的添加

1.在RTL code处赋待分析信号属性(* mark_debug ="true" *);

2.添加ILA相关脚本之前,需要synth相关的步骤:

launch_runs synth_1
wait_on_run synth_1
open_run synth_1

3.添加ILA相关脚本:

proc add_dbg_port {ila_inst_name probetype portsize portname} {
  set probe [create_debug_port $ila_inst_name probe]
  set_property port_width $portsize [get_debug_ports $probe]
  set_property PROBE_TYPE  $probetype [get_debug_ports $probe]
  if ($portsize>1) {
    set portexpr "${portname}[*]"
    } else {
    set portexpr "${portname}"
    }
  connect_debug_port $probe [lsort -dictionary [get_nets $portexpr]]
}

if {$debug_ila>0} {
  create_debug_core ila_inst_name ila
  set_property C_DATA_DEPTH 1024       [get_debug_cores ila_inst_name]
  set_property C_TRIGIN_EN false       [get_debug_cores ila_inst_name]
  set_property C_TRIGOUT_EN false      [get_debug_cores ila_inst_name]
  set_property C_ADV_TRIGGER true      [get_debug_cores ila_inst_name]
  set_property C_INPUT_PIPE_STAGES 1   [get_debug_cores ila_inst_name]
  set_property C_EN_STRG_QUAL true     [get_debug_cores ila_inst_name]
  set_property ALL_PROBE_SAME_MU true  [get_debug_cores ila_inst_name]
  # ALL_PROBE_SAME_MU_CNT must be:
  # 1 if C_ADV_TRIGGER=false & C_EN_STRG_QUAL=false, 2 if C_ADV_TRIGGER=false & C_EN_STRG_QUAL=true, 4 otherwise
  set_property ALL_PROBE_SAME_MU_CNT 4    [get_debug_cores ila_inst_name]
  set_property port_width 1               [get_debug_ports ila_inst_name/clk]
  connect_debug_port ila_inst_name/clk    [get_nets pl_pclk]
  set_property port_width 5               [get_debug_ports ila_inst_name/probe0]
  connect_debug_port ila_inst_name/probe0 [get_nets pl_ltssm*]

  add_dbg_port ila_inst_name  DATA_AND_TRIGGER  2  pl_equ_phase
}

4.添加ILA相关脚本之后,生成log,探针文件,以及执行opt_design:

if {$debug_ila>0} {
  report_debug_core > debug_core.log
}

opt_design -directive Explore > opt_design.log

if {$debug_ila>0} {
  write_debug_probes debug_nets.ltx
}

5.在工程脚本最前面添加一个ILA使能开关:

set debug_ila 1

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值