suoto / hdl_checker

Repurposing existing HDL tools to help writing better code
GNU General Public License v3.0
192 stars 22 forks source link

Verilog error not detected #65

Closed rafaelnp closed 4 years ago

rafaelnp commented 4 years ago

Hi,

I am using the hdl_checker in the following environment:

And using this verilog file to test it:

module simple_mux(
    input [1:0] x,
    input [1:0] y,
    input s,
    output reg [1:0] m
    );

    this_is_an_error

    always @ (x or y or s)
    begin
        if(s==0)
            m=y;
        else
            m=x;
    end
endmodule

Looking at the log I see the error in the code was not detected, neither in the log file nor in Neovim. Is there something in my configuration/environment missing or wrong?

INFO    | 10:39:41 | hdl_checker.server @ run():205 MainThread |    Starting server. Our PID is 57584, no parent PID to attach to. Version string for hdl_checker is '0.6.11'
INFO    | 10:39:41 | pyls.python_ls @ start_io_lang_server():85 MainThread |    Starting HdlCheckerLanguageServer IO language server
WARNING | 10:39:41 | pyls.config.config @ __init__():55 MainThread |    Failed to load pyls entry point 'autopep8': No module named 'autopep8'
WARNING | 10:39:41 | pyls.config.config @ __init__():55 MainThread |    Failed to load pyls entry point 'pydocstyle': No module named 'pydocstyle'
WARNING | 10:39:42 | pyls.config.config @ __init__():55 MainThread |    Failed to load pyls entry point 'yapf': No module named 'yapf'
INFO    | 10:39:42 | hdl_checker.utils @ wrapper():361 MainThread | m_initialize((), {'capabilities': {'textDocument': {'codeAction': {'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['',
                                                                                                               'quickfix',
                                                                                                               'refactor',
                                                                                                               'refactor.extract',
                                                                                                               'refactor.inline',
                                                                                                               'refactor.rewrite',
                                                                                                               'source',
                                                                                                               'source.organizeImports']}},
                                                  'dynamicRegistration': True},
                                   'codeLens': {'dynamicRegistration': True},
                                   'colorProvider': {'dynamicRegistration': True},
                                   'completion': {'completionItem': {'commitCharactersSupport': True,
                                                                     'deprecatedSupport': True,
                                                                     'documentationFormat': ['markdown',
                                                                                             'plaintext'],
                                                                     'preselectSupport': True,
                                                                     'snippetSupport': True},
                                                  'completionItemKind': {'valueSet': [1,
                                                                                      2,
                                                                                      3,
                                                                                      4,
                                                                                      5,
                                                                                      6,
                                                                                      7,
                                                                                      8,
                                                                                      9,
                                                                                      10,
                                                                                      11,
                                                                                      12,
                                                                                      13,
                                                                                      14,
                                                                                      15,
                                                                                      16,
                                                                                      17,
                                                                                      18,
                                                                                      19,
                                                                                      20,
                                                                                      21,
                                                                                      22,
                                                                                      23,
                                                                                      24,
                                                                                      25]},
                                                  'contextSupport': True,
                                                  'dynamicRegistration': True},
                                   'declaration': {'dynamicRegistration': True},
                                   'definition': {'dynamicRegistration': True},
                                   'documentHighlight': {'dynamicRegistration': True},
                                   'documentLink': {'dynamicRegistration': True},
                                   'documentSymbol': {'dynamicRegistration': True,
                                                      'symbolKind': {'valueSet': [1,
                                                                                  2,
                                                                                  3,
                                                                                  4,
                                                                                  5,
                                                                                  6,
                                                                                  7,
                                                                                  8,
                                                                                  9,
                                                                                  10,
                                                                                  11,
                                                                                  12,
                                                                                  13,
                                                                                  14,
                                                                                  15,
                                                                                  16,
                                                                                  17,
                                                                                  18,
                                                                                  19,
                                                                                  20,
                                                                                  21,
                                                                                  22,
                                                                                  23,
                                                                                  24,
                                                                                  25,
                                                                                  26]}},
                                   'foldingRange': {'dynamicRegistration': True,
                                                    'lineFoldingOnly': True,
                                                    'rangeLimit': 5000},
                                   'formatting': {'dynamicRegistration': True},
                                   'hover': {'contentFormat': ['markdown',
                                                               'plaintext'],
                                             'dynamicRegistration': True},
                                   'implementation': {'dynamicRegistration': True},
                                   'onTypeFormatting': {'dynamicRegistration': True},
                                   'publishDiagnostics': {'relatedInformation': True},
                                   'rangeFormatting': {'dynamicRegistration': True},
                                   'references': {'dynamicRegistration': True},
                                   'rename': {'dynamicRegistration': True,
                                              'prepareSupport': True},
                                   'signatureHelp': {'dynamicRegistration': True,
                                                     'signatureInformation': {'documentationFormat': ['markdown',
                                                                                                      'plaintext'],
                                                                              'parameterInformation': {'labelOffsetSupport': True}}},
                                   'synchronization': {'didSave': True,
                                                       'dynamicRegistration': True,
                                                       'willSave': True,
                                                       'willSaveWaitUntil': True},
                                   'typeDefinition': {'dynamicRegistration': True}},
                  'workspace': {'applyEdit': True,
                                'configuration': True,
                                'didChangeConfiguration': {'dynamicRegistration': True},
                                'didChangeWatchedFiles': {'dynamicRegistration': True},
                                'executeCommand': {'dynamicRegistration': True},
                                'symbol': {'dynamicRegistration': True,
                                           'symbolKind': {'valueSet': [1,
                                                                       2,
                                                                       3,
                                                                       4,
                                                                       5,
                                                                       6,
                                                                       7,
                                                                       8,
                                                                       9,
                                                                       10,
                                                                       11,
                                                                       12,
                                                                       13,
                                                                       14,
                                                                       15,
                                                                       16,
                                                                       17,
                                                                       18,
                                                                       19,
                                                                       20,
                                                                       21,
                                                                       22,
                                                                       23,
                                                                       24,
                                                                       25,
                                                                       26]}},
                                'workspaceEdit': {'documentChanges': True,
                                                  'failureHandling': 'textOnlyTransactional',
                                                  'resourceOperations': ['create',
                                                                         'rename',
                                                                         'delete']},
                                'workspaceFolders': True}},
 'initializationOptions': {},
 'processId': 57551,
 'rootPath': '/home/rnp/tmp/simple_mux',
 'rootUri': 'file:///home/rnp/tmp/simple_mux',
 'trace': 'off',
 'workspaceFolders': []}) => {'capabilities': {'definitionProvider': True, 'hoverProvider': True, 'textDocumentSync': 1}}
WARNING | 10:39:42 | hdl_checker.base_server @ _setupIfNeeded():338 MainThread |    Not all directories exist, forcing setup
DEBUG   | 10:39:42 | hdl_checker.base_server @ clean():363 MainThread | Cleaning up project
DEBUG   | 10:39:42 | hdl_checker.utils @ removeDirIfExists():310 MainThread |   Failed to remove /home/rnp/tmp/simple_mux/.hdl_checker
DEBUG   | 10:39:42 | hdl_checker.base_server @ _recoverCacheIfPossible():311 MainThread |   Couldn't read cache file /home/rnp/tmp/simple_mux/.hdl_checker/cache.json, skipping recovery
DEBUG   | 10:39:42 | hdl_checker.lsp @ _onConfigUpdate():244 MainThread |   Updating from {}
INFO    | 10:39:42 | hdl_checker.lsp @ showInfo():174 MainThread |  [INFO] Searching /home/rnp/tmp/simple_mux for HDL files...
DEBUG   | 10:39:42 | SimpleFinder @ __init__():46 MainThread |  Search paths: ['/home/rnp/tmp/simple_mux']
DEBUG   | 10:39:42 | SimpleFinder @ _addSource():46 MainThread |    Adding path /home/rnp/tmp/simple_mux/simple_mux.v (flags=None, library=None)
INFO    | 10:39:42 | SimpleFinder @ generate():93 MainThread |  Resulting project:
{'sources': ['/home/rnp/tmp/simple_mux/simple_mux.v']}
INFO    | 10:39:42 | hdl_checker.base_server @ setConfig():175 MainThread | Replacing None with /tmp/hdl_checker_project_pid57584.json
DEBUG   | 10:39:42 | hdl_checker.base_server @ setConfig():181 MainThread | Set config to WatchedFile(path=Path('/tmp/hdl_checker_project_pid57584.json'), last_read=0.0)
DEBUG   | 10:39:42 | hdl_checker.utils @ onNewReleaseFound():465 MainThread |   Current version is 0.6.11, latest is (0, 6, 11)
INFO    | 10:39:42 | hdl_checker.utils @ wrapper():361 MainThread | m_initialized((), {}) => None
INFO    | 10:39:43 | hdl_checker.lsp @ lint():294 Thread-4 |    linting: file:///home/rnp/tmp/simple_mux/simple_mux.v
INFO    | 10:39:43 | hdl_checker.lsp @ _getDiags():330 Thread-4 |   Linting Path('/home/rnp/tmp/simple_mux/simple_mux.v') (saved=True)
DEBUG   | 10:39:43 | hdl_checker.base_server @ _getBuilderMessages():393 Thread-4 | Building '/home/rnp/tmp/simple_mux/simple_mux.v'
DEBUG   | 10:39:43 | hdl_checker.base_server @ configure():226 Thread-4 |   Updating with base config:
{'sources': ['/home/rnp/tmp/simple_mux/simple_mux.v']}
DEBUG   | 10:39:43 | hdl_checker.utils @ runShellCommand():259 Thread-4 |   vcom -version
DEBUG   | 10:39:43 | hdl_checker.utils @ runShellCommand():283 Thread-4 |   Command '['vcom', '-version']' failed with [Errno 2] No such file or directory: 'vcom'
DEBUG   | 10:39:43 | hdl_checker.utils @ runShellCommand():259 Thread-4 |   xvhdl --nolog --version
DEBUG   | 10:39:43 | hdl_checker.utils @ runShellCommand():283 Thread-4 |   Command '['xvhdl', '--nolog', '--version']' failed with [Errno 2] No such file or directory: 'xvhdl'
DEBUG   | 10:39:43 | hdl_checker.utils @ runShellCommand():259 Thread-4 |   ghdl --version
DEBUG   | 10:39:43 | hdl_checker.builder_utils @ getWorkingBuilders():98 Thread-4 | Builder ghdl worked
DEBUG   | 10:39:43 | hdl_checker.base_server @ configure():237 Thread-4 |   Builder class: <class 'hdl_checker.builders.ghdl.GHDL'>
DEBUG   | 10:39:43 | hdl_checker.builders.ghdl @ setup():127 Thread-4 | /home/rnp/tmp/simple_mux/.hdl_checker already exists
DEBUG   | 10:39:43 | hdl_checker.utils @ runShellCommand():259 Thread-4 |   ghdl --version
INFO    | 10:39:43 | hdl_checker.builders.ghdl @ _checkEnvironment():98 Thread-4 |  GHDL version string: '['GHDL 0.36 (v0.36) [Dunoon edition]', ' Compiled with GNAT Version: 9.2.0', ' GCC back-end code generator', 'Written by Tristan Gingold.', '', 'Copyright (C) 2003 - 2019 Tristan Gingold.', 'GHDL is free software, covered by the GNU General Public License.  There is NO']'. Version number is '0.36'
INFO    | 10:39:43 | hdl_checker.database @ addSource():151 Thread-4 |  Adding /home/rnp/tmp/simple_mux/simple_mux.v, library=None, flags=(single=(), dependencies=())
DEBUG   | 10:39:43 | hdl_checker.database @ _parseSource():422 Thread-4 |   Parsing /home/rnp/tmp/simple_mux/simple_mux.v
DEBUG   | 10:39:43 | hdl_checker.lsp @ _handleUiInfo():122 Thread-4 |   UI info: Added 1 sources (workspace=<pyls.workspace.Workspace object at 0x7f10ccdf1d90>)
DEBUG   | 10:39:43 | hdl_checker.base_server @ _updateConfigIfNeeded():219 Thread-4 |   Updated config file to WatchedFile(path=Path('/tmp/hdl_checker_project_pid57584.json'), last_read=1574242782.232715)
DEBUG   | 10:39:43 | hdl_checker.utils @ runShellCommand():259 Thread-4 |   ghdl --dispconfig
DEBUG   | 10:39:43 | hdl_checker.builders.ghdl @ _parseBuiltinLibraries():121 Thread-4 |    library path is /usr/lib/ghdl
DEBUG   | 10:39:43 | hdl_checker.builders.ghdl @ builtin_libraries():272 Thread-4 | Builtin libraries: (Identifier('src'), Identifier('vendors'), Identifier('synopsys'), Identifier('std'), Identifier('mentor'), Identifier('ieee'))
DEBUG   | 10:39:43 | hdl_checker.database @ getDependenciesUnits():682 Thread-4 |   Searching {Path('/home/rnp/tmp/simple_mux/simple_mux.v')} resulted in dependencies: set()
DEBUG   | 10:39:43 | hdl_checker.database @ getDependenciesUnits():706 Thread-4 |   Search paths: set()
suoto commented 4 years ago

For Verilog and SystemVerilog, the only supported tool right now is ModelSim/Questa. Adding support for mixed VHDL/Verilog/SystemVerilog via Vivado xvlog and for Verilog/SystemVerilog only through verilator or iverlog is doable, I'll open issues for those.