diff --git a/doom/.config/doom/config.el b/doom/.config/doom/config.el index bc3bce4..89d7aa3 100644 --- a/doom/.config/doom/config.el +++ b/doom/.config/doom/config.el @@ -107,7 +107,9 @@ (add-to-list 'exec-path "~/.local/bin") (setenv "PATH" (concat (getenv "PATH") ":/home/" (user-login-name) "/.local/bin")) +;; --- Verilog / SystemVerilog --- (after! verilog-mode + ;; Indentation (setq verilog-indent-level 4 verilog-indent-level-module 4 verilog-indent-level-declaration 4 @@ -116,11 +118,30 @@ verilog-cexp-indent 4 verilog-auto-newline nil) - (setq lsp-clients-verilog-ls-server 'verible-verilog-ls) + ;; verilog-ext: enhanced SystemVerilog support (tree-sitter, navigation, highlighting) + (when (featurep 'verilog-ext) + (verilog-ext-mode-setup)) -;; Ensure all buffers use 4 spaces and no literal tabs + ;; flycheck-verilator: custom checker for Verilator linting + (when (featurep 'flycheck) + (flycheck-define-checker verilog-verilator + "A Verilog/SystemVerilog syntax checker using Verilator." + :command ("verilator" "--lint-only" "-Wall" "-Wno-DECLFILENAME" + "--language" "1800-2017" source-original) + :error-patterns + ((error line-start "%Error" (optional "-" (one-or-more (any alpha ?_))) + ": " (file-name) ":" line ":" column ": " (message) line-end) + (warning line-start "%Warning" (optional "-" (one-or-more (any alpha ?_))) + ": " (file-name) ":" line ":" column ": " (message) line-end)) + :modes (verilog-mode verilog-ts-mode)) + (add-to-list 'flycheck-checkers 'verilog-verilator t)) + + ;; Verilator compile command for quick syntax/lint checks (M-x compile) + (setq compile-command "verilator --lint-only -Wall --language 1800-2017 ")) + +;; Global: 4 spaces, no tabs (setq-default tab-width 4 - indent-tabs-mode nil)) + indent-tabs-mode nil) ;; --- Chisel / Scala --- (after! scala-mode @@ -132,10 +153,9 @@ (setq lsp-metals-server-args '("-J-Dmetals.http=on-Dmetals.at-least-java-21=true") lsp-metals-enable-http t)) -(after! lsp-verilog - (setq lsp-verilog-server 'verible-ls) - ;; Optional: specify the path if it's not in your standard PATH - (setq lsp-clients-verible-ls-executable "/usr/local/bin/verible-verilog-ls")) +;; Verible LSP: Eglot picks it up automatically from PATH. +;; The default Doom Eglot config registers verible-verilog-ls for verilog-mode. +;; No extra config needed — just ensure verible-verilog-ls is on PATH. (map! :leader (:prefix ("o" . "open") diff --git a/doom/.config/doom/init.el b/doom/.config/doom/init.el index a50bb99..eec1a8b 100644 --- a/doom/.config/doom/init.el +++ b/doom/.config/doom/init.el @@ -108,7 +108,7 @@ hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW pdf ; pdf enhancements ;;terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux - (tree-sitter +python +rust +c +cc +verilog) + (tree-sitter +python +rust +c +cc +zig +verilog) ;;upload ; map local to remote projects via ssh/ftp :os @@ -180,7 +180,7 @@ hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;terra ; Earth and Moon in alignment for performance. ;;web ; the tubes ;;yaml ; JSON, but readable - zig ; C, but simpler + (zig +lsp +tree-sitter) ; C, but simpler (verilog +lsp) :email diff --git a/doom/.config/doom/packages.el b/doom/.config/doom/packages.el index d2680fe..756cba4 100644 --- a/doom/.config/doom/packages.el +++ b/doom/.config/doom/packages.el @@ -52,3 +52,7 @@ ;; (unpin! pinned-package another-pinned-package) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) ;; (unpin! t) + + +;; --- Verilog / SystemVerilog --- +(package! verilog-ext)