Giter VIP home page Giter VIP logo

vim-hdl's Introduction

vim-hdl

May I have your attention please?

HDL Checker implements the core functionality of vim-hdl and because it now supports Language Server Protocol, vim-hdl is being deprecated

How to continue using HDL Checker

Any LSP client should work, be it on Vim or other editors.

Have a look at HDL Checker supported editors to check some examples of how to set it up.

But I want to keep using Syntastic!

You'll need to install HDL Checker pip package:

pip install hdl-checker --upgrade

or

pip install hdl-checker --upgrade --user

Just make sure you can run hdl_checker --version and it should work just fine.

Rationale

Back when vim-hdl started, Vim did not have the widespread support for LSP it has today and with it I can actually focus in the core functionality and support more platforms at the same time. This last update is likely the last one!


Build Status codecov Join the chat at https://gitter.im/suoto/vim-hdl Analytics

vim-hdl is a Vim plugin that uses HDL Checker to provide some helpers to VHDL development:


vim-hdl screenshot


Installation

cd ~/.vim/bundle/
git clone https://github.com/suoto/vim-hdl.git

In your .vimrc:

Plugin 'suoto/vim-hdl'

Notes

  • Requires Vim compiled with Python support, plus features needed by Syntastic itself
  • Only tested on Linux with recent Vim versions (7.4+)

Usage

vim-hdl requires a configuration file listing libraries, source files, build flags, etc. Select the configuration file via

" Configure the project file
let g:vimhdl_conf_file = '<config/file>'

You use the VimhdlCreateProjectFile command to search and help you setting up the configuration file

:VimhdlCreateProjectFile <optional/path/to/files>

See the wiki for details on how to write it.

Any other Syntastic option should work as well.

You can clone vim-hdl-examples repository and try a ready to use setup.


Supported third-party compilers


Style checking

Style checks are independent of a third-party compiler. Checking includes:

  • Signal names in lower case
  • Constants and generics in upper case
  • Unused signals, constants, generics, shared variables, libraries, types and attributes
  • Comment tags (FIXME, TODO, XXX)

Notice that currently the unused reports has caveats, namely declarations with the same name inherited from a component, function, procedure, etc. In the following example, the signal rdy won't be reported as unused in spite of the fact it is not used.

signal rdy, refclk, rst : std_logic;
...

idelay_ctrl_u : idelay_ctrl
    port map (rdy    => open,
              refclk => refclk,
              rst    => rst);

Issues

  • vim-hdl issue tracker should be used for bugs, feature requests, etc related to the Vim client itself (something that only happens with Vim)
  • HDL Checker issue tracker should be used for bugs, feature requests, etc related to the code checker backend.

If unsure, use vim-hdl issue tracker, it will be moved to HDL Checker issue tracker if applicable.

License

This software is licensed under the GPL v3 license.

Notice

Mentor Graphics®, ModelSim® and their respective logos are trademarks or registered trademarks of Mentor Graphics, Inc.

Altera® and its logo is a trademark or registered trademark of Altera Corporation.

Xilinx® and its logo is a trademark or registered trademark of Xilinx, Inc.

vim-hdl's author has no connection or affiliation to any of the trademarks mentioned or used by this software.

vim-hdl's People

Contributors

suoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-hdl's Issues

Ale compatibility?

Hi there! Thanks for making this awesome tool. I see integration with Syntastic is possible, but what about ale? Is this currently possible?

No handlers could be found for logger "vimhdl.vim_client"

I have installed ghdl and vundle, and then vim-hdl and syntastic. So far tags and syntax are properly highlighted, and errors are reported as expected running SyntasticCheck (or just modifying and saving files). But each time I open an vhd file with vim, this message appears:

Error detected while processing BufEnter Auto commands for "*.vhd":
No handlers could be found for logger "vimhdl.vim_client"
Press ENTER or type command to continue

I'm using vim 7.4 on up-to-date ArchLinux.

hdlcc server isn't starting

When starting vim I get following error:
Error detected while processing function vimhdl#setup..<SNR>73_Pyeval: line 2: Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/abyszuk/.vim/bundle/vim-hdl/python/vimhdl/vim_client.py", line 87, in startServer self._waitForServerSetup() File "/home/abyszuk/.vim/bundle/vim-hdl/python/vimhdl/vim_client.py", line 162, in _waitForServerSetup reply = request.sendRequest() File "/home/abyszuk/.vim/bundle/vim-hdl/python/vimhdl/base_requests.py", line 89, in sendRequest requests.packages.urllib3.exceptions.NewConnectionError) as exc: AttributeError: 'module' object has no attribute 'NewConnectionError' E858: Eval did not return a valid python object

I use quite standard install of CentOs 7. Python version 3.3

Project file wishlist

Some nice to haves:

  • Support for wildcards on paths
  • Support for escaping line breaks
  • Syntax checker for the project file (big maybe...)

Windows support

Hi, vim-hdl tool seems to be perfect and I am very excited to try it. When starting vim with a vhd file, following error is reported.

Error detected while processing function vimhdl#setup[10]..59_startServer[6]..59_pyEval:
line 4:
Traceback (most recent call last):
File "", line 1, in
File "D:\programs\gVimPortable\App\vim\plugins\vim-hdl-master\python\vimhdl\vim_client.py", line 100, in startServer
self._startServerProcess()
...
...
...

My setup is as follows:

  • Windows,
  • python3.7 64 bits.
  • No internet connection

I installed hdlcc package to python. In anaconda prompt, when hdlcc is run, hdlcc server starts to run.

To install vim-hdl, the zip file of the repository is extracted and the following code is added to vimrc.

set runtimepath+=$VIM\plugins\vim-hdl-master

I checked previous issues and realized that there was no Windows support (by March 26,2018).

My questions are

  • Is there a support for windows now?
  • If yes, what would you suggest me to solve it?

Thank you for your time.

Error when opening a VHDL source after running via hdlcc/runner.py

Given a configured project and a project file named project.prj, the steps to reproduce are

  1. Build the project with hdlcc/runner.py

    runner.py <path/to/project/file> --clean --build

  2. Wait for the build to finish. There should be a filename called
    .project.prj, which is the cached info of the project file

  3. Launching Vim and to a source inside the project gives the following error

$ vim <path/to/source>
Vim: Caught deadly signal SEGV
  File
  "<path/to/vim-hdl>/autoload/../dependencies/hdlcc/hdlcc/project_builder.py",
  line 287, in _recoverCacheVim: Finished.

      cache = pickle.load(open(cache_fname, 'r'))
      AttributeError: 'module' object has no attribute
      'StandaloneProjectBuilder'
      Segmentation fault

Error is slightly different if the file is opened with gVim

$ gvim <path/to/source>
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been
called
[xcb] Aborting, sorry about that.
vim: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion
`!xcb_xlib_unknown_req_in_deq' failed.
Vim: Caught deadly signal ABRT

Write vim-hdl help

Brainstorm of topics:

  • g:vimhdl_conf_file, b:vimhdl_conf_file
  • vimhdl sorting method
  • Version
  • Debug info

Trying to jump to line with error via quickfix yields E926

Selecting the quickfix and pressing Enter to jump to the problematic line yields E926.

From Vim help:

*E925* *E926*
If the current quickfix or location list was changed by an |autocommand| while
processing a quickfix or location list command, it will be aborted.

Allow building files while setup runs in background

When Vim is opened, vim_client.VimhdlClient.setup is run in a thread and calls to vim_client.VimhdlClient.buildByPath are locked until setup completes.

  • Implement a database inside project_builder.ProjectBuilder, taking into account errors (currently this is ignored)
  • Allow vim_client.VimhdlClient.buildByPath to be run while vim_client.VimhdlClient.buildByDependency is active
  • Shell calls called by compilers.base_compiler.BaseCompiler must be queued to avoid consistency errors by the compiler (it may not handle multiple threads accessing its internal DB)

Expected result:

  • Open Vim with nothing built (this will trigger background build)
  • While the build is running, build the current file
    • If dependencies have already been built, build it
    • If dependencies haven't been built, warn the user (don't wait until dependencies are met)

hdlcc server unavailable at start

I loaded syntastic and vim-hdl using native method of vim, and try to get the vim-hdl-examples/msim.prj running.

My .vimrc includes:

" Syntastic recommended settings                                                 
set statusline+=%#warningmsg#                                                    
set statusline+=%{SyntasticStatuslineFlag()}                                     
set statusline+=%*                                                               
                                                                                 
let g:syntastic_always_populate_loc_list = 1                                     
let g:syntastic_auto_loc_list = 1                                                
let g:syntastic_check_on_open = 1                                                
let g:syntastic_check_on_wq = 0

" vim-hdl
let g:vimhdl_conf_file = '/home/user/vim-hdl-examples/msim.prj'
let g:syntastic_vhdl_checkers = ['vimhdl']

When I open the file vim-hdl-examples/another-library/foo.vhd , I get the following error output:

Error detected while processing CursorMoved Auto commands for "*.vhd":
Traceback (most recent call last):
Error detected while processing CursorMoved Auto commands for "*.vhd":
  File "<string>", line 1, in <module>
Error detected while processing CursorMoved Auto commands for "*.vhd":
  File "/home/user/.vim/pack/my-plugins/start/vim-hdl/python/vimhdl/vim_client.py", line 272, in requestUiMessages
Error detected while processing CursorMoved Auto commands for "*.vhd":
    if not self._isServerAlive():
Error detected while processing CursorMoved Auto commands for "*.vhd":
  File "/home/user/.vim/pack/my-plugins/start/vim-hdl/python/vimhdl/vim_client.py", line 113, in _isServerAlive
Error detected while processing CursorMoved Auto commands for "*.vhd":
    is_alive = self._server.poll() is None
Error detected while processing CursorMoved Auto commands for "*.vhd":
AttributeError: 'NoneType' object has no attribute 'poll'

When I run hdlcc standalone, I do not get any errors.

Make compiler built in libraries dynamic

Built-in libraries are statically defined, which means that things will break on different environments. We can either use the compiler to get them somehow or create an option for the user to set manually. Using the compiler is the preferred approach.

Location list not populated on large files

Tested with grlib lib/tech/ec/orca/orca.vhd and even after the project builds fine, there is nothing on the location list.

hdlcc logs look fine, but since the file is large (27k lines), the hdlcc client is probably timing out.

The client might need to continue in background if a timeout occurs, but the location list can only be updated synchronously. At least the user should be warned when a timeout occurs

Cannot call python3 executable by default in Windows

The official distribution of Python 3 for Windows has the executable name python instead of python3. Normally vim can work with it, and echo has("python3") returns 1. But it will cause a FileNotFoundError in this plugin. Changing the executable of Python to python3 can solve this problem.

I am having trouble with the setup

I get the following error

"vimhdl.vim" 201L, 7227C
Error detected while processing function vimhdl#setup..<SNR>44_setupPython:
line   32:
Traceback (most recent call last):
  File "<string>", line 9, in <module>
AttributeError: 'module' object has no attribute 'NullHandler'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.