Debian Codegraph @

tests/snippets/systemverilog/test_basic.txt

raw
1 # Examine tokens emitted by the SV lexer for a trivial module.
2 # Not intended to stress any particular corner of the language.
3
4 ---input---
5 // Adder flops the sum of its inputs
6 module Adder #(
7 parameter int N = 42
8 ) (
9 output logic [N-1:0] y,
10 output logic co,
11
12 input logic [N-1:0] a,
13 input logic [N-1:0] b,
14 input logic ci,
15
16 input logic clk
17 );
18 always_ff @(posedge clk) begin
19 {co, y} <= a + b + ci;
20 end
21 endmodule : Adder
22
23 ---tokens---
24 '// Adder flops the sum of its inputs\n' Comment.Single
25
26 'module' Keyword
27 ' ' Text.Whitespace
28 'Adder' Name
29 ' ' Text.Whitespace
30 '#' Punctuation
31 '(' Punctuation
32 '\n ' Text.Whitespace
33 'parameter' Keyword
34 ' ' Text.Whitespace
35 'int' Keyword.Type
36 ' ' Text.Whitespace
37 'N' Name
38 ' ' Text.Whitespace
39 '=' Operator
40 ' ' Text.Whitespace
41 '42' Literal.Number.Integer
42 '\n' Text.Whitespace
43
44 ')' Punctuation
45 ' ' Text.Whitespace
46 '(' Punctuation
47 '\n ' Text.Whitespace
48 'output' Keyword
49 ' ' Text.Whitespace
50 'logic' Keyword.Type
51 ' ' Text.Whitespace
52 '[' Punctuation
53 'N' Name
54 '-' Operator
55 '1' Literal.Number.Integer
56 ':' Operator
57 '0' Literal.Number.Integer
58 ']' Punctuation
59 ' ' Text.Whitespace
60 'y' Name
61 ',' Punctuation
62 '\n ' Text.Whitespace
63 'output' Keyword
64 ' ' Text.Whitespace
65 'logic' Keyword.Type
66 ' ' Text.Whitespace
67 'co' Name
68 ',' Punctuation
69 '\n\n ' Text.Whitespace
70 'input' Keyword
71 ' ' Text.Whitespace
72 'logic' Keyword.Type
73 ' ' Text.Whitespace
74 '[' Punctuation
75 'N' Name
76 '-' Operator
77 '1' Literal.Number.Integer
78 ':' Operator
79 '0' Literal.Number.Integer
80 ']' Punctuation
81 ' ' Text.Whitespace
82 'a' Name
83 ',' Punctuation
84 '\n ' Text.Whitespace
85 'input' Keyword
86 ' ' Text.Whitespace
87 'logic' Keyword.Type
88 ' ' Text.Whitespace
89 '[' Punctuation
90 'N' Name
91 '-' Operator
92 '1' Literal.Number.Integer
93 ':' Operator
94 '0' Literal.Number.Integer
95 ']' Punctuation
96 ' ' Text.Whitespace
97 'b' Name
98 ',' Punctuation
99 '\n ' Text.Whitespace
100 'input' Keyword
101 ' ' Text.Whitespace
102 'logic' Keyword.Type
103 ' ' Text.Whitespace
104 'ci' Name
105 ',' Punctuation
106 '\n\n ' Text.Whitespace
107 'input' Keyword
108 ' ' Text.Whitespace
109 'logic' Keyword.Type
110 ' ' Text.Whitespace
111 'clk' Name
112 '\n' Text.Whitespace
113
114 ')' Punctuation
115 ';' Punctuation
116 '\n ' Text.Whitespace
117 'always_ff' Keyword
118 ' ' Text.Whitespace
119 '@' Punctuation
120 '(' Punctuation
121 'posedge' Keyword
122 ' ' Text.Whitespace
123 'clk' Name
124 ')' Punctuation
125 ' ' Text.Whitespace
126 'begin' Keyword
127 '\n ' Text.Whitespace
128 '{' Punctuation
129 'co' Name
130 ',' Punctuation
131 ' ' Text.Whitespace
132 'y' Name
133 '}' Punctuation
134 ' ' Text.Whitespace
135 '<' Operator
136 '=' Operator
137 ' ' Text.Whitespace
138 'a' Name
139 ' ' Text.Whitespace
140 '+' Operator
141 ' ' Text.Whitespace
142 'b' Name
143 ' ' Text.Whitespace
144 '+' Operator
145 ' ' Text.Whitespace
146 'ci' Name
147 ';' Punctuation
148 '\n ' Text.Whitespace
149 'end' Keyword
150 '\n' Text.Whitespace
151
152 'endmodule' Keyword
153 ' ' Text.Whitespace
154 ':' Operator
155 ' ' Text.Whitespace
156 'Adder' Name
157 '\n' Text.Whitespace