| Ryusai's Homepage |
| トップページ > LinuxでEDA > Verilog mode > Verilog modeの機能 |
Verilog mode for Emacs (1/2)Verilog mode は Emacs の Verilog HDL のプログラミング向けのモードで、Verilog の構文を理解して Verilog modeのインストール
実行例1
$ gunzip verilog-mode.el.gz
ホームディレクトリに elisp ディレクトリを作成し、そこに解凍された verilog-mode.el をおきます(実行例 2)。 実行例2
.emacs ファイルの編集を行い、以下の記述を追加します(リスト 1)。 リスト1
(defun prepend-path ( my-path )
(setq load-path (cons (expand-file-name my-path) load-path)))
(defun append-path ( my-path )
(setq load-path (append load-path (list (expand-file-name my-path)))))
;;Lood first in the directory ~/elisp for elisp files
(prepend-path "~/elisp")
;;Load verilog-mode only when needed
(autoload 'verilog-mode "verilog-mode" "Verilog mode"
t )
;; Any files that end in .v should be in verilog mode
(setq auto-mode-alist (cons '("\\.v\\'" . verilog-mode) auto-mode-alist))
;; Any files in verilog mode shuold have their keywords colorized
(add-hook 'verilog-mode-hook '(lambda () (font-look-mode 1)))
また、ソースを共有する場合、TAB の文字数は各人でことなっていることがしばしばありますので、TAB を space に変換しておくと良いでしょう。その為に以下の記述を .emacs に追加します(リスト 2)。 リスト2
(add-hook 'verilog-mode-hook '(lambda ()
(add-hook 'local-write-file-hooks (lambda() (untabify (point-min) (point-max)))))) |
| | サイトマップ | このサイトについて | お問い合わせ | エンジニアの転職 | |
| Copyright (C) 2006-2009 Ryusai's Homepage All rights reserved |