Skip to content

andrewpeck/hog-emacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hog Emacs

A collection of functions for working with Hog (https://hog.readthedocs.io) projects from emacs.

hog-open-projectOpen a Hog project in Vivado
hog-launch-implLaunch Implementation
hog-launch-synthesisLaunch Synthesis
hog-launch-workflowLaunch Full Workflow
hog-follow-link-at-pointFollow a link in a Hog src file
hog-expand-glob-at-pointExpand 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.

doc/hog-src-mode.png

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)

About

HOG extensions for emacs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published