vscode通过Code runner调用vcs来编译systemverilog文件

前言

01.vscode通过Code runner调用vcs来编译systemverilog文件:

{
    
    
    "window.zoomLevel": 1,
    "workbench.iconTheme": "vscode-icons",
    "code-runner.executorMap": {
    
    
        "fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "systemverilog": "cd $dir && vcs -full64 -cpp g++-4.8 -cc gcc-4.8 -LDFLAGS -Wl,--no-as-needed -assert enable_diag -debug_acc+all -sverilog $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt && rm -rf $dir$fileNameWithoutExt $dircsrc $dir/ucli.key $dir$fileNameWithoutExt*.daidir",
    },
    "code-runner.clearPreviousOutput": true
}

02.ubuntu Vscode环境SystemVerilog格式化工具安装配置

1. 首先在插件中心安装这款插件:SystemVerilog and Verilog Formatter

在这里插入图片描述

2. 下载verible

verible是谷歌提供的一块verilog工具,我们主要使用它的代码格式化工具。

https://github.com/google/verible

在这里插入图片描述
自己下载的是:verible-v0.0-2162-g80b07f9c-Ubuntu-20.04-focal-x86_64.tar.gz

ubuntu@ubuntu verible-v0.0-2162-g80b07f9c % tree                           [0]
.
├── bin
│   ├── git-verible-verilog-format.sh
│   ├── verible-patch-tool
│   ├── verible-transform-interactive.sh
│   ├── verible-verilog-diff
│   ├── verible-verilog-format
│   ├── verible-verilog-format-changed-lines-interactive.sh
│   ├── verible-verilog-kythe-extractor
│   ├── verible-verilog-lint
│   ├── verible-verilog-ls
│   ├── verible-verilog-obfuscate
│   ├── verible-verilog-preprocessor
│   ├── verible-verilog-project
│   └── verible-verilog-syntax
└── share
    ├── man
    │   └── man1
    │       ├── verible-verilog-diff.1.gz
    │       ├── verible-verilog-format.1.gz
    │       ├── verible-verilog-lint.1.gz
    │       ├── verible-verilog-obfuscate.1.gz
    │       ├── verible-verilog-syntax.1.gz
    │       ├── verilog_diff.1.gz -> verible-verilog-diff.1.gz
    │       ├── verilog_format.1.gz -> verible-verilog-format.1.gz
    │       ├── verilog_lint.1.gz -> verible-verilog-lint.1.gz
    │       ├── verilog_obfuscate.1.gz -> verible-verilog-obfuscate.1.gz
    │       └── verilog_syntax.1.gz -> verible-verilog-syntax.1.gz
    └── verible
        ├── AUTHORS.md
        ├── CONTRIBUTING.md
        ├── index.md
        ├── license.md
        ├── lint.md
        ├── README.md
        ├── verilog_format.md
        ├── verilog_lint.md
        └── verilog_syntax.md

5 directories, 32 files

3. 打开插件的设置选项,选择自己的操作系统,即可开始使用。使用方法是,在代码编辑页面按下alt+shift+F。

尝试中ing

小编用wget命令行下载的,也可以是使用其他方法

wget https://github.com/chipsalliance/verible/releases/download/v0.0-2162-g80b07f9c/verible-v0.0-2162-g80b07f9c-Ubuntu-20.04-focal-x86_64.tar.gz
  • wget命令用法如下:
wget -O [重新自定义的文件名] [下载地址]

猜你喜欢

转载自blog.csdn.net/haojie_duan/article/details/124938817