Error in using VMM base class "vmm_data"

Hi,
I am working on some VMM based files, one of which having the VMM base class “vmm_data”. I use questa sim 10.0c for compiling the files. There are some errors regarding “vmm_data” class.
The code is as follows -

class myclass extends vmm_data;


extern function vmm_data copy(vmm_data to = null);


endclass

but on compiling the file it gives error that -
near “vmm_data” : syntax error, unexpected IDENTIFIER
Error in class extension specification
near “copy” : syntax error, unexpected IDENTIFIER, expecting ‘;’

i have also compiled the “wishbone” files given in the kit VMM-1.1.1a(available in the download section of this site) which also contains the base class “vmm_data” and that “vmm_data copy” function but it didn’t give me any error and compiled properly.

Please help me in solving this issue.
Thanks,
Deepak

Are you using VMM as a package and importing it, or just compiling the VMM in the same compilation unit?

In reply to dave_59:

i am not using it as a package, i am compiling it with my other project files in same compilation unit by including the VMM directory in compilation command of “make file”.

In reply to deepak2407:

It’s going to be hard to help you without seeing the actual command lines produced by the make file. An I hope you really understand what a compilation unit is by reading this.

In reply to dave_59:

The command line i am using is -
vlog -mfcu -sv +incdir+$(VMM_HOME)/sv +incdir+…/…/bfm/top +incdir+…/…/bfm/prot +incdir+…/…/bfm/phy +incdir+…/…/bfm/include +incdir+…/qsim …/qsim/device_tb.sv

here device_tb is the top level module in which i am including “vmm.sv” file and two other files and both these two files importing(wildcard) a package(“bfm_package”).

when compilation is done by taking bfm_package as top level module then no any compilation error is there but when device_tb is taken as top level module then those errors are there.

In reply to deepak2407:

Does the bfm_package also `include the “vmm.sv” file? How does it get compiled? And where is the myclass file in all of this?

You can’t `include “vmm.sv” more than once.

Another article you may want to read is Package import versus `include.

But it is not affecting the compilation (when “device_tb.sv” is taken as top level module) whether i am including “vmm.sv” in “bfm_package” or not.

To compile the package as top level module i have to include “vmm.sv” in package file otherwise the compilation gives same errors as previously mentioned.

“my_class” is present in phy directory(…/…/bfm/phy).

Compilation is done without error with taking “device_tb.sv” as top when instead of importing “bfm_package” i just included the files(which are included in the package) and remove the package. But how it will work using package?

In reply to deepak2407:

You can’t include "vmm.sv" more than once. Please read my article about package import versus include.

You will need to compile the VMM as a package and then import into your bfm_package as well as import it into your device_tb.

In reply to dave_59:

Ok i got it, problem is resolved thanks.