芯片验证环境中如何实现在vim中跳转到class / task / function / define

  1. linux中安装ctags

  1. 需要让ctags认识systemverilog。将以下代码拷贝到~/.ctags 中

--exclude=.SOS
--exclude=.git
--exclude=nobackup
--exclude=nobkp
--exclude=results
--exclude=*.log

--langdef=SystemVerilog
--langmap=SystemVerilog:.sv.v.svh.tv.vg.vinc

--regex-SystemVerilog=/^\s*(\b(static|local|virtual|protected)\b)*\s*\bclass\b\s*(\b\w+\b)/\3/c,class/
--regex-SystemVerilog=/^\s*(\b(static|local|virtual|protected)\b)*\s*\btask\b\s*(\b(static|automatic)\b)*\s*(\w+::)*\s*(\b\w+\b)/\6/t,task/
--regex-SystemVerilog=/^\s*(\b(static|local|virtual|protected)\b)*\s*\bfunction\b\s*(\b(\w+)\b)*\s*(\w+::)*\s*(\b\w+\b)/\6/f,function/

--regex-systemverilog=/^\s*clocking\s+(\w+)/\1/e,clocking/
--regex-systemverilog=/^\s*constraint\s+(\w+)/\1/i,constraint/
--regex-systemverilog=/^\s*covergroup\s+(\w+)/\1/l,covergroup/
--regex-SystemVerilog=/^\s*\bmodule\b\s*(\b\w+\b)/\1/m,module/
--regex-SystemVerilog=/^\s*\bprogram\b\s*(\b\w+\b)/\1/p,program/
--regex-SystemVerilog=/^\s*\binterface\b\s*(\b\w+\b)/\1/i,interface/
--regex-SystemVerilog=/^\s*\btypedef\b\s+.*\s+(\b\w+\b)\s*;/\1/e,typedef/
--regex-SystemVerilog=/^\s*`define\b\s*(\w+)/\1/d,define/
--regex-SystemVerilog=/}\s*(\b\w+\b)\s*;/\1/e,typedef/

--regex-SystemVerilog=/^\s*(\b(static|local|private|rand)\b)*\s*(\b(shortint|int|longint)\b)\s*(\bunsigned\b)?(\s*
.+
.
+
)*\s*(\b\w+\b)/\7/v,variable/
--regex-SystemVerilog=/^\s*(\b(static|local|private|rand)\b)*\s*(\b(byte|bit|logic|reg|integer|time)\b)(\s*
.+
.
+
)*\s*(\b\w+\b)/\6/v,variable/
--regex-SystemVerilog=/^\s*(\b(static|local|private)\b)*\s*(\b(real|shortreal|chandle|string|event)\b)(\s*
.+
.
+
)*\s*(\b\w+\b)/\6/v,variable/
--regex-SystemVerilog=/(\b(input|output|inout)\b)?\s*(
.+
.
+
)*\s*(\b(wire|reg|logic)\b)\s*(
.+
.
+
)*\s*(#(.+
.
+
|\S+)\))?\s*(\b\w+\b)/\9/v,variable/
--regex-SystemVerilog=/(\b(parameter|localparam)\b).+(\b\w+\b)\s*=/\3/a,parameter/

--SystemVerilog-kinds=+ctfmpied

  1. cd $verif/chip(验证环境的根目录下), ctags -R -languages==systemverilog,这样会在根目录下生成一个tags文件

  1. 在vimrc中添加

set tag=tags;
set tags+=$verif/chip/tags
  1. 在vim中按ctrl+]就能跳转到对应的task/function/class/define的源文件

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值