Xilinx XSCT tcl命令行工具使用

作者

QQ群:852283276
微信:arm80x86
微信公众号:青儿创客基地
B站:主页 https://space.bilibili.com/208826118

参考

TCL script to auto-generate a jtag boot script based on HDF file for Zynq Ultrascale
Programming QSPI from U-boot ZC702
AR# 67871 Zynq UltraScale+ MPSoC: MicroBlaze PMU MDM is disabled by default on ES2 and higher.
Debugging U-Boot drivers in SDK 2018.3
Debug U-boot
Xilinx XSCT 调试jtag-uart , jtagterminal

tcl语法

(1)if 判断,{}中的语句需要用[]括起来

if {} { 必须留在这一行
}
elseif而不是else if

(2)注释单起一行,不要在命令末尾
(3)procedure的参数用空格隔开
(4)file exists判断文件是否存在

生成工程

打开xsct,

zc@ubuntu:~/xilinx/fsbl$ $PETALINUX/tools/hsm/bin/xsct
$PETALINUX/tools/hsm/bin/xsct 
rlwrap: warning: your $TERM is 'xterm-256color' but rlwrap couldn't find it in the terminfo database. Expect some problems.
                                                                                                                                                                                                            
****** Xilinx Software Commandline Tool (XSCT) v2017.4
  **** Build date : Dec 13 2017-18:17:23
    ** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.


xsct% 

调出帮助,

xsct% help                                                                                                                                                                                                  
Available Help Categories

connections   - Target Connection Management
registers     - Target Registers
running       - Program Execution
memory        - Target Memory
download      - Target Download FPGA/BINARY
reset         - Target Reset
breakpoints   - Target Breakpoints/Watchpoints
streams       - Jtag UART
miscellaneous - Miscellaneous
jtag          - JTAG Access
tfile         - Target File System
svf           - SVF Operations
sdk           - SDK Projects
petalinux     - Petalinux commands
hsi           - HSI commands

Type "help" followed by above "category" for more details or
help" followed by the keyword "commands" to list all the commands

调出命令集帮助,

xsct% help hsi                                                                                                                                                                                              
Category commands

hsi create_dt_node         - Create a DT Node
hsi create_dt_tree         - Create a DT tree
hsi current_dt_tree        - Set or get current tree
hsi get_dt_nodes           - Get a list of DT node objects
hsi get_dt_trees           - Get a list of dts trees created
hsi close_hw_design        - Close a HW design
hsi current_hw_design      - Set or get current hardware design
hsi get_cells              - Get a list of cells
hsi get_hw_designs         - Get a list of hardware designs opened
hsi get_hw_files           - Get a list of hardware design supporting files
hsi get_intf_nets          - Get a list of interface nets
hsi get_intf_pins          - Get a list of interface pins
hsi get_intf_ports         - Get a list of interface ports
hsi get_mem_ranges         - Get a list of memory ranges
hsi get_nets               - Get a list of nets
hsi get_pins               - Get a list of pins
...
Type "help" followed by above "command", or the above "command" followed by
"-help" for more details

调出命令帮助,

xsct% hsi::open_hw_design -help                                                                                                                                                                             
hsi::open_hw_design

Description: 
Open a hardware design from disk file.

Syntax: 
hsi::open_hw_design  [-name <arg>] [-quiet] [-verbose] [<file>]

Returns: 
Hardware design object. Returns nothing if the command fails.

Usage: 
  Name        Description
  -----------------------
  [-name]     Hardware design name
  [-quiet]    Ignore command errors
  [-verbose]  Suspend message limits during command execution
  [<file>]    Hardware design file to open

Categories: 
Hardware

执行shell命令,利用exec,

xsct% exec ls 

打开hw design,

xsct% hsi::open_hw_design -name mwm178_hw hw/178.hdf                                                                                                                                                        
ERROR: [Hsi 61-74] Option name is only supported for dsa files
ERROR: [Common 17-39] 'hsi::open_hw_design' failed due to earlier errors.
xsct% hsi::open_hw_design hw/178.hdf
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds                                                                                                                                           
hsi::open_hw_design: Time (s): cpu = 00:00:14 ; elapsed = 00:00:16 . Memory (MB): peak = 517.078 ; gain = 170.008 ; free physical = 125 ; free virtual = 2841
MWM178_V1_U6_V1
xsct% exec ls hw/                                                                                                                                                                                           
178.hdf
psu_init.c
psu_init_gpl.c
psu_init_gpl.h
psu_init.h
psu_init.html
psu_init.tcl
xsct% sdk::setws .                                                                                                                                                                      
xsct% hsi::utils::openhw hw/178.hdf 
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds 

获取cell,

xsct% hsi::get_cells * -filter {NAME=~*sd*}                                                                                                                                                                               
ps7_sd_0

获取property,

xsct% hsi::report_property [hsi::get_cells * -filter {NAME=~*sd*}]                                                                                                                                                        
Property                             Type     Read-only  Value
ADDRESS_TAG                          string   true       
CLASS                                string   true       cell
CONFIG.C_HAS_CD                      string   true       1
CONFIG.C_HAS_POWER                   string   true       0
CONFIG.C_HAS_WP                      string   true       1
CONFIG.C_INTERCONNECT_S_AXI_MASTERS  string   true       ps7_cortexa9_0.M_AXI_DP & ps7_cortexa9_1.M_AXI_DP
CONFIG.C_SDIO_CLK_FREQ_HZ            string   true       100000000
CONFIG.C_S_AXI_BASEADDR              string   true       0xE0100000
CONFIG.C_S_AXI_HIGHADDR              string   true       0xE0100FFF
CONFIGURABLE                         bool     true       0
DRIVER_MODE                          string   true       
HIER_NAME                            string   true       
IP_NAME                              string   true       ps7_sdio
IP_TYPE                              enum     true       PERIPHERAL
IS_HIERARCHICAL                      bool     true       0
IS_PL                                bool     true       0
NAME                                 string   true       ps7_sd_0
PRODUCT_GUIDE                        string   true       
SLAVES                               string*  true       
VLNV                                 string   true       xilinx.com:ip:ps7_sdio:1.00.a
xsct% hsi::get_property CONFIG.C_SDIO_CLK_FREQ_HZ [hsi::get_cells * -filter {NAME=~*sd*}]                                                                                                                                 
100000000

创建fsbl,

xsct% hsi::get_cells * -filter {IP_TYPE==PROCESSOR} 
xsct% hsi::generate_app -app zynqmp_fsbl -proc psu_cortexa53_0 -dir zynqmp_fsbl -os standalone -verbose

tcl加法,自动支持10/16进制,

xsct% set ddr_len [expr $ddr_len + 1]
  • 2
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
XSCT是一种通过JTAG直接操作硬件进行调试的工具。它是一种最直接的调试手段,即使在无法通过外部flash或SD卡启动的情况下,仍然可以使用XSCT进行调试。 在使用XSCT进行调试时,可以使用dow命令来下载文件到硬件上。需要注意的是,在路径外加一个大括号{}来表示路径,因为在Linux下路径表示为'/',而在Windows下路径表示为'\',两者不兼容。为了解决这个问题,XSCT采用了在路径外加一个大括号{}的方式。如果直接复制路径,可能会出现找不到下载文件或路径的错误。 此外,在选择BSP中stdio的默认连接时,需要选择psu_coresight_0,而不要选择mdm_0。如果选择了错误的连接,在terminal中可能无法看到打印的数据。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Xilinx XSCT tcl命令行工具使用](https://blog.csdn.net/Zhu_Zhu_2009/article/details/81913022)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [Xilinx XSCT 调试jtag-uart , jtagterminal](https://blog.csdn.net/luodicaizi84/article/details/108417797)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值