I am working on example project (edaplayground)
It is divided into two different files (DUT & testbench)
testbench has several classes in one file
When I compile two files, no problem exist
However, when I divided testbench into several files (based on class name), then I compile with “filelist.f” such as
############################
filelist.f
############################
reg_ctrl.sv #<-- DUT
reg_item.sv
driver.sv
monitor.sv
scoreboard.sv
environment.sv
interface.sv
test.sv
tb_top.sv
############################
However, I got compile error as below
#################################################################################################################
QuestaSim-64 vlog 10.5b Compiler 2016.05 May 21 2016
Start time: 12:52:10 on Aug 18,2020
vlog -reportprogress 300 -incr “+cover=bcestf” -f filelist.f
– Skipping module reg_ctrl
– Compiling package reg_item_sv_unit
** Error: (vlog-13069) driver.h(6): near “driver”: syntax error, unexpected IDENTIFIER.
** Error: driver.h(6): (vlog-13205) Syntax error found in the scope following ‘class’. Is there a missing ‘::’?
** Error: (vlog-13069) monitor.h(6): near “monitor”: syntax error, unexpected IDENTIFIER.
** Error: monitor.h(6): (vlog-13205) Syntax error found in the scope following ‘class’. Is there a missing ‘::’?
** Error: (vlog-13069) scoreboard.h(6): near “scoreboard”: syntax error, unexpected IDENTIFIER.
** Error: scoreboard.h(6): (vlog-13205) Syntax error found in the scope following ‘class’. Is there a missing ‘::’?
** Error: (vlog-13069) environment.h(17): near “env”: syntax error, unexpected IDENTIFIER.
** Error: environment.h(17): (vlog-13205) Syntax error found in the scope following ‘class’. Is there a missing ‘::’?
** Warning: environment.h(17): (vlog-2283) Extra semicolon in $unit (global) scope.
** Warning: scoreboard.h(6): (vlog-2283) Extra semicolon in $unit (global) scope.
** Warning: monitor.h(6): (vlog-2283) Extra semicolon in $unit (global) scope.
** Warning: driver.h(6): (vlog-2283) Extra semicolon in $unit (global) scope.
** Error: (vlog-13069) test.h(3): near “test”: syntax error, unexpected IDENTIFIER.
** Error: test.h(3): (vlog-13205) Syntax error found in the scope following ‘class’. Is there a missing ‘::’?
** Error: (vlog-13069) tb_top.sv(21): near “;”: syntax error, unexpected ‘;’, expecting ‘(’.
** Error: tb_top.sv(28): (vlog-2730) Undefined variable: ‘t0’.
** Warning: test.h(3): (vlog-2283) Extra semicolon in $unit (global) scope.
End time: 12:52:10 on Aug 18,2020, Elapsed time: 0:00:00
Errors: 12, Warnings: 5
** 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?
Can you tell me how to divide classes into different files?
Thank you