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

View File

@ -1,3 +1,22 @@
(add-hook 'verilog-mode-hook '(lambda () (add-hook 'verilog-mode-hook '(lambda ()
(add-hook 'local-write-file-hooks (lambda() (add-hook 'local-write-file-hooks (lambda()
(untabify (point-min) (point-max)))))) (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))