04-18-2020, 01:42 PM
Hi sake,
I'm personally using a heavily customized version of emacs called spacemacs ( https://www.spacemacs.org) a community managed .emacs.d customization. Although their homepage says that it is focused on using VIM keybindings in Emacs you can also use normal emacs keybinding and profit from all the nice customizations for a plethora of programming languages and other applications. Just to clarify Spacemacs is not a different program. Its just a huge (some people might argue to bloated) set of customization for normal emacs to make it look and feel more like an editor of the 21st century.
You find my personal customization file on Github:
https://github.com/meggiman/iis-spacemacs-config
This customization uses emacs keybindings instead of the VIM ones that Spacemacs would normally use.
This configuration maps the global leader key of Spacemacs (SPACE) to (M-m).
Among various other personal customizations, there are a bunch of useful additions specifically for HDL development in SystemVerilog. Most of them where added to make it easier for me to navigate through the huge RTL code base of PULPissimo that can be quite intimidating in the beginning.
If you are somewhat experienced using emacs and willing to give it a try here are some features and tricks on how to use the customization effectively to make your life easier when exploring the PULPissimo codebase or when developing SystemVerilog in general. For me at least they gave a huge efficiency boost when exploring new HDL (or other languages) codebases:
Greetings,
Manuel
I'm personally using a heavily customized version of emacs called spacemacs ( https://www.spacemacs.org) a community managed .emacs.d customization. Although their homepage says that it is focused on using VIM keybindings in Emacs you can also use normal emacs keybinding and profit from all the nice customizations for a plethora of programming languages and other applications. Just to clarify Spacemacs is not a different program. Its just a huge (some people might argue to bloated) set of customization for normal emacs to make it look and feel more like an editor of the 21st century.
You find my personal customization file on Github:
https://github.com/meggiman/iis-spacemacs-config
This customization uses emacs keybindings instead of the VIM ones that Spacemacs would normally use.
This configuration maps the global leader key of Spacemacs (SPACE) to (M-m).
Among various other personal customizations, there are a bunch of useful additions specifically for HDL development in SystemVerilog. Most of them where added to make it easier for me to navigate through the huge RTL code base of PULPissimo that can be quite intimidating in the beginning.
If you are somewhat experienced using emacs and willing to give it a try here are some features and tricks on how to use the customization effectively to make your life easier when exploring the PULPissimo codebase or when developing SystemVerilog in general. For me at least they gave a huge efficiency boost when exploring new HDL (or other languages) codebases:
- The emacs auto-completion framework 'company' is enabled by default. While the auto-completion engine for SystemVerilog is not very smart (due to the lack of a deeper language understanding) it gives a reasonable performance boost while editing HDL sourcecode.
- In order to insert live templates (e.g. to quickly create a new module) there are various yasnipped SystemVerilog templates installed that you can insert using the Spacemacs Shortcut <M-m i s>
- If Questasim is installed on the system where you open emacs, questasim vlog is automatically invoked by emacs to parse your source code in the background and provide you Syntax Highlighting in realtime while you are editing (i.e. marking syntax in red). (This is enabled by a custom flycheck parser for Questasim that I developed)
- For 'jump to definition' my customization uses GNU Global to generate GTAGS for SystemVerilog. For this to work you have to install universal-ctags (a modern implementation of CTAGS that also supports SystemVerilog) https://github.com/universal-ctags/ctags. And you have to install GNU Global. Then you can generate GTAGS for the complete project with the shortcut <M-m m G> selecting the root directory of your project and using 'new-ctags' as the GTAGS LABEL when asked by Emacs. Afterwards you can jump to definition by e.g. moving your cursor to a module name and pressing <M-.>. You find more detailed installation instructions on https://github.com/syl20bnr/spacemacs/tr...tags/gtags (however configure GNU global with the following command instead after you install universal-ctags: ./configure --with-universal-ctags=/bin/ctags-universal)
- To quickly find references and declarations of signal names within the same file I found using the helm-swoop command (<M-m s S>) to be a game-changer! Helm-swoop is an 'isearch' alternative on steroids. You can press <C-c C-e> while in the helm-swoop menu to open a writable results buffer where you can modify all string occurences found simultaneously using e.g. the multiple cursors package <M-m s m m> or iedit-mode <M-m s e>.
- To search a signal name recursively in a directory, hit <C-x C-f> to open the interactive helm-find file menu, navigate to the directory where you want to search for all occurences of the String (e.g. a signal name) and then, still in the helm menu, hit <C-u C-s> select the filetypes you want to search in (or type * to search in all files) and start entering your string. This will interactively invoke recursive GREP to allow fuzzy searching within all files of a directory. You can even batch modify all the search results (e.g. if you want to globaly change the name of some signal) by pressing <C-x C-s> followed by <C-c C-p>. This will open a temporary buffer with all results of your GREP search that is editable. Whatever you change in this buffer e.g. replacing all occurrences of the string with a different one will be written back to all the original files as soon you hit C-x C-s (use C-c C-k to abbot the change). However, be aware that this doesn't save the changes to the files yet but just opens them and modifies the coresponding buffers. You still have to save those buffers in emacs first before the modifications are actually written to disk.
Greetings,
Manuel