I'm using VCS and I don't see why class objects cannot be allocated in a package. The following code is working in VCS and ncverilog.
package pkg;
class Base;
int x;
function new();
x=1;
endfunction
function int value();
return x;
endfunction
endclass : Base
class C;
Base b;
function new();
b = new;
endfunction
function get();
return b.value();
endfunction
endclass : C
C d = new;
endpackage
pkg::C e = new;
module top;
import pkg::*;
C c;
initial begin
c = new;
$display("c=%d", c.get());
$display("d=%d", d.get());
$display("e=%d", e.get());
end
endmodule
But it is not a good coding style to declare such like global variable or instance in a package. The package should only be used to write declarations. Even you are not doing so in the package, but declare them outside the module/program/package, it belongs to $unit package. Of course, you can write class function body definition, functions or tasks, with any new operation for class instantiations. The idea of a package is the declaration only, so any classes, functions, tasks, net/variables are going to be imported to modules or programs.