Verdi software steps
File preparation
Take a two-frequency module as an example to demonstrate the simplest way to use Verdi.
ClockDiv.v
`timescale 1ns / 1ps
//
// Company:
// Engineer:
//
// Create Date: 10/13/2020
// Design Name: Sniper
// Module Name: ClockDiv
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//
module ClockDiv(
input clk,
input rst_n,
output reg clk_div
);
always@(posedge clk or negedge rst_n)
begin
if(!rst_n)
clk_div <= 1'b0;
else
clk_div <= ~clk_div;
end
endmodule
tb_ClockDiv.v (note the part where the .fsdb file is generated)
`timescale 1ns / 1ps
//
// Company:
// Engineer:
//
// Create Date: 10/13/2020
// Author Name: Sniper
// Module Name: tb_ClockDiv
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//
module tb_ClockDiv;
//input
reg clk;
reg rst_n;
//output
wire clk_div;
initial
begin
clk = 0;
rst_n = 0;
#100;
rst_n = 1;
end
//clock
always #5 clk = ~clk;
//DUT
ClockDiv DUT
(
.clk(clk),
.rst_n(rst_n),
.clk_div(clk_div)
);
initial
begin
$fsdbDumpfile("curve.fsdb");
$fsdbDumpvars;
$fsdbDumpon;
end
initial #1000 $finish;
endmodule
Excuting an order
Enter the following command in Terminal to compile the file:
(It is recommended to write the command in a shell script and save it as a compile.sh file, and then use source compile.sh to run)
vcs -R ClockDiv.v tb_ClockDiv.v -P ${NOVAS_HOME}/share/PLI/VCS/linux64/novas.tab ${NOVAS_HOME}/share/PLI/VCS/linux64/pli.a -full64 -debug_all
If the following error appears:
it means that the environment variable is not set.
Enter gvim ~/.bashrc in the terminal to open the bashrc file and add the following
export NOVAS_HOME=$Synopsys_Dir/Verdi2015
export PATH=$NOVAS_HOME/bin:$PATH
Save and exit, terminal input source ~/.bashrc to apply the changes, re-source compile.sh
Successful operation is as follows:
View waveform
Enter verdi in Terminal to open the software
verdi #只打开verdi
verdi -f file_list.f -ssf curve.fsdb #这条命令可以在打开verdi软件的过程中直接打开项目文件和波形文件
#打开file后,在文件的代码中鼠标选中要观察的信号名字,再按Ctrl+w,可以直接观察选中信号的波形
First, minimize the welcome interface:
click to open the waveform:
select the waveform + drag with the left mouse button , and you can observe the waveform within the drag range.
Then, you can start debugging~~
If the code is updated later, you can click New Waveform under the menu view again to re-import the fsdb file and signal to view.