File: ctags-lang-verilog.7.rst

package info (click to toggle)
universal-ctags 6.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,612 kB
  • sloc: ansic: 158,498; sh: 8,621; lisp: 7,742; vhdl: 6,518; cpp: 2,583; perl: 2,578; python: 2,324; javascript: 2,054; cs: 1,193; lex: 1,015; sql: 897; makefile: 787; ruby: 764; php: 755; cobol: 741; f90: 566; ada: 559; asm: 509; yacc: 465; fortran: 412; xml: 405; objc: 289; tcl: 280; java: 173; erlang: 65; pascal: 58; ml: 49; awk: 44; haskell: 42
file content (219 lines) | stat: -rw-r--r-- 8,572 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
.. _ctags_lang-verilog(7):

======================================================================
ctags-lang-verilog
======================================================================

The man page about SystemVerilog/Verilog parser for Universal Ctags


:Version: 6.2.1
:Manual group: Universal Ctags
:Manual section: 7

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

    +---------------+---------------+-------------------+
    | Language      | Language ID   | File Mapping      |
    +===============+===============+===================+
    | SystemVerilog | SystemVerilog | .sv, .svh, svi    |
    +---------------+---------------+-------------------+
    | Verilog       | Verilog       | .v                |
    +---------------+---------------+-------------------+

DESCRIPTION
-----------
This man page describes about the SystemVerilog/Verilog parser for Universal Ctags.
SystemVerilog parser supports IEEE Std 1800-2017 keywords.
Verilog parser supports IEEE Std 1364-2005 keywords.

Supported Kinds
~~~~~~~~~~~~~~~

.. code-block:: console

	$ 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

Note that ``prototype`` (``Q``) is disabled by default.

.. code-block:: console

	$ 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: console

	$ 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
....................

If the field ``parameter`` is enabled, a field ``parameter:`` is added on a parameter whose
value can be overridden on an instantiated module, interface, or program.
This is useful for a editor plugin or extension to enable auto-instantiation of modules with
parameters which can be overridden.

.. code-block:: console

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

On the following source code fields ``parameter:`` are added on
parameters ``P*``, not on ones ``L*``.  Note that ``L4`` and ``L6`` is declared by
``parameter`` statement, but fields ``parameter:`` are not added,
because they cannot be overridden.

"input.sv"

.. code-block:: systemverilog

	// 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

.. code-block:: console

	$ 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
~~~~~~~~~~~~~~~

.. code-block:: console

	$ ./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 the tags. See "TAG ENTRIES"
section of :ref:`ctags(1) <ctags(1)>` about reference tags and roles.

.. warning::

   The support for references in Universal Ctags is still
   experimental; the names of the roles may be changed in the future.

TIPS
~~~~

If you want to map files ``*.v`` to SystemVerilog, add
``--langmap=SystemVerilog:.v`` option.

KNOWN ISSUES
---------------------------------------------------------------------

See https://github.com/universal-ctags/ctags/issues/2674 for more information.

VERSIONS
--------

Change since "0.0"
~~~~~~~~~~~~~~~~~~

* New kind ``define``

SEE ALSO
--------

- :ref:`ctags(1) <ctags(1)>`
- :ref:`ctags-client-tools(7) <ctags-client-tools(7)>`
- Language Reference Manuals (LRM)

   - IEEE Standard for SystemVerilog — Unified Hardware Design, Specification, and
     Verification Language, IEEE Std 1800-2017,
     https://ieeexplore.ieee.org/document/8299595
   - IEEE Standard for Verilog Hardware Description Language, IEEE Std 1364-2005,
     https://ieeexplore.ieee.org/document/1620780