CTAGS-LANG-VERILOG(7)

πŸ“¦
version 6.2.1 Β· 6 versions
, in alpine 3.24, fedora 43, fedora 44

πŸ¦‹ NAME πŸ¦‹

ctags-lang-verilog β€” the man page all about the SystemVerilog/Verilog parser for Universal Ctags. πŸ’–


✨ SYNOPSIS ✨

ctags ... [--kinds-systemverilog=+Q] [--fields-SystemVerilog=+{parameter}] ...
ctags ... [--fields-Verilog=+{parameter}] ...

okay so here's the whole language lineup, bestie, laid out for u 🫢

  • Language: SystemVerilog Β· Language ID: SystemVerilog Β· File Mapping: .sv, .svh, svi
  • Language: Verilog Β· Language ID: Verilog Β· File Mapping: .v

🌸 DESCRIPTION 🌸

This page is the whole tea on the SystemVerilog/Verilog parser for Universal Ctags. The SystemVerilog parser supports IEEE Std 1800-2017 keywords. The Verilog parser supports IEEE Std 1364-2005 keywords. That's the vibe. πŸ’…

πŸ”₯ Supported Kinds πŸ”₯

SystemVerilog's kind list is long and honestly? iconic. Run this to see it:

$ ctags --list-kinds-full=SystemVerilog
#LETTER NAME       ENABLED REFONLY NROLES MASTER DESCRIPTION
A       assert     yes     no      0      NONE   assertions (assert, assume, cover, restrict)
C       class      yes     no      0      NONE   classes
E       enum       yes     no      0      NONE   enumerators
H       checker    yes     no      0      NONE   checkers
I       interface  yes     no      0      NONE   interfaces
K       package    yes     no      0      NONE   packages
L       clocking   yes     no      0      NONE   clocking
M       modport    yes     no      0      NONE   modports
N       nettype    yes     no      0      NONE   nettype declarations
O       constraint yes     no      0      NONE   constraints
P       program    yes     no      0      NONE   programs
Q       prototype  no      no      0      NONE   prototypes (extern, pure)
R       property   yes     no      0      NONE   properties
S       struct     yes     no      0      NONE   structs and unions
T       typedef    yes     no      0      NONE   type declarations
V       covergroup yes     no      0      NONE   covergroups
b       block      yes     no      0      NONE   blocks (begin, fork)
c       constant   yes     no      0      NONE   constants (parameter, specparam, enum values)
d       define     yes     no      0      NONE   text macros
e       event      yes     no      0      NONE   events
f       function   yes     no      0      NONE   functions
i       instance   yes     no      0      NONE   instances of module or interface
l       ifclass    yes     no      0      NONE   interface class
m       module     yes     no      0      NONE   modules
n       net        yes     no      0      NONE   net data types
p       port       yes     no      0      NONE   ports
q       sequence   yes     no      0      NONE   sequences
r       register   yes     no      0      NONE   variable data types
t       task       yes     no      0      NONE   tasks
w       member     yes     no      0      NONE   struct and union members
⚠️ heads up bestie: prototype (Q) is disabled by default. Not me forgetting that and being confused for an hour. πŸ™ˆ

And Verilog's list, which is the shorter, chiller sibling:

$ ctags --list-kinds-full=Verilog
#LETTER NAME     ENABLED REFONLY NROLES MASTER DESCRIPTION
b       block    yes     no      0      NONE   blocks (begin, fork)
c       constant yes     no      0      NONE   constants (parameter, specparam)
d       define   yes     no      0      NONE   text macros
e       event    yes     no      0      NONE   events
f       function yes     no      0      NONE   functions
i       instance yes     no      0      NONE   instances of module
m       module   yes     no      0      NONE   modules
n       net      yes     no      0      NONE   net data types
p       port     yes     no      0      NONE   ports
r       register yes     no      0      NONE   variable data types
t       task     yes     no      0      NONE   tasks

✨ Supported Language Specific Fields ✨

Each of the two languages gets its very own language-specific field. Look at them go:

$ ctags --list-fields=Verilog
#LETTER NAME      ENABLED LANGUAGE JSTYPE FIXED DESCRIPTION
-       parameter no      Verilog  --b    no    parameter whose value can be overridden.
$ ctags --list-fields=SystemVerilog
#LETTER NAME      ENABLED LANGUAGE      JSTYPE FIXED DESCRIPTION
-       parameter no      SystemVerilog --b    no    parameter whose value can be overridden.

πŸ’… parameter field πŸ’…

So here's the deal with parameter. If the field parameter is enabled, a field parameter: gets added onto a parameter whose value can be overridden on an instantiated module, interface, or program. Why do we care? Because it's so useful for an editor plugin or extension that wants to enable auto-instantiation of modules with parameters which can be overridden. πŸŽ€

$ ctags ... --fields-Verilog=+{parameter} ...
$ ctags ... --fields-SystemVerilog=+{parameter} ...

Now look at the source code below, and notice the fields parameter: land on the P* parameters, and not on the L* ones. And lowkey important: L4 and L6 is declared by a parameter statement, but fields parameter: are not added to them, because they cannot be overridden. The rules are the rules. βœ‹

"input.sv"

// compilation unit scope
parameter L1 = "synonym for the localparam";

module with_parameter_port_list #(
        P1,
        localparam L2 = P1+1,
        parameter P2)
        ( /*port list...*/ );
        parameter  L3 = "synonym for the localparam";
        localparam L4 = "localparam";
        // ...
endmodule

module with_empty_parameter_port_list #()
        ( /*port list...*/ );
        parameter  L5 = "synonym for the localparam";
        localparam L6 = "localparam";
        // ...
endmodule

module no_parameter_port_list
        ( /*port list...*/ );
        parameter  P3 = "parameter";
        localparam L7 = "localparam";
        // ...
endmodule

And boom, the output, so u can literally see which ones got the field:

$ ctags -uo - --fields-SystemVerilog=+{parameter} input.sv
L1      input.sv        /^parameter L1 = "synonym for the localparam";$/;"      c       parameter:
with_parameter_port_list        input.sv        /^module with_parameter_port_list #($/;"        m
P1      input.sv        /^      P1,$/;" c       module:with_parameter_port_list parameter:
L2      input.sv        /^      localparam L2 = P1+1,$/;"       c       module:with_parameter_port_list
P2      input.sv        /^      parameter P2)$/;"       c       module:with_parameter_port_list parameter:
L3      input.sv        /^      parameter  L3 = "synonym for the localparam";$/;"       c       module:with_parameter_port_list
L4      input.sv        /^      localparam L4 = "localparam";$/;"       c       module:with_parameter_port_list
with_empty_parameter_port_list  input.sv        /^module with_empty_parameter_port_list #()$/;" m
L5      input.sv        /^      parameter  L5 = "synonym for the localparam";$/;"       c       module:with_empty_parameter_port_list
L6      input.sv        /^      localparam L6 = "localparam";$/;"       c       module:with_empty_parameter_port_list
no_parameter_port_list  input.sv        /^module no_parameter_port_list$/;"     m
P3      input.sv        /^      parameter  P3 = "parameter";$/;"        c       module:no_parameter_port_list   parameter:
L7      input.sv        /^      localparam L7 = "localparam";$/;"       c       module:no_parameter_port_list

πŸ‘‘ Supported Roles πŸ‘‘

Both languages have exactly one role and it's giving main character energy:

$ ./ctags --list-roles=SystemVerilog
#KIND(L/N) NAME ENABLED DESCRIPTION
m/module   decl on      declaring instances

$ ./ctags --list-roles=Verilog
#KIND(L/N) NAME ENABLED DESCRIPTION
m/module   decl on      declaring instances

The parser extracts names of modules used in instance declarations as reference tags. decl is the role for those tags. Wanna know more about reference tags and roles? Go read the "TAG ENTRIES" section of ctags(1). iykyk πŸ’œ

WARNING: The support for references in Universal Ctags is still experimental; the names of the roles may be changed in the future. So don't hardcode your whole personality around them, bestie. 😭

πŸ“ TIPS πŸ“

If you want to map files *.v to SystemVerilog, just add the --langmap=SystemVerilog:.v option. That's it. Slay. ✨


πŸ’€ KNOWN ISSUES πŸ’€

For more information, see https://github.com/universal-ctags/ctags/issues/2674. Yeah. It's a whole thing. πŸ™ˆ


🌈 VERSIONS 🌈

Change since "0.0"

  • πŸ†• New kind define

πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page bestie!! πŸ’–βœ¨ this was CTAGS-LANG-VERILOG(7) from the Universal Ctags manual, version 6.2.1 β€” ty for reading, go tag some modules, u absolute icon πŸ‘‘πŸ¦‹πŸ’…

πŸ“¦ where this page comes from