-
Notifications
You must be signed in to change notification settings - Fork 685
Open
Labels
area: elaborationIssue involves elaboration phaseIssue involves elaboration phasestatus: readyIssue is ready for someone to fix; then goes to 'status: assigned'Issue is ready for someone to fix; then goes to 'status: assigned'
Description
Another type_id case that got added to a future UVM release, as noted in #5826, but different case.
Below gives: `
%Error: Package/class for ':: reference' not found: 'type_id'
18 | t = BUSTYPE::type_id::create("t");
@kbieganski analyzed (thanks) and: "This case seems to break because of the default type parameter. uvm_object doesn't have type_id, but we try to link BUSTYPE::type_id (=uvm_object::type_id) in LinkDot which fails. We can defer it until after V3Param but then the instance with default params is still around, so we revisit it and have the same problem. We'd have to delete the default instances if unused after V3Param. I'm not familiar enough with that stage to know how difficult that is.
Which also sounds related to #4581 et al.
`define stop $stop
`define checks(gotv,expv) do if ((gotv) != (expv)) begin $write("%%Error: %s:%0d: got='%s' exp='%s'\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0);
package uvm_pkg;
virtual class uvm_void;
endclass
virtual class uvm_object extends uvm_void;
endclass
class uvm_report_object extends uvm_object;
endclass
virtual class uvm_component extends uvm_report_object;
endclass
class uvm_reg_predictor #(type BUSTYPE=uvm_object) extends uvm_component;
static function string type_name();
static string m_type_name;
if (m_type_name == "") begin
BUSTYPE t;
t = BUSTYPE::type_id::create("t");
m_type_name = {"uvm_reg_predictor #(", t.get_type_name(), ")"};
end
return m_type_name;
endfunction
endclass
endpackage
class my_bus extends uvm_pkg::uvm_component;
typedef my_bus type_id;
static function type_id create(string name);
endfunction
static function string get_type_name();
return "my_bus";
endfunction
endclass
module t;
initial begin
string s;
uvm_pkg::uvm_reg_predictor #(my_bus) rp;
rp = new;
s = rp.type_name();
`checks(s, "uvm_reg_predictor #(my_bus)");
$display("*-* All Finished *-*");
$finish;
end
endmodule
Metadata
Metadata
Assignees
Labels
area: elaborationIssue involves elaboration phaseIssue involves elaboration phasestatus: readyIssue is ready for someone to fix; then goes to 'status: assigned'Issue is ready for someone to fix; then goes to 'status: assigned'