class my_case0 extends base_test;
`uvm_component_utils(my_case0)
virtual param_if param_if;
function new(string name = "my_case0", uvm_component parent = null);
//function new(string name, uvm_component parent);
super.new(name,parent);
endfunction
extern virtual function void build_phase(uvm_phase phase);
extern virtual function void connect_phase(uvm_phase phase);
task run_phase(uvm_phase phase);
begin
my_rst_seq my_seq= my_rst_seq::type_id::create("my_seq",this);
phase.raise_objection(this,"rst_ctrl_seq active");
my_seq.start(env.i_agt.m_sqr);
phase.drop_objection(this,"rst_ctrl_seq finished");
end
endtask : run_phase
endclass
function void my_case0::build_phase(uvm_phase phase);
super.build_phase(phase);
if(!uvm_config_db#(virtual param_if)::get(this,"","vif",param_if))
`uvm_info("my_case0","error",UVM_MEDIUM)
endfunction
/////////////////////
I get the following error:
** Error: (vsim-13216) Illegal assignment to type ‘virtual param_if’ from type ‘interface param_if #()’: Vir. ‘param_if’ interface must be assigned a matching interface or virtual interface.
The code you show includes the definition of param_if inside the module top_tb. You should not be doing that. If you are also compiling param_if outride the module, that creates two different definitions. Also, where is line 59 and why is it showing #() if the interface is not parametrized?
** Error: (vsim-13216) Illegal assignment to type ‘virtual param_if’ from type ‘interface param_if #()’: Vir. ‘param_if’ interface must be assigned a matching interface or virtual interface.
This might be caused by your compile order and strategy. including package files is always a bad approach.
Could you please show how your data are packed and how do you compile it?
In reply to designer007:
Are you really importing the test_pkg to the rst_agent_pkg? Looks quite strange.
And I do not see the param_pkg. Where do you compile this package?
sorry for confuse,
the original design is to test rst related design,
I just add some code to test the interface with param in pkg.
I compile param_pkg
in compile.do
////compile.do
quit -sim
rm -rf work
vlib work
vlog -timescale “10ps/10ps”
+incdir+./…
…/test_pkg.sv
*./param_pkg.sv *
In reply to designer007:
I believe your problem is here.
The param_pkg has to be compiled first because it is a package you are using in different places.
Afterwards you can compile the agent pkg and finally the test_pkg.
I have the impression you are not really familiar with the package approach.