Factory create method not working

Hi,

I am working on a uvm project where i am getting error on creating a class object using factory create method. But the same class is getting created by the new constructor. this is error i am getting when i am using factory create method. Although all the other class are getting created by the factory create method.
code: sb = router_scoreboard::type_id::create(“sb”,this);

“this.sb = uvm_component_registry#(tb_top.router_scoreboard,“router_scoreboard”)::create(“sb”, this, /* contxt = “\000” */);”
Expression
‘uvm_component_registry#(tb_top.router_scoreboard,“router_scoreboard”)::create(“sb”,
this, )’ on rhs is not a class or a compatible class and hence cannot be
assigned to a class handle on lhs.
Please make sure that the lhs and rhs expressions are compatible.

In reply to Rana Adeel Ahmad:

Check that your `uvm_component_utils() is correct in your scoreboard.

// UVM component utility macro
uvm_component_utils_begin(router_scoreboard) uvm_field_enum(comp_t, comparer_policy, UVM_ALL_ON)
`uvm_component_utils_end

this is macro i have declared for the scoreboard in my scoreboard class.

In reply to Rana Adeel Ahmad:

It is difficult to determine without seeing all the code that generates the failing message, but the ‘uvm_component_registry’ part of the error message seems strange. The type ‘tb_top.router_scoreboard’ seems strange, as I would expect just the class type ‘router_scoreboard’.

Do you have a class or module called tb_top?
Is the router_scoreboard part of a package?
Is router_scoreboard extended from uvm_component?

thanks problem solved.

In reply to Rana Adeel Ahmad:

It might help to explain what your mistake was so others can benefit.

Well I was getting an error in router_tb file where i was creating my scoreboard class. So problem was that in my tb_top module I included using `include router_tb file before the including scoreboard file. So i included scoreboard before router_tb file and the error was resolved.