Verilog Setup and Simulation
Requirements
Version | Information | |
---|---|---|
VHDPlus IDE | 0.9+ | Instructions |
Packages | - | ModelSim |
Video Tutorial
Written tutorial
Setup
- (Optional) Open
Extras > Package manager
and install the Verilog Language Support - (Optional) Open
Extras > Settings > Editor
and select what support you want to use
You can click on File > Import Quartus Project
to import an existing Verilog project
Create a Verilog project
- Create a new project and select
Verilog Project with Simulation
. An example for a blinking LED will be created.
reg [23:0] counter = 0;
always @ (posedge clk)
begin
counter <= counter + 1'b1;
end
assign led = counter[19];
- A testbench file will be created where the clock signal is simulated. An instance of the blink code is created and simulated.
Blink UUT (.clk(clk), .led(led));
initial
begin
forever
#41.666 clk = !clk;
end
Here you can find more information on creating testbenches for you Verilog code
Start the simulation
- Do a right click on the testbench file and select
Simulate with Modelsim
- Check for errors in the output window
- After Modelsim is open, right click the signal to simulate and click on
Add to Wave
. Or you can just drag an drop the signals. - Select the
Run Length
and run the simulation with the buttons on top - You can zoom out and see the simulated behavior
Done ✔ Need help?
If everything worked as planned, the LED of your FPGA should blink every second.
If anything went wrong, feel free to ask for help.
For the fastest response, join us on Discord.