I've been working with PSL/Sugar lately to verify some VHDL code. Anyone who's ever coded knows how useful syntax highlighting is, so when I started editing PSL, I was quite annoyed to find that there no syntax highlighting available iin Vim for PSL. I did some searching on the net and found this user contributed syntax file for PSL/Verilog. I tried using posted syntax file 'as is', but it wouldn't work for me. I spent about an hour going through some vimdocs and was able to get it to work with VHDL.
I created a file called psl.vim which contains the syntax highlighting definitions for PSL and VHDL. In order to use the file, you need to put it in ~/.vim/syntax. To get vim to automatically load the PSL highlight definitions when you open a file ending in .psl, add the following to your ~/.vimrc file
autocmd BufRead,BufNewFile *.psl setfiletype psl
Before the PSL keywords are defined, I've added the following which will load the VHDL syntax definitions:
" include VHDL syntax runtime! syntax/vhdl.vim " include Verilog syntax " runtime! syntax/verilog.vimIf you want to work with Verilog instead, you can comment out the VHDL line and uncomment the verilog one.
| Attachment | Size |
|---|---|
| psl.vim | 1.45 KB |
Comments
psl syntax highlighting in vim
Thanks for that, I've downloaded it and am using it successfully!
Mel.
Great work
Great work.....really very helpful..
Good Job Stephan!
I concur...great work Stephan!
Easy to implement and now I have PSL syntax
VHDL - PSL User
Great Work!!!
Great Stephan...
I just used it for my PSL files......
regards
vinun