vscode及其插件

1. Verilog插件

  之前都是在sublime中进行verilog的代码编写,因为在sublime当中的插件还是比较好使的。但是最近的在vscode里面可以画图什么的,实在是太香了,所以更改一下。这里需要记录几款插件。

1.1 verilog 语法高亮

Verilog-HDL/SystemVerilog/Bluespec SystemVerilog
这一个插件,可以来显示语法的高亮,同时还可以用来例化模块什么的,好用。
在这里插入图片描述
在这里插入图片描述
  使用该插件可以直接生成例化模板,比较简单,使用方法也比较简单,从插件的说明那里就能看到,需要安装一个小的应用程序。
  该插件需要到github上下载一个小程序,然后把程序添加到环境变量里面。
在这里插入图片描述
到它的release目录下,下载一个版本,然后解压,就可以。
在这里插入图片描述
在这里插入图片描述
然后把这个路径添加到环境变量里面。添加到环境变量里面,最好重启一下电脑,这样能够确保环境变量生效了。
在这里插入图片描述
这个小的应用程序安装好之后,就可以使用这个插件来生成例化模板了。
ctrl + shift + p 调出命令窗口,选择例化模块
在这里插入图片描述
这个插件会去选择选择一个需要例化的模块,然后选择需要例化的模块就可以了。
在这里插入图片描述
它会在光标所在的位置,生成刚刚选中的模块的例化模板
在这里插入图片描述

1.2 vscode 关联vivado

setting =》 Text Editor =》 custom editor
输入vscode的安装路径: D:/Program Files (x86)/Microsoft VS Code/Code.exe -g [file name]:[line number]
在这里插入图片描述

1.3 vscode 语法纠错

  在之前使用sublime的时候,使用的是iverilog进行语法纠错。vscode支持几种不同语法纠错工具,这里可以直接使用vivado的语法纠错工具。参考这个博主的就可以了:vscode 语法检测
  首先把vivado的可执行文件的路径添加到环境变量里面。
在这里插入图片描述
  然后在插件里面设置语法纠错工具。
在这里插入图片描述

1.4 关于模块例化和生成测试模板

  模板例化和生成脚本可以安装两个插件。使用也比较简单,但是需要python支持,需要安装python,然后把环境变量添加进去。网上关于这两个插件介绍挺多的。确实好用,跟sublime一样好用。
参考: vscode 例化和测试模板

在这里插入图片描述
在这里插入图片描述

1.5 代码片段

   在写代码的时候,一些常用的代码和文件头什么的,可以通过使用代码片段的方式来进行添加,这个还在之前我使用sublime的时候,添加代码片段差不多。
在这里插入图片描述
  添加一个代码片段,代码片段可以选择支持的语言什么的。
scope字段后面是支持的语法,没有这个字段,那就是使用vscode的时候,所有文件都可以使用这个代码片段。
prefix字段是代码片段的快捷方式,输入对应的代码,就可以添加代码片段了。
body 里面就是代码片段的具体内容了。代码片段的内容需要在 " " 两个引号里面,每一行都需要。

{
	// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 
	// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 
	// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is 
	// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: 
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. 
	// Placeholders with the same ids are connected.
	// Example:
	"comment3": {
		"scope": "verilog, systemverilog",
		"prefix": "Zs3",
		"body": [
			"//----------------${1}------------------"
		],"
		"description": "comment3"
	}
}

  下面是一个文件头,每次输入FH1,就会在光标的位置添加一个文件头了。

{
	// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 
	// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 
	// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is 
	// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: 
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. 
	// Placeholders with the same ids are connected.
	// Example:
	"My File Header": {
		"prefix": "FH1",
		"body": [
			"// -----------------------------------------------------------------------------"
			"// Copyright (c) 2014-2020 All rights reserved"
			"// -----------------------------------------------------------------------------"
			"// Author 	 : WCC 1530604142@qq.com"
			"// File   	 : $TM_FILENAME_BASE"
			"// Create 	 : $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE"
			"// Revise 	 : $CURRENT_YEAR-"
			"// Editor 	 : Vscode, tab size (4)"
			"// Functions : "
			"// 			   "
			"// -----------------------------------------------------------------------------"
		],
		"description": "My File Header"
	}
}

  会根据文件的名称,自动在文件头上添加文件的名字,然后还有创建时间什么的,完全是用户可以自己定义的哈。
在这里插入图片描述

2. 绘波形图插件

Waveform Render这个插件可以在vscode中写一些代码,然后就可以生成对应的时序图了。
在这里插入图片描述
ctrl + k ctrl +d 可以将代码显示成时序图
ctrl + shit + p 然后选择toggle Live preview 可以打开和关闭实时预览。
在绘图的时候把实时预览打开,绘制完毕之后,把实时预览关闭
在这里插入图片描述
  在设置绘制时序波形的时候,需要创建一个json文件,打开文件后就可以输入代码进行波形图的绘制了。显示这里的json文件的时候,用java语法显示,显示的语法比较好看,不会提示过多的错误。
在这里插入图片描述
点击上面这个图中的地方,换成java语法就好了。

在这里插入图片描述

3. 绘图插件

在这里插入图片描述
  这个可以来画点流程图,结构图什么的,方便。绘制图形的时候,先创建一个后缀名为 .drawio的文件,然后用vscode打开,就可以进行图形的绘制了。
在这里插入图片描述

  • 2
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值