Files
Palladium-Z3-demo_ice_top/ice/scripts/run_xedebug_ice.tcl
T

44 lines
1.3 KiB
Tcl
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# =============================================================================
# run_xedebug_ice.tcl -- Palladium Z3 ICE 标准上机运行脚本
#
# 官方标准流程:
# 1. debug . -- 进入调试上下文
# 2. host <XE_HOST> -- 连接 Palladium Z3 物理机台
# 3. xc on -run -- 下载网表到硬件并启动运行
# =============================================================================
# 1. 进入调试上下文
debug .
# 2. 连接 Palladium Z3 物理机台
if {[info exists env(XE_HOST)]} {
host $env(XE_HOST)
} else {
host z7f1x8c-5k9p3m
}
# 3. 下载设计到硬件并启动
xc on -run
# 4. 运行 2000 个时钟周期供自检 FSM 判定
run 2000
# 5. 读取硬件引脚判定结果
set done_val [value /z3_demo_ice_top/led_done]
set pass_val [value /z3_demo_ice_top/led_pass]
set fail_val [value /z3_demo_ice_top/led_fail]
set gpio_val [value /z3_demo_ice_top/led_gpio]
puts "=========================================================="
puts " led_done : $done_val"
puts " led_pass : $pass_val"
puts " led_fail : $fail_val"
puts " led_gpio : $gpio_val"
if {$pass_val == 1 && $fail_val == 0} {
puts "===> [TEST PASSED] Palladium Z3 ICE 全硬件测试通过!"
} else {
puts "===> [TEST FAILED] ICE 硬件自检未通过"
}
puts "=========================================================="