In reply to dave_59:
the stim.sv is compiled separately. As in, in a package , there are a list of files included, one of them is stim.sv: like:
package bus_agent;
include "file1.sv"
include “stim.sv”
endpackage
Another thing I tried was : in the above stim.sv file, I removed the import packageA and used only include , like as follows:
`include “packageA.sv”;
class stim;
abc obj1;
packageA::obj1 = new();
…
endclass
Now, the error is: packageA.sv(1) near “package”: syntax error, unexpected package, expecting class.
Can a package have a class within it as I’ve shown above and what would be a correct way to include/import packageA in stim.sv. Note: packageA comes from a different directory structure (from another team. This is suposed to be shared). So, I can only include/import packageA and use it.