本文的实例二相对于上一篇的实例一有以下变化:
- 实例二在env中采用了
default_sequence
隐式的方式启动sequence发送数据,不同于上文中的start
显式方式启动; - 实例二中添加了新的数据包,该包继承原来的包,增补了约束,用于后续的覆盖;
- 实例二增加了测试用例,在测试用例中利用
factory
机制,实现了数据包packet_da_3对于packet的覆盖(override),而不用新建sequence,提高了代码的重用性。 - 在
test_collection.sv
中的分别采用了set_inst_override_by_type()
和set_type_override_by_type()
方法实现数据包的覆盖,由于用来覆盖的数据包一致,所以最终效果一致。
文章目录
1.packet.sv(数据包)
`ifndef PACKET_SV
`define PACKET_SV
class packet extends uvm_sequence_item;
rand bit[3:0] sa;
rand bit[3:0] da;
rand bit[7:0] payload[$]; //1.声明随机变量
rand int j;
`uvm_object_utils_begin(packet) //2.注册
`uvm_field_int(sa, UVM_ALL_ON | UVM_NOCOMPARE)
`uvm_field_int(da, UVM_ALL_ON)
`uvm_field_int(j, UVM_ALL_ON)
`uvm_field_queue_int(payload, UVM_ALL_ON)
`uvm_object_utils_end
constraint valid{ //3.添加约束
payload.size inside {[1:10]};
j == payload.size;
}
function new(string name="packet"); //4.new()构造函数
super.new(name);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
endclass
`endif
2.packet_da_3.sv(添加约束包)
`ifndef PACKET_DA_3_SV
`define PACKET_DA_3_SV
class packet_da_3 extends packet;
`uvm_object_utils(packet_da_3)
constraint da_3{
da == 3;
}
function new(string name="packet_da_a"); //4.new()构造函数
super.new(name);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
endclass
`endif
3.packet_sequence.sv(生产数据)
`ifndef PACKET_SEQUENCE_SV
`define PACKET_SEQUENCE_SV
`include "packet.sv" //0.将数据包引入sequence中
class packet_sequence extends uvm_sequence#(packet);
`uvm_object_utils(packet_sequence) //1.注册
function new(string name="packet_sequence"); //2.new()构造函数
super.new(name);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
virtual task body(); //3.产生数据,对数据包随机化赋值
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
if(starting_phase != null) //在env中使用default_sequence隐式启动seq时,采用starting_phase变量
starting_phase.raise_objection(this,"starting"); //挂起objection
repeat(10)begin //设置发包数目为10,调用uvm_do宏
`uvm_do(req); //在参数化继承时,默认例化了包,例化名默认req
end
if(starting_phase != null)
starting_phase.drop_objection(this,"done"); //落下objection
endtask
endclass
`endif
4.driver.sv(驱动数据)
`ifndef DRIVER_SV
`define DRIVER_SV
class driver extends uvm_driver#(packet);
`uvm_component_utils(driver) //1.注册
function new(string name,uvm_component parent); //2.new()构造函数
super.new(name,parent);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
virtual task run_phase(uvm_phase phase); //3.按照协议处理数据
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
forever begin
seq_item_port.get_next_item(req); //通过TLM端口申请数据
req.print(); //数据按时序协议处理
seq_item_port.item_done(); //数据处理完毕,通知driver开始下一次数据传输
end
endtask
endclass
`endif
5.input_agent.sv(代理)
`ifndef INPUT_AGENT_SV
`define INPUT_AGENT_SV
`include "packet_sequence.sv"
`include "driver.sv" //引入packet_sequence.sv和driver.sv文件
typedef uvm_sequencer#(packet) packet_sequencer; //定义sequencer发送数据
class input_agent extends uvm_agent;
`uvm_component_utils(input_agent) //1.注册,声明子组件
packet_sequencer seqr;
driver drv;
function new(string name,uvm_component parent); //2.new()构造函数,确定父子关系
super.new(name,parent);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
virtual function void build_phase(uvm_phase phase); //3.在build_phase阶段实例化子组件
super.build_phase(phase);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
seqr = packet_sequencer::type_id::create("seqr",this); //实例化子组件
drv = driver::type_id::create("drv",this); //实例化子组件
endfunction
virtual function void connect_phase(uvm_phase phase); //4.在connect_phase阶段建立seqr与drv之间的连接
super.connect_phase(phase);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
drv.seq_item_port.connect(seqr.seq_item_export); //建立drv与seqr之间的连接
endfunction
endclass
`endif
6.router_env.sv(环境)
`ifndef ROUTER_ENV_SV
`define ROUTER_ENV_SV
`include "input_agent.sv" //将agent引入env中
class router_env extends uvm_env;
`uvm_component_utils(router_env) //1.注册
input_agent i_agent; //声明子组件
function new(string name,uvm_component parent); //2.new()构造函数,确定父子关系
super.new(name,parent);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
virtual function void build_phase(uvm_phase phase); //3.在build_phase阶段实例化子组件
super.build_phase(phase);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
i_agent = input_agent::type_id::create("i_agent",this); //实例化子组件
uvm_config_db#(uvm_object_wrapper)::set(this,"i_agent.seqr.main_phase","default_sequence",packet_sequence::get_type());
//采用default_sequence方式隐式启动seq,区别于(一)中的start()显式方式启动
endfunction
endclass
`endif
7.test_collection.sv(测试用例,覆盖+增补)
`ifndef TEST_COLLECTION_SV
`define TEST_COLLECTION_SV
`include "router_env.sv" //将env引入test中
class test_base extends uvm_test; //基础用例
`uvm_component_utils(test_base) //1.注册
router_env env; //声明子组件
function new(string name,uvm_component parent); //2.new()构造函数,确定父子关系
super.new(name,parent);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
virtual function void build_phase(uvm_phase phase); //3. 实例化子组件
super.build_phase(phase);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
env = router_env::type_id::create("env",this);
endfunction
virtual function void start_of_simulation_phase(uvm_phase phase); //4.打印拓扑结构
super.start_of_simulation_phase(phase);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
uvm_top.print_topology(); //打印uvm的拓扑结构
factory.print(); //打印覆盖类型
endfunction
endclass
`include "packet_da_3.sv" //引入数据包
class test_da_3_inst extends test_base; //**测试用例1继承与基础用例**
`uvm_component_utils(test_da_3_inst) //1.注册
function new(string name,uvm_component parent); //2.new()构造函数,确定父子关系
super.new(name,parent);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
virtual function void build_phase(uvm_phase phase); //3. (局部)数据包覆盖
super.build_phase(phase);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
set_inst_override_by_type("env.i_agent.seqr.*",packet::get_type(),packet_da_3::get_type()); //
endfunction
endclass
class test_da_3_type extends test_base; //**测试用例2继承与基础用例**
`uvm_component_utils(test_da_3_type) //1.注册
function new(string name,uvm_component parent); //2.new()构造函数,确定父子关系
super.new(name,parent);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
endfunction
virtual function void build_phase(uvm_phase phase); //3. (全局)数据包覆盖
super.build_phase(phase);
`uvm_info("TRACE",$sformatf("%m"),UVM_HIGH)
set_type_override_by_type(packet::get_type(),packet_da_3::get_type()); //
endfunction
endclass
`endif
8.test.sv(主代码,启动UVM)
program automatic test;
import uvm_pkg::*;
`include "uvm_macros.svh"
`include "test_collection.sv" //引入测试用例
initial begin
$timeformat(-9,1,"ns",10);
run_test();
end
endprogram
9.Makefile(make编译)
TB_TOP = ./test.sv
test = test_base
verbosity = UVM_MEDIUM
uvm_ver = uvm-1.1
seed = 1
defines = UVM_NO_DEPRECATED+UVM_OBJECT_MUST_HAVE_CONSTRUCTOR
SOLVER = 2
all: compile run
compile:
vcs -full64 -sverilog -ntb_opts ${uvm_ver} -timescale=1ns/1ns -l comp.log -debug_acc+all +vcs+vcdpluson ${TB_TOP} +define+${defines}
run:
./simv -l simv.log +ntb_random_seed=${seed} +UVM_TESTNAME=${test} +ntb_solver_mode=${SOLVER} +UVM_VERBOSITY=${verbosity}
clean:
rm -rf simv* csrc* *.tmp *.vpd *.key *.log *.h .vcs* DVE*
10.运行结果分析
执行 test_base
- 执行
make
,运行运行test_base
,从run_test
打印的UVM_INFO
信息也可以看出,如下图:
- UVM拓扑结构,也可以在其中看到顶层testcase是test_base,如下图:
- UVM工厂覆盖如下图,可以看到目前没有instance或者type覆盖。
- transaction数据包的打印信息如下图,可以看到类型是default_sequence中启动的packet_sequence pack类型数据包。
- 详细log信息如下:
Command: /home/verifier/2023/router/blog/blog-3/./simv -l simv.log +ntb_random_seed=1 +UVM_TESTNAME=test_base +ntb_solver_mode=2 +UVM_VERBOSITY=UVM_MEDIUM
Chronologic VCS simulator copyright 1991-2018
Contains Synopsys proprietary information.
Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 28 01:51 2023
----------------------------------------------------------------
UVM-1.1d.Synopsys
(C) 2007-2013 Mentor Graphics Corporation
(C) 2007-2013 Cadence Design Systems, Inc.
(C) 2006-2013 Synopsys, Inc.
(C) 2011-2013 Cypress Semiconductor Corp.
----------------------------------------------------------------
VCD+ Writer O-2018.09-SP2_Full64 Copyright (c) 1991-2018 by Synopsys Inc.
UVM_INFO @ 0.0ns: reporter [RNTST] Running test test_base...
UVM_INFO @ 0.0ns: reporter [UVMTOP] UVM testbench topology:
--------------------------------------------------------------
Name Type Size Value
--------------------------------------------------------------
uvm_test_top test_base - @455
env router_env - @463
i_agent input_agent - @471
drv driver - @610
rsp_port uvm_analysis_port - @627
seq_item_port uvm_seq_item_pull_port - @618
seqr uvm_sequencer - @487
rsp_export uvm_analysis_export - @495
seq_item_export uvm_seq_item_pull_imp - @601
arbitration_queue array 0 -
lock_queue array 0 -
num_last_reqs integral 32 'd1
num_last_rsps integral 32 'd1
--------------------------------------------------------------
#### Factory Configuration (*)
No instance or type overrides are registered with this factory
All types registered with the factory: 47 total
(types without type names will not be printed)
Type Name
---------
driver
input_agent
packet
packet_da_3
packet_sequence
router_env
snps_uvm_reg_bank_group
snps_uvm_reg_map
test_base
test_da_3_inst
test_da_3_type
(*) Types with no associated type name will be printed as <unknown>
####
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @659
sa integral 4 'h8
da integral 4 'hf
j integral 32 'h9
payload da(integral) 9 -
[0] integral 8 'hc3
[1] integral 8 'h2
[2] integral 8 'hf6
[3] integral 8 'hc6
[4] integral 8 'hda
[5] integral 8 'h76
[6] integral 8 'haf
[7] integral 8 'hde
[8] integral 8 'hc9
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @664
sa integral 4 'hb
da integral 4 'hf
j integral 32 'h7
payload da(integral) 7 -
[0] integral 8 'h3f
[1] integral 8 'hc5
[2] integral 8 'h75
[3] integral 8 'hff
[4] integral 8 'hb6
[5] integral 8 'hf9
[6] integral 8 'h82
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @668
sa integral 4 'h2
da integral 4 'h7
j integral 32 'h1
payload da(integral) 1 -
[0] integral 8 'hb
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @672
sa integral 4 'hd
da integral 4 'h4
j integral 32 'ha
payload da(integral) 10 -
[0] integral 8 'h77
[1] integral 8 'hab
[2] integral 8 'hf5
[3] integral 8 'h73
[4] integral 8 'h64
[5] integral 8 'h48
[6] integral 8 'hd8
[7] integral 8 'h21
[8] integral 8 'h1f
[9] integral 8 'hf0
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @676
sa integral 4 'hc
da integral 4 'h8
j integral 32 'h9
payload da(integral) 9 -
[0] integral 8 'he4
[1] integral 8 'h76
[2] integral 8 'hfd
[3] integral 8 'h87
[4] integral 8 'h41
[5] integral 8 'h31
[6] integral 8 'hb1
[7] integral 8 'h5f
[8] integral 8 'h53
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @680
sa integral 4 'hb
da integral 4 'hf
j integral 32 'h9
payload da(integral) 9 -
[0] integral 8 'h4b
[1] integral 8 'h84
[2] integral 8 'hda
[3] integral 8 'h48
[4] integral 8 'h6
[5] integral 8 'h77
[6] integral 8 'h1
[7] integral 8 'hd
[8] integral 8 'h6d
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @684
sa integral 4 'hd
da integral 4 'ha
j integral 32 'h3
payload da(integral) 3 -
[0] integral 8 'h80
[1] integral 8 'h72
[2] integral 8 'h1b
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @688
sa integral 4 'h2
da integral 4 'h2
j integral 32 'ha
payload da(integral) 10 -
[0] integral 8 'h2a
[1] integral 8 'hc5
[2] integral 8 'ha6
[3] integral 8 'h75
[4] integral 8 'h41
[5] integral 8 'h20
[6] integral 8 'hd8
[7] integral 8 'hee
[8] integral 8 'hf1
[9] integral 8 'h7d
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @692
sa integral 4 'h9
da integral 4 'h7
j integral 32 'h5
payload da(integral) 5 -
[0] integral 8 'hbc
[1] integral 8 'h87
[2] integral 8 'ha
[3] integral 8 'h22
[4] integral 8 'h36
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet - @696
sa integral 4 'h9
da integral 4 'h9
j integral 32 'h6
payload da(integral) 6 -
[0] integral 8 'hec
[1] integral 8 'h44
[2] integral 8 'h3e
[3] integral 8 'h49
[4] integral 8 'h79
[5] integral 8 'h4
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 2
UVM_WARNING : 0
UVM_ERROR : 0
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[UVMTOP] 1
$finish called from file "/opt/synopsys/vcs/vcs-mx/O-2018.09-SP2/etc/uvm-1.1/base/uvm_root.svh", line 439.
$finish at simulation time 0.0ns
V C S S i m u l a t i o n R e p o r t
Time: 0 ns
CPU Time: 0.320 seconds; Data structure size: 0.4Mb
Tue Mar 28 01:51:16 2023
执行 test_da_3_inst,进行inst局部覆盖
- 运行命令
make test=test_da_3_inst
,可以看到run_test打印出的testcase信息,如下图。
- UVM拓扑结构中也可以看到,顶层testcase是test_da_3_inst,如下图:
- Factory工厂打印出inst覆盖:
- transaction信息如下,可以看到传输的类型已经是packet_da_3了,并且该transaction中的约束da=3也生效了。
- 详细log信息如下:
Command: /home/verifier/2023/router/blog/blog-3/./simv -l simv.log +ntb_random_seed=1 +UVM_TESTNAME=test_da_3_inst +ntb_solver_mode=2 +UVM_VERBOSITY=UVM_MEDIUM
Chronologic VCS simulator copyright 1991-2018
Contains Synopsys proprietary information.
Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 28 01:57 2023
----------------------------------------------------------------
UVM-1.1d.Synopsys
(C) 2007-2013 Mentor Graphics Corporation
(C) 2007-2013 Cadence Design Systems, Inc.
(C) 2006-2013 Synopsys, Inc.
(C) 2011-2013 Cypress Semiconductor Corp.
----------------------------------------------------------------
VCD+ Writer O-2018.09-SP2_Full64 Copyright (c) 1991-2018 by Synopsys Inc.
UVM_INFO @ 0.0ns: reporter [RNTST] Running test test_da_3_inst...
UVM_INFO @ 0.0ns: reporter [UVMTOP] UVM testbench topology:
--------------------------------------------------------------
Name Type Size Value
--------------------------------------------------------------
uvm_test_top test_da_3_inst - @455
env router_env - @463
i_agent input_agent - @471
drv driver - @610
rsp_port uvm_analysis_port - @627
seq_item_port uvm_seq_item_pull_port - @618
seqr uvm_sequencer - @487
rsp_export uvm_analysis_export - @495
seq_item_export uvm_seq_item_pull_imp - @601
arbitration_queue array 0 -
lock_queue array 0 -
num_last_reqs integral 32 'd1
num_last_rsps integral 32 'd1
--------------------------------------------------------------
#### Factory Configuration (*)
Instance Overrides:
Requested Type Override Path Override Type
-------------- ------------------------------- -------------
packet uvm_test_top.env.i_agent.seqr.* packet_da_3
No type overrides are registered with this factory
All types registered with the factory: 47 total
(types without type names will not be printed)
Type Name
---------
driver
input_agent
packet
packet_da_3
packet_sequence
router_env
snps_uvm_reg_bank_group
snps_uvm_reg_map
test_base
test_da_3_inst
test_da_3_type
(*) Types with no associated type name will be printed as <unknown>
####
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @659
sa integral 4 'h9
da integral 4 'h3
j integral 32 'h2
payload da(integral) 2 -
[0] integral 8 'he7
[1] integral 8 'h1d
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @664
sa integral 4 'hc
da integral 4 'h3
j integral 32 'ha
payload da(integral) 10 -
[0] integral 8 'hb7
[1] integral 8 'h42
[2] integral 8 'hb8
[3] integral 8 'h4e
[4] integral 8 'h34
[5] integral 8 'h30
[6] integral 8 'hd0
[7] integral 8 'h3
[8] integral 8 'h68
[9] integral 8 'h4a
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @668
sa integral 4 'hc
da integral 4 'h3
j integral 32 'h7
payload da(integral) 7 -
[0] integral 8 'h2a
[1] integral 8 'h83
[2] integral 8 'ha8
[3] integral 8 'h41
[4] integral 8 'hc5
[5] integral 8 'hb1
[6] integral 8 'hb0
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @672
sa integral 4 'h2
da integral 4 'h3
j integral 32 'h3
payload da(integral) 3 -
[0] integral 8 'h5b
[1] integral 8 'hbe
[2] integral 8 'hd9
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @676
sa integral 4 'ha
da integral 4 'h3
j integral 32 'h9
payload da(integral) 9 -
[0] integral 8 'hf6
[1] integral 8 'hef
[2] integral 8 'h5
[3] integral 8 'h3e
[4] integral 8 'hde
[5] integral 8 'h43
[6] integral 8 'h1b
[7] integral 8 'he3
[8] integral 8 'h5f
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @680
sa integral 4 'h3
da integral 4 'h3
j integral 32 'h6
payload da(integral) 6 -
[0] integral 8 'hb0
[1] integral 8 'h8d
[2] integral 8 'hf0
[3] integral 8 'h7a
[4] integral 8 'h38
[5] integral 8 'h1e
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @684
sa integral 4 'h5
da integral 4 'h3
j integral 32 'h9
payload da(integral) 9 -
[0] integral 8 'h48
[1] integral 8 'h1d
[2] integral 8 'h4b
[3] integral 8 'haf
[4] integral 8 'hd2
[5] integral 8 'ha1
[6] integral 8 'hd6
[7] integral 8 'h2b
[8] integral 8 'h6
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @688
sa integral 4 'ha
da integral 4 'h3
j integral 32 'h4
payload da(integral) 4 -
[0] integral 8 'h5d
[1] integral 8 'ha3
[2] integral 8 'hf7
[3] integral 8 'h3b
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @692
sa integral 4 'hf
da integral 4 'h3
j integral 32 'h7
payload da(integral) 7 -
[0] integral 8 'h91
[1] integral 8 'h96
[2] integral 8 'h29
[3] integral 8 'h4a
[4] integral 8 'hff
[5] integral 8 'hf9
[6] integral 8 'h33
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @696
sa integral 4 'hc
da integral 4 'h3
j integral 32 'h4
payload da(integral) 4 -
[0] integral 8 'h65
[1] integral 8 'h87
[2] integral 8 'ha7
[3] integral 8 'hb8
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 2
UVM_WARNING : 0
UVM_ERROR : 0
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[UVMTOP] 1
$finish called from file "/opt/synopsys/vcs/vcs-mx/O-2018.09-SP2/etc/uvm-1.1/base/uvm_root.svh", line 439.
$finish at simulation time 0.0ns
V C S S i m u l a t i o n R e p o r t
Time: 0 ns
CPU Time: 0.320 seconds; Data structure size: 0.4Mb
Tue Mar 28 01:57:59 2023
执行 test_da_3_type,进行type全局覆盖
分析内容,同上述两个,这里直接上图:
- log信息如下:
Command: /home/verifier/2023/router/blog/blog-3/./simv -l simv.log +ntb_random_seed=1 +UVM_TESTNAME=test_da_3_type +ntb_solver_mode=2 +UVM_VERBOSITY=UVM_MEDIUM
Chronologic VCS simulator copyright 1991-2018
Contains Synopsys proprietary information.
Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 28 02:09 2023
----------------------------------------------------------------
UVM-1.1d.Synopsys
(C) 2007-2013 Mentor Graphics Corporation
(C) 2007-2013 Cadence Design Systems, Inc.
(C) 2006-2013 Synopsys, Inc.
(C) 2011-2013 Cypress Semiconductor Corp.
----------------------------------------------------------------
VCD+ Writer O-2018.09-SP2_Full64 Copyright (c) 1991-2018 by Synopsys Inc.
UVM_INFO @ 0.0ns: reporter [RNTST] Running test test_da_3_type...
UVM_INFO @ 0.0ns: reporter [UVMTOP] UVM testbench topology:
--------------------------------------------------------------
Name Type Size Value
--------------------------------------------------------------
uvm_test_top test_da_3_type - @455
env router_env - @463
i_agent input_agent - @471
drv driver - @610
rsp_port uvm_analysis_port - @627
seq_item_port uvm_seq_item_pull_port - @618
seqr uvm_sequencer - @487
rsp_export uvm_analysis_export - @495
seq_item_export uvm_seq_item_pull_imp - @601
arbitration_queue array 0 -
lock_queue array 0 -
num_last_reqs integral 32 'd1
num_last_rsps integral 32 'd1
--------------------------------------------------------------
#### Factory Configuration (*)
No instance overrides are registered with this factory
Type Overrides:
Requested Type Override Type
-------------- -------------
packet packet_da_3
All types registered with the factory: 47 total
(types without type names will not be printed)
Type Name
---------
driver
input_agent
packet
packet_da_3
packet_sequence
router_env
snps_uvm_reg_bank_group
snps_uvm_reg_map
test_base
test_da_3_inst
test_da_3_type
(*) Types with no associated type name will be printed as <unknown>
####
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @659
sa integral 4 'h9
da integral 4 'h3
j integral 32 'h2
payload da(integral) 2 -
[0] integral 8 'he7
[1] integral 8 'h1d
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @664
sa integral 4 'hc
da integral 4 'h3
j integral 32 'ha
payload da(integral) 10 -
[0] integral 8 'hb7
[1] integral 8 'h42
[2] integral 8 'hb8
[3] integral 8 'h4e
[4] integral 8 'h34
[5] integral 8 'h30
[6] integral 8 'hd0
[7] integral 8 'h3
[8] integral 8 'h68
[9] integral 8 'h4a
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @668
sa integral 4 'hc
da integral 4 'h3
j integral 32 'h7
payload da(integral) 7 -
[0] integral 8 'h2a
[1] integral 8 'h83
[2] integral 8 'ha8
[3] integral 8 'h41
[4] integral 8 'hc5
[5] integral 8 'hb1
[6] integral 8 'hb0
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @672
sa integral 4 'h2
da integral 4 'h3
j integral 32 'h3
payload da(integral) 3 -
[0] integral 8 'h5b
[1] integral 8 'hbe
[2] integral 8 'hd9
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @676
sa integral 4 'ha
da integral 4 'h3
j integral 32 'h9
payload da(integral) 9 -
[0] integral 8 'hf6
[1] integral 8 'hef
[2] integral 8 'h5
[3] integral 8 'h3e
[4] integral 8 'hde
[5] integral 8 'h43
[6] integral 8 'h1b
[7] integral 8 'he3
[8] integral 8 'h5f
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @680
sa integral 4 'h3
da integral 4 'h3
j integral 32 'h6
payload da(integral) 6 -
[0] integral 8 'hb0
[1] integral 8 'h8d
[2] integral 8 'hf0
[3] integral 8 'h7a
[4] integral 8 'h38
[5] integral 8 'h1e
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @684
sa integral 4 'h5
da integral 4 'h3
j integral 32 'h9
payload da(integral) 9 -
[0] integral 8 'h48
[1] integral 8 'h1d
[2] integral 8 'h4b
[3] integral 8 'haf
[4] integral 8 'hd2
[5] integral 8 'ha1
[6] integral 8 'hd6
[7] integral 8 'h2b
[8] integral 8 'h6
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @688
sa integral 4 'ha
da integral 4 'h3
j integral 32 'h4
payload da(integral) 4 -
[0] integral 8 'h5d
[1] integral 8 'ha3
[2] integral 8 'hf7
[3] integral 8 'h3b
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @692
sa integral 4 'hf
da integral 4 'h3
j integral 32 'h7
payload da(integral) 7 -
[0] integral 8 'h91
[1] integral 8 'h96
[2] integral 8 'h29
[3] integral 8 'h4a
[4] integral 8 'hff
[5] integral 8 'hf9
[6] integral 8 'h33
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Name Type Size Value
------------------------------------------------------------------------------------------------
req packet_da_3 - @696
sa integral 4 'hc
da integral 4 'h3
j integral 32 'h4
payload da(integral) 4 -
[0] integral 8 'h65
[1] integral 8 'h87
[2] integral 8 'ha7
[3] integral 8 'hb8
begin_time time 64 0.0ns
depth int 32 'd2
parent sequence (name) string 15 packet_sequence
parent sequence (full name) string 45 uvm_test_top.env.i_agent.seqr.packet_sequence
sequencer string 29 uvm_test_top.env.i_agent.seqr
------------------------------------------------------------------------------------------------
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 2
UVM_WARNING : 0
UVM_ERROR : 0
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[UVMTOP] 1
$finish called from file "/opt/synopsys/vcs/vcs-mx/O-2018.09-SP2/etc/uvm-1.1/base/uvm_root.svh", line 439.
$finish at simulation time 0.0ns
V C S S i m u l a t i o n R e p o r t
Time: 0 ns
CPU Time: 0.350 seconds; Data structure size: 0.4Mb
Tue Mar 28 02:09:37 2023