A collection of functions for working with Hog (https://hog.readthedocs.io) projects from emacs.
hog-open-project | Open a Hog project in Vivado |
hog-launch-impl | Launch Implementation |
hog-launch-synthesis | Launch Synthesis |
hog-launch-workflow | Launch Full Workflow |
hog-follow-link-at-point | Follow a link in a Hog src file |
hog-expand-glob-at-point | Expand a “*” glob in a Hog src file |
It also includes facilities for creating configuration files from Hog projects for various HDL language servers:
hog-vhdl-ls-create-project-toml
hog-ghdl-ls-create-project-json
hog-vhdl-tool-create-project-yaml
Additionally, hog-emacs now supports insertion of Vivado templates. They are scrubbed from the XML source found in your vivado path.
hog-insert-vhdl-template
hog-insert-verilog-template
hog-insert-systemverilog-template
hog-insert-xdc-template
Some miscellaneous functions are included as well:
hog-clean-vivado-xci
: cleans the output products associated with Vivado XCI files
This package also includes a major mode which provides syntax highlighting for Hog source files, and enables the M-RET key to follow files as links.
With flycheck installed it will also provide error indicators for files with broken links.
You should customize these variables to your liking, e.g.
(setq hog-vivado-path "/opt/Xilinx/Vivado/2020.2"
hog-number-of-jobs 4
hog-template-cache-dir "~/.emacs.d/")
Configuration variables can be set on a per-project basis, e.g. by adding the following to .dir-locals.el
.
((nil . ((hog-vivado-path . "/storage/Xilinx/Vivado/2020.1"))))
To have flycheck integration please add the following snippet to your configuration.
(flycheck-define-checker
hog-src-checker
"Checker for Hog source files"
:command ("emacs" (eval flycheck-emacs-args)
"--load" (eval (file-name-sans-extension (locate-library "hog")))
"--visit" source-inplace
"-f" "hog-check-src-file")
:error-patterns
((error line-start "Error:" line " " (message) line-end)
(info line-start "Info:" line " " (message) line-end)
(warning line-start "Warning:" line " " (message) line-end))
:modes (hog-src-mode))
(add-to-list 'flycheck-checkers 'hog-src-checker)