Package: hdl-checker
HDL CheckerHDL Checker is a language server that wraps VHDL/Verilg/SystemVerilog tools that
aims to reduce the boilerplate code needed to set things up. It supportsLanguage Server Protocolor a custom HTTP interface; can infer library
VHDL files likely belong to, besides working out mixed language dependencies,
compilation order, interpreting some compilers messages and providing some
(limited) static checks.InstallationEditor supportVS CodeVim/NeoVimEmacsUsageThird-party toolsConfiguring HDL CheckerLSP serverHTTP serverTestingSupported systemsStyle checkingIssuesLicenseInstallationpipinstallhdl-checker--upgradeorpipinstallhdl-checker--user--upgradeNote:Make sure you can runhdl_checker --version, especially if using PIP
with the--useroption.Editor supportVS CodeInstall theHDL Checker VSCode clienton VS Code.Vim/NeoVimUsingdense-analysis/aleALE supports HDL Checker out of the box.Usingcoc.nvimFollowingcoc.nvim custom language server setup, add
this to yourcoc.nvim configuration file:{"languageserver":{"hdlChecker":{"command":"hdl_checker","args":["--lsp"],"filetypes":["vhdl","verilog","systemverilog"]}}}Using NeoVim's native language serverThis requiresnvim-lspconfig.lua<<EOFlocallspconfig=require'lspconfig'-- Only define onceifnotlspconfig.hdl_checkerthenrequire'lspconfig/configs'.hdl_checker={default_config={cmd={"hdl_checker","--lsp",};filetypes={"vhdl","verilog","systemverilog"};root_dir=function(fname)-- will look for a parent directory with a .git directory. If none, just-- use the current directoryreturnlspconfig.util.find_git_ancestor(fname)orlspconfig.util.path.dirname(fname)-- or (not both)-- Will look for the .hdl_checker.config file in a parent directory. If-- none, will use the current directoryreturnlspconfig.util.root_pattern('.hdl_checker.config')(fname)orlspconfig.util.path.dirname(fname)end;settings={};};}endlspconfig.hdl_checker.setup()EOFUsingautozimu/LanguageClient-neovimAdd HDL Checker to the server commands:let g:LanguageClient_serverCommands = {
\   'vhdl': ['hdl_checker', '--lsp'],
\   'verilog': ['hdl_checker', '--lsp'],
\   'systemverilog': ['hdl_checker', '--lsp'],
\}Please note that this will start one server per languageEmacsUsingemacs-lsp/lsp-modeAdd this to your Emacs config file(require'use-package)(setqlsp-vhdl-server-path"~/.local/bin/hdl_checker"); only needed if hdl_checker is not already on the PATH(custom-set-variables'(lsp-vhdl-server'hdl-checker))(use-packagelsp-mode:config(add-hook'vhdl-mode-hook'lsp))UsageHDL Checker server can be started viahdl_checkercommand. Usehdl_checker --helpfor more info on how to use it.$hdl_checker-h
usage:hdl_checker[-h][--hostHOST][--portPORT][--lsp][--attach-to-pidATTACH_TO_PID][--log-levelLOG_LEVEL][--log-streamLOG_STREAM][--stdoutSTDOUT][--stderrSTDERR][--version]optionalarguments:-h,--helpshowthishelpmessageandexit--hostHOST[HTTP]Hosttoserve--portPORT[HTTP]Porttoserve--lspStartstheserverinLSPmode.Defaultstofalse--attach-to-pidATTACH_TO_PID[HTTP,LSP]StopstheserverifgivenPIDisnotactive--log-levelLOG_LEVEL[HTTP,LSP]Logginglevel--log-streamLOG_STREAM[HTTP,LSP]Logfile,defaultstostdoutwheninHTTPoratemporaryfilenamedhdl_checker_log_pid<PID>.logwheninLSPmode--stdoutSTDOUT[HTTP]Filetoredirectstdoutto.Defaultstoatemporaryfilenamedhdl_checker_stdout_pid<PID>.log--stderrSTDERR[HTTP]Filetoredirectstdoutto.Defaultstoatemporaryfilenamedhdl_checker_stderr_pid<PID>.log--version,-VPrintshdl_checkerversionandexitThird-party toolsHDL Checker supportsMentor ModelSimModelSim Intel FPGA EditionGHDLVivado Simulator(bundled withXilinx
Vivado)Configuring HDL CheckerSee theSetting up a new projectsection on the wiki.LSP serverHDL Checker has beta support forLanguage Server Protocol. To start in LSP
mode:hdl_checker--lspOn a Linux system, log file will be at/tmp/hdl_checker_log_pid<PID_NUMBER>.logand/tmp/hdl_checker_stderr_pid<PID_NUMBER>.log.As a language server, HDL Checker will provideDiagnosticsHover informationDependencies: will report which path and library have been assignedDesign units: will report the compilation sequence and librariesGo to definition of dependenciesHTTP serverHDL Checker can be used in HTTP server mode also:hdl_checkerPlease note that this modedoes not use LSP over http to communicate.
Request/response API is not yet available and is going to be deprecated in the
future. A reference implementation can be found invim-hdlTestingHDL Checker uses adockercontainer to run tests. If you wish to run
them, clone this repository and on the root folder run./run_tests.shThe container used for testing issuoto/hdl_checker_testSupported systemsSystemCICI statusLinuxYesWindowsYesStyle checkingStyle checks are independent of a third-party compiler. Checking includes:Unused signals, constants, generics, shared variables, libraries, types and
attributesComment 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 signalrdywon't be reported as unused in spite of the
fact it is not used.signalrdy,refclk,rst:std_logic;...idelay_ctrl_u:idelay_ctrlportmap(rdy=>open,refclk=>refclk,rst=>rst);IssuesYou can use theissue trackerfor bugs, feature request and so
on.LicenseThis software is licensed under theGPL v3 license.NoticeMentor Graphics®, ModelSim® and their respective logos are trademarks or
registered trademarks of Mentor Graphics, Inc.Intel® and its logo is a trademark or registered trademark of Intel Corporation.Xilinx® and its logo is a trademark or registered trademark of Xilinx, Inc.HDL Checker's author has no connection or affiliation to any of the trademarks
mentioned or used by this software.