|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
各位:
我在继续被UVM折腾。今天的新问题是virtual sequence相关的。我有两个sequence,一个是APB总线写的sequence,另外一个是往video口发送一帧图像sequence。这样的话,我需要使用virtual sequence来给这两个sequence同步,计划先发送APB的sequence,然后再发送图像数据,模拟先配置再开始工作的过程。但是仿真跑起来后,遇到一个问题,就是仿真开始时候进入apb_seq执行,前面的打开文件,统计要发多少个数据都没问题,到了`uvm_do_with()宏的时候就卡住了,根本发不了数据。不知道究竟是哪里不对了。好像我这么描述问题有点乱,还是贴代码吧:
virtual sequencer:
class vsequencer extends uvm_sequencer;
apb_sequencer apb_sqr;
vdo_sequencer vod_sqr;
`uvm_component_utils(vsequencer)
function new(string name,uvm_component parent);
super.new(name,parent);
endfunction
endclass : vsequencer
test_seq_lib:
`include "apb_seq_lib.sv"
`include "vdo_seq_lib.sv"
`include "vsequencer.sv"
class apb_vdo_seq extends uvm_sequence;
`uvm_object_utils(apb_vdo_seq)
`uvm_declare_p_sequencer(vsequencer)
task body();
apb_write_seq apb_seq;
read_two_1080p_bmp_seq vdo_seq;
`uvm_do_on(apb_seq,p_sequencer.apb_sqr)
`uvm_do_on(vdo_seq,p_sequencer.vdo_sqr)
endtask
endclass : apb_vdo_seq
test_lib:
`include "tb.sv"
class apb_vdo_test extends uvm_test;
`uvm_component_utils(apb_vdo_test)
tb tb0;
vsequencer vsqr;
extern function new(string name="apb_vdo_test",uvm_component parent);
function build_phase(uvm_phase phase);
super.build_phase(phase);
tb0 =tb::type_id::create("tb0",this);
vsqr=vsequencer::type_id::create("vsqr",this);
uvm_config_db#(uvm_object_wrapper)::set(this,"tb0.vsqr.run_phase","default_phase",apb_vdo_seq::type_id::get());
endfunction : build_phase
function connect_phase(uvm_phase phase);
vsqr.apb_sqr=tb0.apb0.master.sequencer;
vsqr.vdo_sqr=tb0.vdo0.master.sequencer;
endfunction : connect_phase
endclass : apb_vdo_test
然后apb_write_seq的body部分:
int num=0;
task apb_write_seq::body();
`uvm_info(get_type_name(),"Starting...",UVM_MEDIUM)
fp=$fopen("cfg1.f","r");
repeat(1024) begin
fpoint=$fscanf(fp,"%h",cfg_data);
$display("data in file is %h",cfg_data); ---------->仿真时,此行的信息能看见
`uvm_do_with(req,{req.addr==num;
req.direction==WRITE;
req.data=cfg_data;})------->从dump出的波形上看,apb总线上无任何翻转信号
$display("write one data over");---------------->仿真时,此行信息显示不出
end
endtask : body
谁来救救我呀~~~~~~~~ |
|