使用 TCL 脚本查找并替换 .\ 为 .@ {\/

问题描述 投票:0回答:1
请帮助使用 TCL 脚本修改以下行

来自

top.dut.fe.stk.pma.phy.phy0.pma.dig.lane0.asic_xface.\range_counter_reg[0]

top.dut.fe.stk.pma.phy.phy0.pma.dig.lane0.asic_xface.@ {\/range_counter_reg[0]}.Q
尝试使用查找和替换但不起作用

tcl
1个回答
1
投票
使用

regsub

 -- regsub {.\\(.+)} $from {.@ {/\1}.Q}

set from {top.dut.fe.stk.pma.phy.phy0.pma.dig.lane0.asic_xface.\range_counter_reg[0]} set to [regsub {.\\(.+)} $from {.@ {/\1}.Q}] puts $from; puts $to
top.dut.fe.stk.pma.phy.phy0.pma.dig.lane0.asic_xface.\range_counter_reg[0]
top.dut.fe.stk.pma.phy.phy0.pma.dig.lane0.asic_xface.@ {/range_counter_reg[0]}.Q
    
© www.soinside.com 2019 - 2024. All rights reserved.