Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

VMM using Questa.6.6.

Altera_Forum
Honored Contributor II
5,852 Views

Hello Experts, 

 

We are working on one project based on VMM methodology so to compile it we are using Questasim. But we are facing a problem to run it. 

 

First it wasn't getting a path for VMM. 

 

So I downloaded the vmm package(vmm-1.1.1a/ vmm-1.2.2b), set the environment to  

--- Quote Start ---  

setenv VMM_HOME /../../Desktop/vmm-1.1.1a/ 

--- Quote End ---  

and compiled my program by using following command: 

 

--- Quote Start ---  

vlog -sv +incdir+$VMM_HOME/sv +incdir+$VMM_HOME/sv/std_lib/vmm_str_dpi.c +incdir+$VMM_HOME/sv/std_lib/vmm_xvc_dpi.c top_sv.sv 

--- Quote End ---  

Now it compiles the program successfully but gives error during simulation. The error is: 

 

--- Quote Start ---  

** Fatal: (vsim-3770) Failed to find user specified function 'vmm_str_match'. The search list was empty.# Using -sv_lib, -sv_root, and -sv_liblist arguments can provide a search list# FATAL ERROR while loading design# Error loading design 

--- Quote End ---  

for simulation we are using following command: 

 

--- Quote Start ---  

vsim -c top -do "run -all;quit" 

--- Quote End ---  

For compilation we also tried command given below: 

 

--- Quote Start ---  

vlog -sv +incdir+$VMM_HOME +incdir+/../../Desktop/program +define+vmm_NO_STR_DPI top_sv.sv 

--- Quote End ---  

But still it gives the same error. 

we are using Questa.6.6. 

 

Plz give me some idea to simulate it.
0 Kudos
36 Replies
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dave, 

 

How r u? 

 

I have solved that problem, by removing all the vmm log but i have one another query. 

 

So are u there now? 

 

Thanks and Regards, 

 

Dreku
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dreku, 

 

--- Quote Start ---  

 

I have solved that problem, by removing all the vmm log but i have one another query. 

 

--- Quote End ---  

 

 

Great! Were you able to get useful examples from the Verification Academy? 

 

 

--- Quote Start ---  

 

So are u there now? 

 

--- Quote End ---  

 

 

Yes.  

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dave, 

 

I was not present so didn't reply you. 

 

At this condition all the problems are solved. 

 

 

--- Quote Start ---  

]Thank you so much for co-operate me and guide me.[/B] 

--- Quote End ---  

 

 

Cheers, 

 

Regards 

Dreku
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dreku, 

 

 

--- Quote Start ---  

 

At this condition all the problems are solved. 

 

--- Quote End ---  

 

 

Great! 

 

 

--- Quote Start ---  

 

Thank you so much for co-operate me and guide me. 

 

--- Quote End ---  

 

 

You're most welcome. 

 

Regards, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dave, 

 

The same problem arises again. 

 

I am trying to simulate testcases but it gives me following error of vmm_str_match: 

 

 

--- Quote Start ---  

# ** Fatal: (vsim-160) /home/../../vmm-1.1.1a//sv/std_lib/vmm.sv(897): Null foreign function pointer encountered when calling 'vmm_str_match'# Time: 0 ns Iteration: 1 Process: /top/tb/#INITIAL#504 File: /home/../../vmm-1.1.1a//sv/std_lib/vmm.sv# Fatal error at /home/../../vmm-1.1.1a//sv/std_lib/vmm.sv line 897 

--- Quote End ---  

The HDL call sequence is: 

 

--- Quote Start ---  

HDL call sequence:# stopped at /home/../../vmm-1.1.1a//sv/std_lib/vmm.sv 897 # called from /home/../../vmm-1.1.1a//sv/std_lib/vmm_log.sv 1904 # called from /home/../../vmm-1.1.1a//sv/std_lib/vmm_log.sv 1159 # called from /home/../../vmm-1.1.1a//sv/std_lib/vmm_log.sv 988 # called from /home/../../vmm-1.1.1a//sv/std_lib/vmm_test.sv 163 # called from testcase.sv 521  

--- Quote End ---  

I use following commands for compilation and simulation: 

 

 

--- Quote Start ---  

compilation command

vlog -sv +incdir+$VMM_HOME/sv +incdir+$VMM_HOME/sv/std_lib/vmm_str_dpi.c +incdir+$VMM_HOME/sv/std_lib/vmm_xvc_dpi.c main_testcase.sv 

--- Quote End ---  

 

--- Quote Start ---  

simulation command

vsim -c -solvefaildebug main -do "run -all;quit"  

--- Quote End ---  

If i use -Lf switch during simulation than design is not loaded. 

 

Note: $VMM_HOME is set by: 

 

--- Quote Start ---  

setenv VMM_HOME ~/../vmm-1.1.1a/ 

--- Quote End ---  

Herewith I am attaching example files and standard library files. 

 

Thanking You, 

Dreku
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dave, 

 

The problem is solved by changing compilation and simulation commands. 

 

I include +incdir+$vmm_home/shared/lib/linux in compilation command and give a path of /home/../../vmm-1.1.1a//shared/lib/linux/vmm_str_dpi in simulation command. 

 

Now it is working properly. 

 

:-P 

Dreku
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dreku, 

 

--- Quote Start ---  

 

The problem is solved by changing compilation and simulation commands. 

 

I include +incdir+$vmm_home/shared/lib/linux in compilation command and give a path of /home/../../vmm-1.1.1a//shared/lib/linux/vmm_str_dpi in simulation command. 

 

Now it is working properly. 

 

--- Quote End ---  

 

 

Excellent! 

 

I was about to post an apology that I did not get a chance to look at the problem yet :) 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi dave, 

 

I have one tricky question here. I scratched my head but don't get answer of it.  

 

Its a question of OOPS. 

 

I have a three classes A, B and C and their members a,b and c respectively. 

 

Now i want to use members of this classes in another class D. Where first i declare instances of the above classes. Now I want to create objects in following fashion: 

 

A= new(B.b); 

B= new(C.c); 

C= new(A.a); 

 

It gives an error because in 1st statement B is not created yet and same for the second....... 

 

So how can i pass the argument of another class' member. 

 

:confused: 

dreku
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

It's not good OOP practice to use constructor arguments this way. It's much better to keep class constructors as simple as possible and only use arguments as required by their base classes. So construct your 3 classes first, then use methods to set the members you want after all classes are constructed. 

 

Dave Rich
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Thank you Dave, 

 

I am already using this way you suggest but in vmm_env's build method, we create instance of transactors. 

 

Now here we create instances of driver, monitor and scoreboard. Now i want to use notifications of one class in to another. Before i used to pass notification of particular class in to another class as an argument (now i know, this is not a good strategy). But my question is that is there any way to use constructor arguments in this way? 

Its just eager to know...... 

 

dreku...
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

There is no way to pass an object member of a class by value or by reference where the object has not been constructed yet. You will need to pass this information in after the build methods have completed. 

 

You might want to ask your VMM question on this forum (http://www.verificationguild.com/modules.php?name=forums&file=viewforum&f=3). Maybe they will have some alternative ways to deal with your issue.
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dave, 

 

I have got the solution of this issue. We can use typedef class for same. 

 

 

--- Quote Start ---  

example:(http://www.testbench.in/cl_19_typedef_class.html

typedef class X; 

class Y ; 

X x; // refers to Class X, which is not yet defined 

endclass 

 

class X; 

int i; 

endclass 

 

The typedef of class X allows the compiler to process Y before X is fully defined.  

--- Quote End ---  

:) 

dreku
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

What you just described is called a forward typedef. It allow you to declare a class variable that will hold a handle to another class object that has not been defined yet. 

 

I don't see how that helps with your circular constructor argument issue though.
0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi dave, 

 

Yes you are right, it didn't help me. In any case, if it is necessary to pass any object member than i need to take another function in corresponding class. 

 

 

--- Quote Start ---  

class A; 

int x; 

function pass_new_variable(int x); 

this.x=x; 

endfunction 

endclass 

 

class B; 

int y; 

function pass_new_variable(int y); 

this.y=y; 

endfunction 

endclass 

 

program main; 

A a; 

B b; 

 

initial begin 

a=new(); 

b=new(); 

a.pass_new_variable(b.y); 

b.pass_new_variable(a.x); 

end 

endprogram 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Hi Dave, 

 

How are you? 

 

I am here again with a basic query in systemverilog interface. I have a testbench, in TOP module of this tb there is a binding of instance of interface with instance of modport of same interface. 

 

--- Quote Start ---  

 

interface intf (input clock); 

modeport mport(); 

endinterface 

 

 

module my_module (intf.mport mport); 

endmodule 

 

 

module top; 

intf interfc (clock); 

 

my_module abc (.mport(interfc)); <== modeport's instance is binding with same interface's instance.... :confused:  

 

endmodule 

 

 

--- Quote End ---  

 

 

I can't figure out why we need to pass interface this way. Is there any special reason or just a flexibility of code? 

 

waiting for your reply. 

 

Regards, 

Dreku 

 

 

--- Quote Start ---  

I don't think you'll find too many people using Questa on this forum. 

 

Have you filed a service request with Mentor? 

 

http://supportnet.mentor.com/ 

 

Their support is really very good. 

 

 

 

Did you look to see where this function is defined in the VMM source? 

 

Cheers, 

Dave 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
1,280 Views

Different Dave here. 

 

There is nothing special about this code, but it is a bad programming practice to use the same identifier to represent two different things so close together. Normally people add a _mp extension to modport names.
0 Kudos
Reply