Git Product home page Git Product logo

digital-ide's Introduction

Digital IDE -version 0.1.20

ASIC & FPGA design extension in VS Code (All in one)

  • If you have any questions, please post them under issues.
  • If you like it, please star.

Versions released before January 2022 are bug-fixed, and new features will be released after January.

中文教程

知乎教程

You are free to use it. Finally, if you like this extension and have some great idea, please connact with me. I am look foward to your joining.


START GIF

  • Start interface START GIF.gif
  • Use TOOL:generate property file to generate an initial property.json file.
  • Use TOOL:Overwrite the InitPropertyParam to customize the initial property.json file.

[Note]: Once the SOC_MODE.soc in the property.json file is changed from none to another, or turn back, file structure in this workspace will be updated, but only in standard file structure.

The standard file structure is defined as follow:

.vscode
  └── property.json   -- Project profile user - defined (or root directory stored in the workspace)
prj                   -- Used to store project files
  ├── intel           -- Used to store Intel engineering files
  ├── simulation      -- Used to store the intermediate files of the third party simulation tool
  └── xilinx          -- Used to store Xilinx engineering files
user                  -- Used to store source files designed by users User-defined
  ├── ip              -- Store the project IP code (vendor tool management, but moved to src equivalent directory by extension)
  ├── bd              -- Store project Block Designer source code (vendor tool management, but moved to src equivalent directory by extension)
  ├── data            -- Store data files, and constraint files
  ├── sim             -- Store user emulation code
  └── src             -- Store user design source code
       └─ lib         -- Store the user's hardware library source

SOC_MODE.soc in the property.json file is not setted as none (only user/** be changed):

user               -- Store source files designed by users User-defined
  Hardware         -- Store hardware logic design
     ├── ip        -- Store the project IP code (vendor tool management, but moved to src equivalent directory by extension)
     ├── bd        -- Store project Block Designer source code (vendor tool management, but moved to src equivalent directory by extension)
     ├── data      -- Store data files, and constraint files
     ├── sim       -- Store user emulation code
     └── src       -- Store user design source code
          └─ lib   -- Store the user's hardware library source
  Software         -- Store software driver design
     ├── data      -- Store data files
     └── src       -- Store the user's project source code

Requirements

  1. If you need to bring the Extension own serial debugging tool, install python3 and add it to the system environment variable

  2. If you need compatibility with Vivado features (including syntax checking, engineering, feature emulation, etc.) please add the following variables

  • ./Vivado/2018.3/bin
  • ./Vitis/2019.2/bin or ./SDK/2018.3/bin

Ways to detect successful configuration:

Enter

  • xsct
  • vivado -version
  • python

Check that all can be executed successfully.

[Note] : Currently support Vivado development, later will be compatible with other manufacturers development environment

Language highlight

Language highlight.png

Highlighting of the following languages is now supported

  • Verilog
  • SystemVerilog
  • VHDL
  • TCL(include xdc、sdc、fdc)

Grammar diagnosis

Grammar diagnosis.png

Syntax diagnostics use an external compiler, so please configure the appropriate environment before configuring the diagnostic Settings in the setting.

This syntax diagnosis can be flexibly used for different language types.

The Vivado series is used by default in this function, and different diagnostic combinations can be matched according to the existing environment, but when you select default, the diagnosis is considered to be off

  • For Verilog and SystemVerilog HDL.linting.vlog.linter
  1. Vivado
  2. modelsim
  3. Iverilog
  4. Verilator
  5. Verible
  • for VHDL HDL.linting.vlog.linter
  1. Vivado series
  2. Modelsim series
  3. GHDL

File mark

File mark.png

Hover tip

Hover tip.png

[Note] : Hover prompts use the built-in simple Verilog parser, which currently only supports Verilog and SystemVerilog

Automatic completion

Automatic completion.png

Project structure

Project structure.png

Define Jump

Define Jump.gif

Automatic formatting

You can format the selected characters or the whole text of the document. Vscode has built-in shortcut keys: shift + Alt + f

automatic formatting. GIF

Related Settings (setting) description:

  • verilog and systemverilog
  1. HDL.formatter.vlog.default.style Verilog and SystemVerilog format types, supporting three types of 'kr', 'ANSI' and 'gun'
  2. HDL.formatter.vlog.default.args For the other parameters input, the vlog is formatted using the WebAssembly of istyle so refer to istyle for the parameters to be entered [Note] : Since this function is based on istyle, it is still not perfect for the full text formatting. It is recommended to select the always statement block for formatting, and we will continue to fix related problems later.
  • vhdl
  1. HDL.formatter.vhdl.default.align-comments Whether you need to align comments
  2. HDL.formatter.vhdl.default.indentation The number of Spaces corresponding to TAB

Automate instantiated

automatically instantiated. GIF

The plug-in supports the instantiation of Verilog and VHDL modules in a Verilog file and in a VHDL file

  1. Place the cursor where the text needs to be instantiated.
  2. Use the shortcut key F1 to launch the command box, input instance, and select Tool:instance
  3. Enter the keyword of the module that needs to be instantiated.
  4. Select the modules to be instantiated.

Or use the shortcut key Alt + I to start, and then enter the keyword of the module to be instantiated, and select the module to be instantiated.

Automatically generates TB files

The steps are as follows:

  1. Use the shortcut key 'F1' to launch the command box, type Testbench, select TOOL: Testbench, or right-click from the file you want to generate and instantiate and select Testbench.
  2. Select the type and location of the simulation file. If the simulation file exists, replace it.

[Note] : If you want to change the contents of the original Testbench file, use the shortcut 'F1' to launch the command box and select TOOL:Overwrite the template of Testbench, select the type of the simulation file you want to change, and then open the testbench file initialization file.Also keep the //Instance flag, which is used to identify places that need to be instantiated. This feature is not recommended and it is more convenient to generate the instance directive directly in the TB file.

Iverilog quick simulation

iverilog fast simulation

  1. Build-in multi-file emulation without `include
  2. Support Xilinx simulation library

[Note] : This feature requires both iVerilog and Gtkwave to add system environment variables

If you need to support xilinx simulation library, you need to set the installation path of Xilinx in the setting sim.xilinx.lib. path

Example: {xilinx installation path}/Vivado/<Version number, for example 18.3>/data/verilog/src

Netlist-View

netlist

Translate vhdl-to-verilog

vhdl-to-verilog

State-Machine-View

State-Machine

General function instructions

  1. Launch. The back-end function is subject to the TOOL_CHAIN property configured in the property.json file. Currently only Vivado is supported. After launch, the project will be generated based on the information in the property.json file. If there is already a project will be opened directly. Right-click on the HDL file after launch and select Set as Top to Set that file as the top-level header for the design.

  2. Simulate. The function of "Simulate" is different from that of "Simulate" displayed in the RIGHT click of the HDL file, this function uses the simulation function corresponding to the TOOL_CHAIN property configured in the property.json file, which uses vivado simulation. While simulate displayed in THE RIGHT click of THE HDL file uses iverilog simulation, which is used to simulate a single file or a small number of files in real time.Right-click on the HDL file and select Set as Testbench Top to Set the file as the top-level header for the simulation.

  3. Refresh. All files under./user/src and./user/sim will be included, so your files under src, data, sim are the files already included in your project.The update mechanism is to delete all and then include all, so you add or delete files in the folder, select Refresh, the project will also be updated. In addition, if you add an HDL file to Code folder after you have started 'HardWare' terminal, the terminal will automatically add the file to the project.

'[Note]' : The Code folder refers to the HardwareSrc property configured in the property.json file. This property is an array type and will be overwritten once configured, even under the standard engineering file structure. If you do not configure this property and do not use the standard project file structure, the entire workspace will be the Code folder by default. If you configure property.json and use the standard file structure, the default Code folder is user (Hardware)/src and (Hardware)/sim.

  1. Build. Complete synthesis, layout and wiring. You can select enableShowlog under property.json to display the real-time cabling log. The error log is automatically displayed when an error occurs and when [CRITICAL WARNING] is displayed during Settings. If the bit and bin files are generated normally, the log can be ignored.

  2. Program. one-click download, just download, curing function will be added later, but there is zynq bin file directly downloaded to SD card inserted to cure.

  3. GUI. if you need IP design, function timing simulation or BD design select GUI, after which will automatically open the graphical interface.

[Note] ': After opening the GUI, open the VSCode of the corresponding project, and the corresponding HardWare running terminal can not be closed, after closing the GUI will automatically exit.If you directly close the GUI or vscode to Exit, the IP and BD design files in the project will not be moved to the user folder. You are advised to use Exit in the function bar FPGA OPTIONS to Exit.In addition, when you select Clean in the function bar TOOL, the IP and BD design files in the project will be moved to user and the whole project will be deleted.

[Note] : Relevant functions of SDK are not perfect and are ready to be opened later, which is used to replace Xilinx SDK and completely solve the problem of Using Xilinx SDK.

Vivado development assistance

Because currently only support vivado related functions, so for Vivado development assistance, see the general function instructions. [Note] : For the Device property in the property.json file, the following is currently available:

  • xc7z020clg400-2
  • xc7a35tftg256-1
  • xc7a35tcsg324-1
  • xc7z035ffg676-2
  • xc7z020clg484-1

In theory, it can support all the devices that Vivado can support. You can write your Device directly under the Device property. You can also Add your device to the database with the FPGA:Add Devices to the Database command, or Remove it from the database with the FPGA:Remove the Device from the Database command.

Thanks

digital-ide's People

Contributors

lstm-kirigaya avatar nitcloud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

digital-ide's Issues

HoverProvider.js error.

Hello,

First of all, congrats for your work. I think you had a very good idea to combine FPGA development languages support in one extension.

I am running VS Code 1.45.1.
When hoovering the code (.sv, .v), the following error is printed to console:

[2020-05-15 11:59:28.926] [renderer1] [error] An unknown error occurred. Please consult the log for more details.
[2020-05-15 11:59:28.927] [renderer1] [error] Cannot read property 'uri' of undefined: TypeError: Cannot read property 'uri' of undefined at c:\Users\userx.vscode\extensions\sterben.fpga-support-0.1.10\src.Providers\providers\HoverProvider.js:13:67 at processTicksAndRejections (internal/process/task_queues.js:85:5)

无法simulate

安装本插件后无法在vscode中simulate,已安装iverilog且path环境变量已设置,可于powershell中使用iverilog -o指令编译成功。
但使用本插件在vscode的.v文件界面右键选择Simulate编译时vscode提示如下错误:
'C:/iverilog/biniverilog.exe' �����ڲ����ⲿ���Ҳ���ǿ����еij��� ���������ļ���
来源:FPGA Develop Support(扩展)
注:错误信息实际显示即为乱码

其中,vscode的seetings.json相关设置如下:
"HDL.linting.linter": "iverilog",
"verilog.runInTerminal": true,
"HDL.linting.iverilog.arguments": "-i",
"TOOL.iVerilog.install.path": "C:/iverilog/bin",
"TOOL.gtkwave.install.path": "C:/iverilog/gtkwave/bin",

相应的,系统变量Path如下:
C:\iverilog\gtkwave\bin
C:\iverilog\bin\

我安装的iverilog链接为“http://bleyer.org/icarus/iverilog-v11-20210204-x64_setup.exe”
操作系统为Win10专业版-20H2,操作系统内部版本 19042.1052,处理器为amd 3700x,

所Simulate的文件内容为下述内容,文件编码为UTF-8.

module v1 (
input clock
);
always @(clock) begin
$display("Hello World!");
end

endmodule

生成Vivado工程时读取配置出错问题

在设置好配置文件之后,仍按照默认模板生成vivado工程。
我在如下位置设置了配置文件:
./property.json,./.vscode/property.json,prjInitParam.json
文件内容:

{
	"FPGA_VERSION": "xilinx",
	"PRJ_NAME": {
		"FPGA": "mipscpu"
	},
	"SOC_MODE": {
		"soc": "none"
	},
	"enableShowlog": true,
	"Device": "none"
}

发现工程名称均为默认的template.
检查启动脚本Run.tcl,发现脚本读取了.vscode\extensions\sterben.fpga-support-0.1.16\resources\tool目录下的CONFIG文件。而此文件在创建配置文件时并未被修改。

set soc           none
set Device        none
set prj_name      template
set enableShowlog false
set fp [open $root_path/CONFIG r]
while { [gets $fp data] >= 0 } {
	if { [string equal -length 13 $data "PRJ_NAME.FPGA"] == 1 } {
		gets $fp prj_name
		if {$prj_name == "undefined"} {
			set prj_name template
		}
	}
...

Need change "run.tcl" to "Run.tcl" in startfpga command

If we have an existing project, 'startFPGA' seems to run 'Run.tcl' by:

source ${HOME}/.vscode/extensions/sterben.fpga-support-0.1.10/src/.TOOL/Xilinx/Script/Xilinx_TCL/Vivado/run.tcl

We can execute it successfuly on Windows since Windows is case insensitive.
But Linux is case sensitive, so it cannot find file "run.tcl".

This problem can be easily solved by modifying the line in file:
${HOME}/.vscode/extensions/sterben.fpga-support-0.1.10/src/.TOOL/.Script/start.py

例化功能不正常

image

有的模块例化的时候,port列表总是会出现一些错误,有些port还重复出现,括号也莫名奇妙多,一些内部的reg也在这里显示。

crashes my extension host

I used vscode bisect to identify the error. Each time at startup of vscode, it kills my extension host.

使用`include命令引入宏定义时,使用iverilog仿真出错。

如题,我在RTL文件中引用了宏定义文件:

`include "defines.v"

该文件存放了形如

 `define     RstEnable       1'b1        //复位信号有效
 `define     RstDisable      1'b0        //复位信号无效

的宏定义。

此时在顶层文件右键点击simulate,会出现找不到宏定义文件的错误:

ERROR From iverilog : c:/Users/Desktop/mips_cpu/pc_reg.v:2: Include file defines.v not found

请问是否可以在iverilog编译命令中添加-I includedir选项以指定verilog中include指令的搜索路径呢?

High CPU usage

Issue Type: Bug

This extension causes high CPU utilization.

Extension version: 0.1.15
VS Code version: Code 1.55.2 (3c4e3df9e89829dce27b7b5c24508306b151f30d, 2021-04-13T09:35:57.887Z)
OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.73GB (16.41GB free)
Process Argv --crash-reporter-id 23accab7-e812-4840-9c04-35e9f4879f8d
Screen Reader no
VM 13%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
pythonvspyt700cf:30270857
pythonvspyt602:30294772
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
pythonvspyt639:30291489
pythontb:30283811
vspre833cf:30267465
pythonptprofiler:30281270
vshan820:30294714
pythondataviewer:30285071
vscus158:30286553
vscgsv2ct:30294353

语法高亮不正常

不知道为什么input和output不能正常高亮
image

我之前一直用的Verilog-HDL/SystemVerilog/Bluespec SystemVerilog插件,但是vscode一次更新后,我的自动补全就不能补全自己输入的变量
image
不知道这两个bug之间有没有联系。

can not read property 'name' of null

我新建了一个src的文件夹,然后放进去一些verilog文件,点击vscode左侧
image
然后就会报
image
这种错误,然后我想着是不是没建立工程,然后按F1生成一个property文件,还是不行

状态机预览页面点击“Save as SVG”按钮无反应,无法保存为SVG文件

先贴一下具体环境:

VSCode:

  • 版本: 1.66.2 (user setup)
  • 日期: 2022-04-11T07:46:01.075Z
  • Electron: 17.2.0
  • Chromium: 98.0.4758.109
  • Node.js: 16.13.0
  • V8: 9.8.177.11-electron.0
  • OS: Windows_NT x64 10.0.19044

Digital IDE:
v0.1.22

情况描述:
在.v源码文件视图右键菜单点击"show FSMGraph"后能正确打开状态机预览图的窗口,也能正确绘制状态转换图,同时也能正确识别我的大写“STATE”的状态寄存器定义,点击状态机中各个节点也能在源码视图跳转到正确语句块。但是在状态图预览窗口点击顶部按钮“Save as SVG”时无反应,按钮卡死在按下状态,没有弹出保存对话框等动作,就是单纯地没有反应了。
无报错、无输出,找不到相关的日志记录等。

备注:
我使用这个插件进行开发的时候,开发的不是Xilinx的项目,而是国产安路科技的,语言是Verilog,但没有安装Xilinx,Iverilog等环境,但安装并配置了ModelSim的目录。

模块层次树失效

文件栏里中,层次树的子模块及其分支不再显示,如图:
image
文件位置如图,所有文件都在工作区文件夹下:
image

Linting功能失效及部分错误

插件版本:0.2.1
现象:
使用vivado作为vlog Linter时功能失效,不再标识语法错误。vivado版本为2021.2,路径如图所示
image
使用modelsim作为Linter则正常。
使用iverilog作为vlog Linter时,iverilog不支持systemverilog语法。

插件学习

你好,请问可不可以出一个教学视频或者完整的配置教程呀,有很多东西看不明白。
image
比方说我的vivado 2019.2下面就没有SDK目录。

Extension issue

  • Issue Type: Bug
  • Extension Name: fpga-support
  • Extension Version: 0.1.13
  • OS Version: Windows_NT x64 10.0.19042
  • VS Code version: 1.55.2

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

testbench不支持defparam关键字

testbench里不支持使用defparam关键字修改模块里的parameter,使用defparam会报错找不到该参数。请问这个问题怎么解决?
image
image

Code refactoring

Is it possible to refactor a signal/port name present in multiple modules (files: *.v)?

例化功能模板出错

使用例化功能进行模块例化时,最后一个信号末尾有逗号,导致语法错误。

pc_reg u_pc_reg(
	//ports
	.clk 		( clk 		),
	.rst 		( rst 		),
	.pc  		( pc  		),
	.ce  		( rom_ce_o  ),
);

右键点击start fpga么有反应

如题,但是可以在命令行里用Python操作,下载插件地址在C盘的默认的.vscod里.vscode\extensions\sterben.fpga-support-0.1.10\src.TOOL.Script\start.py

我的语法检查还是运行不了

使用版本0.2.4
当前启用扩展:
image
扩展设置:
image
image
环境变量也已设置
image
但不会报错
image
但启用Verilog-HDL/SystemVerilog/Bluespec SystemVerilog 这个扩展之后,该扩展的语法检查功能成功报错
image

Test Bench 导致溢出

项目文件结构如图
image
刚刚写一点testbench的时钟
image
爆栈 然后 file部分不显示

自动补全失效

上次更新后能自动打开gtkwave了,但是自动补全又不工作了

couldn't read file "*/resources/script/xilinx/launch.tcl": no such file or directory

在 FPGA Options 中 Launch 时 ,使用了命令

vivado -mode tcl -s c:/Users/XXX/.vscode/extensions/sterben.fpga-support-0.1.21/resources/script/xilinx/launch.tcl -notrace -nolog -nojournal

但是本文件找不到,即报错

couldn't read file "c:/Users/XXX/.vscode/extensions/sterben.fpga-support-0.1.21/resources/script/xilinx/launch.tcl": no such file or directory

,经查阅 git 仓库相应位置也没有这个文件,而这个文件可能是在 git 仓库的
/resources/script/xilinx/soft/launch.tcl下的同名文件,疑似版本更新时脚本未更新

Succeed using module pyperclip to control clipboard

Description

I tried using pyperclip to copy instance to clipboard, and succeeded in macOS.

I am not sure if it makes sense on other os. I will try it later.

Environment

  • OS: macOS 10.15.4
  • Python: 3.7.7

Solution

Import the module:

import pyperclip

Use a string to record data, for example, instance_data.
And then just use

pyperclip.copy(instance_data)

to copy the string to clipboard.

Xilinx environment variable is failed to configure

Platform

Ubuntu20.04.1 LTS X86_64, 5.8.0-59-generic kernel version
Vivado 2020.2, Vitis_HLS 2020.2
Python 3.8.10 runs in GCC 9.4.0

Description

Sytax highlight works fine, but no syntax checking or other features from Xilinx development tool after I set up xilinx install path. It is not fixed even if I changed the software version to 2020.3. Neither vivado or xsct command is valid. I found no answers in closed or opened issue, any suggestion is helpful, thanks!

settings.json
{
    "terminal.integrated.tabs.enabled": true,
    "explorer.confirmDelete": false,
    "TOOL.xilinx.install.path": "/opt/Xilinx/Vivado/2020.2/bin, /opt/Xilinx/Vitis_HLS/2020.2/bin, /opt/Xilinx/Vitis/2020.3/bin"
}

README file in English for better adoption

Just as a suggestion, but you might want to include an English version of the main README.md file. It might help increase the number of user installs the extension gets in VS Code.

Likewise, having the CHANGELOG.md contain the project revision information might be something worth looking into.

Here's my shot at the translation and changelog (rename to remove the *.txt extension):

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.