tcl语法
(1)if 判断,{}中的语句需要用[]括起来
if {} { 必须留在这一行
}
elseif而不是else if
(2)注释单起一行,不要在命令末尾
(3)procedure的参数用空格隔开
(4)file exists判断文件是否存在
XSCT
打开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
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
[
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
创建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
本文转载自:https://blog.csdn.net/Zhu_Zhu_2009/article/details/81913022