forked from matbonora/prelude
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverilog-mode.el
48 lines (43 loc) · 2.51 KB
/
verilog-mode.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;;; Verilog mode configuration file for verilog mode-line
;;; https://www.reddit.com/r/emacs/comments/4cjt2z/about_verilogmode_i_need_someone_help/
(with-eval-after-load 'verilog-mode
(defvar modi/verilog-eda-vendor "cadence" ; "xyz"
"EDA vendor tools to use for verilog/SV compilation, simulation, etc.")
(defvar modi/verilog-cadence-linter '("irun" "-hal")
"Verilog/SV linting command using Cadence.")
(defvar modi/verilog-cadence-compiler '("irun" "-compile")
"Verilog/SV compilation command using Cadence.")
(defvar modi/verilog-cadence-simulator '("irun" "-access" "rwc")
"Verilog/SV simulation command using Cadence.")
(defvar modi/verilog-xyz-linter '("these" "need" "to" "be" "defined")
"Verilog/SV linting command using Xyz.")
(defvar modi/verilog-xyz-compiler '("these" "need" "to" "be" "defined")
"Verilog/SV compilation command using Xyz.")
(defvar modi/verilog-xyz-simulator '("these" "need" "to" "be" "defined")
"Verilog/SV simulation command using Xyz.")
;; (setq verilog-tool 'verilog-linter)
(setq verilog-tool 'verilog-compiler)
;; (setq verilog-tool 'verilog-simulator)
(defun modi/verilog-tool-setup ()
"Set up for running verilog/SV compilation, simulation, etc.
This function needs to be run in `verilog-mode-hook'."
(let* ((vendor-linter (symbol-value (intern (concat "modi/verilog-"
modi/verilog-eda-vendor
"-linter"))))
(cmd-linter (mapconcat 'identity vendor-linter " "))
(vendor-compiler (symbol-value (intern (concat "modi/verilog-"
modi/verilog-eda-vendor
"-compiler"))))
(cmd-compiler (mapconcat 'identity vendor-compiler " "))
(vendor-simulator (symbol-value (intern (concat "modi/verilog-"
modi/verilog-eda-vendor
"-simulator"))))
(cmd-simulator (mapconcat 'identity vendor-simulator " ")))
(when (executable-find (car vendor-linter))
(setq verilog-linter cmd-linter))
(when (executable-find (car vendor-compiler))
(setq verilog-compiler cmd-compiler))
(when (executable-find (car vendor-simulator))
(setq verilog-simulator cmd-simulator)))
(verilog-set-compile-command))
(add-hook 'verilog-mode-hook #'modi/verilog-tool-setup))