How to manage different class in different file

In reply to dave_59:

Dear Dave

I have added `include “xxxx.sv” into my_pkg.sv as you mentioned

First question is

Based on your information, Only Class definition should be in package. Am I on correct approach? (interface.sv should be in tb_top ?)

Second question is

I have modified my_pkg.sv as below
#########################
package my_pkg;
include "reg_item.sv" include “driver.sv”
include "monitor.sv" include “scoreboard.sv”
include "test.sv" include “environment.sv”
endpackage
#########################

However, I still got error as below
#####################################################################################

vlog -reportprogress 300 -incr “+cover=bcestf” -f filelist.f

– Skipping package my_pkg

– Skipping interface reg_if

** Error: (vlog-13069) tb_top.sv(25): near “;”: syntax error, unexpected ‘;’, expecting ‘(’.

** Error: tb_top.sv(32): (vlog-2730) Undefined variable: ‘t0’.

– Compiling module reg_ctrl

End time: 13:08:17 on Aug 19,2020, Elapsed time: 0:00:00

Errors: 2, Warnings: 0

** Error: C:/questasim64_10.5b/win64/vlog failed.

Error in macro ./Compile.do line 1

C:/questasim64_10.5b/win64/vlog failed.

while executing

“vlog -incr +cover=bcestf -f filelist.f”

#####################################################################################

Did I miss something? or Do I have to include or import “test class” on tb_top separately?

I hope you can comment on my mistake.

Thank you