vcs ucli debug命令小记

ucli 为vcs的命令交互模式,需要在编译时加入参数以开启ucli,否则ucli交互时只能使用简单的'run'、'dump'、'quit'命令。

启动方式:./simv -ucli

scope 显示当前的顶层;scope xxx 进入xxx层;scope -up 回到上一层

show 显示当前模块的信号及子模块;

show xxx -value -radix hex/bin/dec 以特定形式显示信号值

run 运行仿真直到遇到$stop或者设置的断点

run -posedge xx 运行到信号xx的上升沿

run -negedge xx 运行到xx信号的下降沿

run -change xx 运行到信号xx变化

stop 显示已经设置的断点

stop -posedge xx 在信号的上升沿设置断点

stop -negedge xx

stop -condition {信号表达式} 在信号表达式为真的地方设置断点

stop -delete xx 删除断点xx,xx为断点数字编号

stop -posedge/-negedge/-condition {}   -command {}  设置断点,并在断点处执行 command

例:stop -change sig0 -command {force sig1 [get sig2]} -quiet -continue

 在sig0 变化时,将sig2的值赋给sig1,-conitnue 如果命令通过脚本被读入的话,需要加上continue参数,不然仿真程序会暂停等待ucli 命令

restart 重新启动ucli调试

force tb_top.xxx.xxx 0 将xxx信号force 为0

force -deposit tb_top.xxx.xxx 0 给xxx信号赋初值为0

force -file filename 读取并执行filename内的force命令。文件内容格式与ucli命令行一致

原文地址:https://www.cnblogs.com/linuxiaogang/p/15618490.html