I’m a beginner to use package endpackage
I have used package which includes from base packet class to environment class.
package d_pkg; include "d_env.sv" include “d_sb.sv” include "d_mon.sv" include “d_drv.sv” include "d_gen.sv" include “d_con.sv”
`include “d_base.sv”
endpackage
then I called it through import d_pkg::*; from testcase class. but it is not calling any of the classes
import d_pkg::*;
class testcase;
virtual dff_if intf;
env env1;
config1 cfg1;
function new(virtual dff_if intf);
this.intf=intf;
env1=new(intf);
$display(“env created”);
endfunction
In reply to cgales:
yes I used instantiation of testcase class at testbench program block then I used top module from there I instantiate dut, testbench and interface.
`include “d_test.sv”
program testbench(dff_if.tb intf);
testcase test;
initial begin
test=new(intf);
test.run();
end
endprogram
//top module
include "ff_dut.sv" include “d_intf.sv”
`include “d_tb.sv”
Error: d_test.sv(4): Could not find the package (d_pkg). Design read will continue, but expect a cascade of errors after this failure. Furthermore if you experience a vopt-7 error immediately before this error then please check the package names or the library search paths on the command line.
** Error: d_test.sv(8): Invalid type ‘env’. Please check the type of the variable ‘env1’.
** Error: d_test.sv(9): Invalid type ‘config1’. Please check the type of the variable ‘cfg1’.