Vivado create project and simulation

1. Create a project

Create Project:

image-20220910152735413


Next

image-20220910153051410


Fill in the project name, select the project location, Next:

image-20220910153552097


Select the RTL project, check it Do not specify sources at the time, that is, do not add source files, Next:

image-20220910154925725


Select chip type, Next:

image-20220910155232641


Finish

image-20220910155250316



2. Add Verlog design files


1. Add tv file

Add Sources

image-20220910155717438


Choose the second one, Next:

image-20220910155749774


Create File

image-20220910155807474


Select the file type, fill in the file name, OK:

image-20220910160443001


Finish

image-20220910160531279


Define the input and output ports of the module, do not set it temporarily, directly OK:

image-20220910160630613


2. Write the document

Double-click to open the file:

image-20220910160757570

image-20220910160820544


write:

`timescale 1ns / 1ps
//
// Company: 
// Engineer: 
// 
// Create Date: 2022/09/10 16:06:39
// Design Name: 
// Module Name: t
// Project Name: 
// Target Devices: 
// Tool Versions: 
// Description: 
// 
// Dependencies: 
// 
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
// 
//


module t(
    input   wire    a,
    input   wire    b,
    
    output  wire    c,
    output  wire    d,
    output  wire    e,
    output  wire    f
);

    assign c = ~a;
    assign d = a & b;
    assign e = a | b;
    assign f = a ^ b;


endmodule



3. Add simulation files


1. Add t_tb.v file

image-20220910164616029

Add a simulation file and fill in the name:

image-20220910164711138


OK

image-20220910164726003


Yes

image-20220910164851870


2. Write the document

open a file:

image-20220910164949638


write:

`timescale 1ns / 1ps
//
// Company: 
// Engineer: 
// 
// Create Date: 2022/09/10 16:48:54
// Design Name: 
// Module Name: t_tb
// Project Name: 
// Target Devices: 
// Tool Versions: 
// Description: 
// 
// Dependencies: 
// 
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
// 
//


module t_tb(

    );
    
    parameter   CYCLE   =   20;
    
    reg     clk;
    
    reg     a;
    reg     b;
    
    wire    c;
    wire    d;
    wire    e;
    wire    f;
    
    
    always #(CYCLE / 2) clk = ~clk;
    
    initial begin
        clk = 0;
        a = 1'b0;
        b = 1'b0;
        repeat(10) begin
            a = {
    
    $random};
            b = {
    
    $random};
            # (CYCLE * 5);
        end
        
        $finish;
    end
    
    
    t t_t(
       /*input   wire*/  .a(a),
       /*input   wire*/  .b(b),

       /*output  wire*/  .c(c),
       /*output  wire*/  .d(d),
       /*output  wire*/  .e(e),
       /*output  wire*/  .f(f)
    );
    
endmodule


4. Simulation


1. Run the simulation

Run the simulation:

image-20220910171210991


View the simulated waveform:

image-20220910171310843


2. Simulation waveform operation

button operate
I expand
O zoom out
Shift + mouse wheel move left and right

Right-click to add a waveform:

image-20220910171837359

Change the waveform color:

image-20220910171920620


Modify the base representation:

image-20220910172010491


some shortcut keys

button Function
CTRL + D Copy the line where the cursor is
CTRL +/ single line comment
CTRL + SHITF + / multiline comment

reference

FPGA creation project

Detailed introduction to the use of Xilinx Vivado

CTRL + D | copy the line where the cursor is located|
| CTRL + /| single-line comment|
| CTRL + SHITF + /| multi-line comment|

reference

FPGA creation project

Detailed introduction to the use of Xilinx Vivado

Guess you like

Origin blog.csdn.net/weixin_46628481/article/details/126797977
Recommended