3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Verilog書きのvscode移行 (Emacsからvscodeへ)

Last updated at Posted at 2025-12-11

今年の初め、AI Agentの波に押されて、長年使い続けていたEmacsからVSCodeへ移行しました。
EmacsからVSCodeへの移行で唯一の障壁となっていたのは、verilog-modeの存在でした。

verilog-modeは非常に優れたツールであり、インスタンス接続の自動化によって接続ミスをほぼゼロにでき、信号が途中で増減してもコマンドを実行するだけで自動的に追従してくれます。

verilog-modeがないと何もできないため、拡張機能を自作することでこの問題を乗り越えました。

verilog-mode-wrapper

この拡張の最大の利点は、Emacsのverilog-modeがそのまま実行できるため、動作が全く同じであることです。

verilog-modeの主な機能は以下に対応しています。

verilog-batch-auto

AUTOマクロを展開し、インスタンスや信号の自動接続を行います。

verilog-batch-delete

AUTO生成部分を削除します。

verilog-batch-diff-auto

(追加したけど意味がないかも)

verilog-batch-inject-auto

(追加したけど意味がないかも)

verilog-batch-indent

コードのインデントを自動整形します。

verilog-batch-delete-trailing-whitespace

行末の不要な空白を削除します。

verilog-pretty-declarations

宣言部分を整形します。

verilog-pretty-expr

式部分を整形します。

verilog-expand-vector

ベクタの展開を行います。

verilog-label-be

begin-endブロックにラベルを付与します。

verilog-auto-star-implicit

SystemVerilogの.*ポート接続を自動展開します。

eval args

引数を追加することでverilog-modeの動作を制御できます。  
Emacsで使っていた設定をそのまま記述すれば問題ありません。

```
# 初期値
"verilog-indent-level": 3,
"verilog-indent-level-module": 3,
"verilog-indent-level-declaration": 3,
"verilog-indent-level-behavioral": 3,
"verilog-indent-level-directive": 1,
"verilog-auto-inst-param-value": "nil",
"verilog-case-indent": 2,
"verilog-cexp-indent": 1,
"verilog-auto-lineup": "'declarations",
"verilog-auto-endcomments": "t",
"indent-tabs-mode": "t",
"verilog-minimum-comment-distance": 10
 ```

キー入力を伴うverilog-modeの機能はあきらめています。(もともとほぼ使わない)
ショートカットは割り当てていないので、自分好みのショートカットに割り当てて使用します。

vscodeはマウス操作を強制されるのが使いづらく、ストレスがたまりますがあきらめて使っていこうと思います。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?