Download : To download Quartus Prime Lite Edition 18.1. Click here. For reference,see the following figure.
Board description : The layout of the board is provided in the following figure.
Settings of FPGA Configuration Mode : When the DE1-SoC board is powered on, the FPGA can be configured from EPCQ or HPS. The MSEL[4:0] pins are used to select the configuration scheme. It is implemented as a 6-pin DIP switch SW10 on the DE1-SoC board, as shown in the following figure.
The other configuration mode are described in the following table.
In main window menu: File->New...
Then click on New Quartus Prime Project in the opened window
click on the Next Button
Define your project directory and the name of project
Check the Empty project dialouge and then Next
Add files if you have, otherwise click Next
You will now need to enter information about the FPGA:
for example V SE 5CSEMA5F31C6N(our SOC board)
Leave all option None
Hit Finish
Result
Now add a verilog file to project by using File-> Verilog HDL File
write the following code in the new verilog file and save the file with the name of verilog module (here is add_multiply)
module add_multiply(input signed [3:0] a,b,input mode,output[8:0]result); assign result = (mode) ? a + b : a * b ; endmodule
`timescale 1ns/1ns module add_multiply_tb; // Inputs reg [3:0] a; reg [3:0] b; reg mode; // Outputs wire [8:0] result; // Instantiate the Unit Under Test (UUT) add_multiply uut ( .a(a), .b(b), .mode(mode), .result(result) ); initial begin // Initialize Inputs a = 0; b = 0; mode = 0; // Wait 100 ns for global reset to finish #100; // Add stimulus here a = 7; b = 4; #100; mode = 1; #100; $finish; end endmodule
Next go to Tools > Options > General > EDA Tool Options sure that the path next to Modelsim-Altera is configured correctly. If you installed Quartus II with Altera-Modelsim the path should be similar to the one shown in the figure (i.e. on Windows:“C:\intelFPGA_lite\18.1\modelsim_ase\win32aloemâ€), otherwise you will need to browse to where you installed Altera Modelsim and point it to the win32aloem directory.
go to Assignments > Settings > EDA Tool Settings > Simulation check the Compile test bench dialog and click Test Benches button and then click New..
Then, in the openned window, specify your test bench and add test bench file from the project directory to software. Click OK and finally Apply in simulation setting page:
compile project:* hit compile design bottom(Ctrl + L) in the task bar.
Open Altera-Modelsim: To open altera-modelsim go to Tools > Simulation Tool > RTL Simulation. This should open up Altera-Modelsim.
In this section we will show how to use Quartus IP Catalog. We start by crating a simple module.
Steps :
Quartus Prime
. Create a empty project and specify the name of the project and top-file as ip_test
.IP Catalog
. We'll choose our IP from here.IP Catalog
go to Library
-> Basic Functions
-> Arithmetic
. Double click on ALTSQRT
. A new window like Figure 31 will appear. Give the name as ip_sqrt
and press OK
.Finish
to create the IP.In the Project Navigator (on the top left hand side of software) set the setting on Files. Now you can see the ip core ip_sqrt.qip
. Go to sub-level, and open ip_sqrt.v
. Now the inputs and outpus of ip core can be seen.
Add a verilog source to project with name of top module which you have already named it. Copy the inputs and outputs of ip core into this file.
Make an instantiation of ip core in your top module.
Add your test bench file in your project and configure required setting.
module ip_test(radical, q, remainder); input [7:0] radical; output [3:0] q; output [4:0] remainder; ip_sqrt uut(.radical(radical),.q(q),.remainder(remainder)); endmodule
`timescale 1ns/1ps module ip_test_tb(); reg [7:0] radical; wire [3:0] q; wire [4:0] remainder; ip_test uut(.radical(radical),.q(q),.remainder(remainder)); initial begin radical = 8'd0; # 100 radical = 8'd72; # 100 radical = 8'd36; # 100 $finish; end endmodule
Hit Start Analysis and Synthesis
button.
After finishing the analysis and synthesis successfully, go to Tools
-> Run Simulation Tool
-> RTL Simulation
. Then the ModelSim window will load.
You can also run a gate level simulation:
Tools
-> Run Simulation Tool
-> Gate Level Simulation