verilog: Add more options for verilog-mode.el

Signed-off-by: Andrew Andrianov <andrew@ncrmnt.org>
This commit is contained in:
Andrew Andrianov 2018-02-12 16:07:51 +03:00
parent 6db872294e
commit 5bcb09d340
2 changed files with 48 additions and 29 deletions

View File

@ -1,33 +1,33 @@
// Testbench
module test;
reg clk;
reg reset;
reg d;
wire q;
wire qb;
// Instantiate design under test
dff DFF(.clk(clk), .reset(reset),
.d(d), .q(q), .qb(qb));
reg clk;
reg reset;
reg d;
wire q;
wire qb;
// Instantiate design under test
dff DFF(.clk(clk), .reset(reset),
.d(d), .q(q), .qb(qb));
initial begin
// Dump waves
$dumpfile("dump.vcd");
$dumpvars(1);
$display("Reset flop.");
clk = 0;
reset = 1;
d = 1'bx;
display;
$display("Release reset.");
d = 1;
reset = 0;
display;
$display("Toggle clk.");
clk = 1;
display;
end
task display;
#1 $display("d:%0h, q:%0h, qb:%0h",
d, q, qb);
endtask
initial begin
// Dump waves
$dumpfile("dump.vcd");
$dumpvars(1);
$display("Reset flop.");
clk = 0;
reset = 1;
d = 1'bx;
display;
$display("Release reset.");
d = 1;
reset = 0;
display;
$display("Toggle clk.");
clk = 1;
display;
end
task display;
#1 $display("d:%0h, q:%0h, qb:%0h",
d, q, qb);
endtask
endmodule

View File

@ -1,3 +1,22 @@
(add-hook 'verilog-mode-hook '(lambda ()
(add-hook 'local-write-file-hooks (lambda()
(untabify (point-min) (point-max))))))
(custom-set-variables
'(verilog-align-ifelse t)
'(verilog-auto-delete-trailing-whitespace t)
'(verilog-auto-inst-param-value t)
'(verilog-auto-inst-vector nil)
'(verilog-auto-lineup (quote all))
'(verilog-auto-newline nil)
'(verilog-auto-save-policy nil)
'(verilog-auto-template-warn-unused t)
'(verilog-case-indent 2)
'(verilog-cexp-indent 2)
'(verilog-highlight-grouping-keywords t)
'(verilog-highlight-modules t)
'(verilog-indent-level 2)
'(verilog-indent-level-behavioral 2)
'(verilog-indent-level-declaration 2)
'(verilog-indent-level-module 2)
'(verilog-tab-to-comment t))