Verilog Lightweight Development Environment
contexts
The author's common development environment
- VIAVDO, huge size, comes with editor except linting, the editor is almost unusable, the simulation interface is very friendly, but the speed is slow.
- Sublime Text, a very good editor, a variety of plug-ins to use verilog is very convenient, you can auto-complete, generate calls, linting and so on;
- VSCODE, Sublime Text have plug-ins, VSCODE also have, although not necessarily sublime text is good to use, but VSCODE has AI plug-ins to support, it seems more attractive, more efficient. And completely free, VSCODE destined to dominate the world.
So here are the main instructions on how to build a VSCODE lightweight environment.
Environment Setup
First of all, you have to have VSCODE, the installation package search for (do not ask why not use Baidu) self-installation can be.
Installation of plug-ins
Figure 2-1 VSCODE Verilog Plug-in
Installing Iverilog
Icarus Verilog for Windows () Download and install Iverilog, a lightweight development and compilation tool, so that you can complete module-level code development without using VIVADO at all.
Set the environment variables after the installation is complete:
Figure 2-2 Setting the iverilog and gtkwave Environment Variables
Reboot the computer after setting, WIN11 seems to not need to reboot, it will take effect immediately, only need to restart VSCODE.
Setting Up Plug-ins
Figure 2-3 Setting up the linter to run in the directory where the iverilog files are located.
Compile View Waveforms
Iverilog does not support .sv files well, and top-level files that need to be compiled should preferably have a .v suffix. When it comes to module calls, it is better to declare them with `include' in the code.
Figure 2-4 Simulation Top Layer
Figure 2-5 Run Compile Simulation
Note that the code must include the automatic $finish; also dump the wave file.
initial begin
$display("start a clock pulse"); // print the start marker
$dumpfile(""); // Specify the file in which to record the simulated waveforms
$dumpvars(0, pulse_gen_test); // Specify the module level of the records
end
It is also possible to run the compilation and simulation from the command line with the following basic commands:
@echo off
-o pulse_gen_test.sv
where -o is the target file and pulse_gen_test.sv is the simulation file to be compiled to execute the corresponding simulation.
The target file is then generated and can be viewed via gtkwave (execute gtkwave in a terminal . \).
Figure 2-6 gtkwave Viewing Waveforms
It should be noted that there is a bit of a problem with the auto-instantiation module in VSCODE, which I hope will be solved by a later plugin.
AI Plug-in
The strongest thing about VSCODE is his AI plugin, which sublime text does not have.
Figure 3-1 Ali TONGYI Lingma Plug-in
Application market search can be installed, the domestic big models and plug-ins, Ali's most reliable, the actual use of the experience is good, detailed soon be able to catch up with foreign countries.