Skip to main content
edited tags
Link
Hotschke
  • 4.9k
  • 26
  • 38
Source Link

A problem when use ALE for syntax checking and gvim for vivado's editor

VIM version:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 14 2020 22:03:16)

OS information:

Microsoft Windows 10 Professional version 2004 (OS Version: 10.0.19041)

Problem Description:

I use gvim as text editor for vivado.

vivado setting capture

In Vivado, I click the verilog source file, the gvim will open the verilog file. And I use ALE for syntax checking. Everything else works, except the include statement.

For example:

There are one verilog file ( FileA.v ) and one verilog headerfile ( FileB.vh ) in the theme directory. In FileA.v, I use include:

`include "FileB.vh"

when I click FileA.v in Vivado, gvim is called to open FileA.v, then a syntax error will be reported:

[VRFC 10-3195] cannot open include file 'FileB.vh'

In fact, since FileA.v and FileB.vh is in the same directory, there should be no syntax error. And what puzzles me is that, at this time, resave this file by :w, the error will disappear.

However, close the opened file and click FileA.v in Vivado again, the problem occurs again.

Here is my _vimrc

set nocompatible
set nobackup
set noswapfile
set history=1024
set autochdir
set whichwrap=b,s,<,>,[,]
set nobomb
set backspace=indent,eol,start whichwrap+=<,>,[,]

set clipboard+=unnamed

set winaltkeys=no

set fileencodings=utf-8,gbk2312,gbk,gb18030,cp936
set encoding=utf-8
set langmenu=zh_CN
let $LANG = 'en_US.UTF-8'

colorscheme smyck

source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
set cursorline
set hlsearch
set number

set lines=35 columns=140

set splitbelow
set splitright

set guioptions-=T
set guioptions-=m
set guioptions-=L
" set guioptions-=r
set guioptions-=b

set guioptions-=e
set nolist
" set listchars=tab:▶\ ,eol:¬,trail:·,extends:>,precedes:<
set guifont=Consolas:h12:cANSI

set autoindent
set smartindent
set tabstop=4
set expandtab
set softtabstop=4
syntax on

au BufRead,BufNewFile *.vh set filetype=verilog


" Plugins
execute pathogen#infect()

let g:airline#extensions#ale#enabled = 1

" Airline
let g:airline_theme='papercolor'