【timeunit/timeprecision 的坑】
上篇文章,我们一字一句的分析了语法书的介绍,今天列举一个小例子,这个实际中确实遇到过该问题带来的麻烦,耗费了一番功夫找出原因。今天分享给大家!为大家遇到该问题,快速找出bug定位,提供少许帮助。话不多说了,正题!
先看下面的一个例子。
tb_top.sv:
`timescale 10ps/1ps
module tb_top();
timeunit 1ns ;// 此处使用timeunit进行单位定义
timeprecision 1ps ;// 此处使用timeprecision 进行精度定义
reg clk,rst;
initial begin clk = 0; forever #5 clk = ~ clk;end
initial begin rst = 1'b0; #10 rst = 1; end
initial begin
run_test("helloworld_test") ;
end
initial begin
$fsdbDumpfile("tb_top.fsdb");
$fsdbDumpvars(0,"tb_top");
end
endmodule
uvm_helloworld.sv:
`ifndef HELLO