A couple of problems with your code:
- You forgot to import ovm_pkg
- The constructor should have no return type - void
- ‘this’ is not valid outside of a non-static method.
Here is the example that works for me
module top;
import ovm_pkg::*;
class scoreboard extends ovm_component;
// `ovm_component_utils(scoreboard)
typedef ovm_component_registry #(scoreboard, "scoreboard") type_id;
function new(input string name = "scoreboard",
input ovm_component parent = null);
super.new(name, parent);
endfunction
endclass : scoreboard
scoreboard scb;
initial begin
//scb = new();
scb = scoreboard::type_id::create("scoreboard", null);
end
endmodule
Dave