/
README
137 lines (129 loc) · 5.05 KB
/
README
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
-*- mode: outline -*-
* Syntax highlight
** check vlog-mode-keywordset-docs and vlog-mode-keywordset-pragmas.
vlog-mode will highlight keywords inside comments like "// sysnopsys ..." or
"// todo: ...". you can add your own keywords.
** vlog-mode-keywords-use-generic-systask (default value is nil):
If vlog-mode-keywords-use-generic-systask is t, than anything like "$systask"
will be highlighted as system task; If it's nil, than only standard system
tasks will be highlighted. Standard system tasks are defined in variable
vlog-mode-keywordset-systasks.
* Indentation settings
You can set your own indentation style like this:
(setq vlog-indent-level-beh 2
vlog-indent-level-block 0
vlog-indent-level-block-beh 0
vlog-indent-level-block-inside 3
vlog-indent-level-case-inside 4
vlog-indent-level-case-branch-inside 2
vlog-indent-level-cond 3
vlog-indent-level-default 4
vlog-indent-level-port-list 4
vlog-indent-align-port-list-to-paren nil
vlog-indent-align-else-to-if nil)
Below is elaborations on these parameters:
** vlog-indent-level-beh and vlog-indent-level-block-beh:
always @(this or that)
if (this) ------------------> vlog-indent-level-beh (2)
......
......
always @(this or that)
begin ------------------------> vlog-indent-level-block-beh (0)
if (this)
......
** vlog-indent-level-cond:
if (sig1 && ~sig2)
out_sig <= in_sig; --------> vlog-indent-level-cond (3)
** vlog-indent-level-block and vlog-indent-level-block-inside:
if (this)
begin ----------------------> vlog-indent-level-block (2)
signal = value; --------> vlog-indent-level-block-inside (4)
end
** vlog-indent-level-case-inside and vlog-indent-level-case-branch-inside:
case (sig)
VALUE1: ------------------> vlog-indent-level-case-inside (4)
out = ~in; -------------> vlog-indent-level-case-branch-inside (2)
......
** vlog-indent-level-port-list and vlog-indent-align-port-list-to-paren:
If vlog-indent-align-port-list-to-paren is nil, than the indentation will be:
module my_mod (
in_port, ----+------------> vlog-indent-level-port-list (4)
in_port2,----|
out_port,----|
out_port2----|
);
If vlog-indent-align-port-list-to-paren is t, than the indentation will be:
module my_mod (
in_port,
in_port2,
out_port,
out_port2
);
** vlog-indent-level-default:
I don't exactly know when will this variable be used :) Its default value is 4.
** vlog-indent-align-else-to-if:
If vlog-indent-align-else-to-if is nil, then the indentation will be:
if (sig1)
out = in[1];
else if (sig2)
out = in[2];
else if (sig3)
out = in[3];
else if (sig4)
out = in[4];
......
If vlog-indent-align-else-to-if is t, then the indentation will be:
if (sig1)
out = in[1];
else if (sig2)
out = in[2];
else if (sig3)
out = in[3];
else if (sig4)
out = in[4];
......
* Align settings
** vlog-align-do-align-with-indent (default value is t):
If vlog-align-do-align-with-indent is t, than emacs will do alignment along
with indentation; If it is nil, you have to do it with C-c SPC.
** vlog-align-normal-comment-column (default value is 48):
The column number of comments in module port list.
module my_mod (
in_port, // my comments...
in_port2, // my comments...
out_port, // my comments...
48
......
** vlog-align-mod-inst-stop-list (default value is '(24 44)):
Stop list of module instantiation line alignment.
For example, if you want to align your codes like this:
m_ff_ce #(1,1'b0) u_ff_my (
.i_clk (my_clk), // comments...
16 32
.i_reset_b (my_reste_b), // comments...
Then you can set me to '(16 32).
** vlog-align-declaration-stop-list (default value is '(10 18 30 32 48)):
Stop list of declaration line alignment.
For example, if you want to align your codes like this:
reg [31:0] my_reg; // comments...
wire [31:0] my_wire = my_reg; // comments...
parameter [31:0] my_param = para_value; // comments...
10 18 30 34 48
Then you can set me to '(10 18 30 34 48).
* Electrics
** Try to type "reg 32" and then type a space.
** Try to type "10" and then type "b" or "h".
** Type "begin" and then <Return>.
* Signals
** Move cursor onto a signal or macro, and then press F1.
** When typing inside an always block, Try M-s.
** Try to type double commas (",,"), Emacs will expand it into "<=".
** To trace current signal's driver in current buffer, Try C-c C-d and C-c C-n.
* Skeletons
** Try C-c C-c C-a and C-c C-c a
** Try C-c C-h to insert a header for current file.
* Auto sense
** Add "// auto sense //" before an always block, and then try C-c C-a.
vlog-mode will complete the sensitive list for you. Set these variables to
tune its bahavior:
vlog-auto-sense-abandon-old-list, vlog-auto-sense-refill-old-list.