在线咨询 切换到宽版
eetop公众号 创芯大讲堂 创芯人才网

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜全文
查看: 1604|回复: 1

[讨论] 怎么可以把list反向输出

[复制链接]
发表于 2022-4-5 11:45:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
请教一个问题,all_fanout -from xx输出是A,B ,C,D的顺序,怎么可以实现输出是D,C ,B,A?
发表于 2022-4-5 13:36:03 | 显示全部楼层
all_fanout returns a collection, not list.  
If you only care about the name of the objects in the collection, you can convert all_fanout output into a list first.
Once you have a list, it's easy to use lreverse to change the order of the list.  

Example:
set myList [get_object_name [all_fanout -from u_digcore/u_registers/rg_config0_r_reg_0_cn/Q -endpoints_only]]
puts $myList
puts [lreverse $myList]

If you want to reverse the order of the objects in a collection, it takes a few more lines.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-9-26 00:55 , Processed in 0.013138 second(s), 4 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表