ovm sequence里可否取得configure变量?
时间:12-12
整理:3721RD
点击:
tb_top中用ovm_container设了一个全局interface的configuration,在sequence中可否取得这个变量呢?code如下:
//////////////////////////////////////////
//tb_top.sv
module tb_top;
include "a_if.sv"
typedef virtual a_if v_a_if;
a_if a_if_0();
...
initial begin
ovm_container #(v_a_if)::set_value_in_global_config("TOP_A_IF", a_if_0);
end
endmodule
//base_sequence.sv
class base_sequence extends ovm_sequence;
typedef virtual a_if v_a_if;
v_a_if a_if_seq;
task body()
a_if_seq = ovm_container #(v_a_if)::get_value_from_config(this, "TOP_A_IF");
endtask
endclass
////////////////////////////////////////////////////////////////
Qesta编译通过,但是运行的时候报了如下错误
illegal assignment to class type ovm_component [in mtiOvm/ovm_pkg::ovm_component] from class type base_sequence
哪位大侠知道是怎么回事么?谢谢!
//////////////////////////////////////////
//tb_top.sv
module tb_top;
include "a_if.sv"
typedef virtual a_if v_a_if;
a_if a_if_0();
...
initial begin
ovm_container #(v_a_if)::set_value_in_global_config("TOP_A_IF", a_if_0);
end
endmodule
//base_sequence.sv
class base_sequence extends ovm_sequence;
typedef virtual a_if v_a_if;
v_a_if a_if_seq;
task body()
a_if_seq = ovm_container #(v_a_if)::get_value_from_config(this, "TOP_A_IF");
endtask
endclass
////////////////////////////////////////////////////////////////
Qesta编译通过,但是运行的时候报了如下错误
illegal assignment to class type ovm_component [in mtiOvm/ovm_pkg::ovm_component] from class type base_sequence
哪位大侠知道是怎么回事么?谢谢!
多谢指点,不过我用别的方法暂时把问题解决了,这个有空再试吧。