Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Error in Questasim simulation

Status
Not open for further replies.

dharag

Newbie level 5
Newbie level 5
Joined
Mar 24, 2014
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
66
Hello,

I am using Questasim for verification of VHDL and SV files. In generator class run task I am giving the input from a .DAT file and I am facing an error for the same. Error is

"Error: (vsim PLI-3084) : $fscanf: Argument 1 is not a valid file descriptor"

Code is:
int i;
int D;
i = $fscanf(fp,"%d",D);

file pointer fp is passed through environment class run task.

Please help me to come out of this error :thinker:
Thanks in advance
 

Hello,

fp is the file pointer in the environment class run task

int fp;
fp = $fopen("file_for_input.dat","r");

this fp is passed to genereator run task and when I am displaying value of fp in generator block it displays 0.
 

So either $fopen failed, or you are not passing fp correctly to the generator run task.
Did you check the value of fp right after you opened the file?
 

Thanks Dave Rich for your response, I have solved the same and you were right my file was not being opened due to some directory issues. Now its working fine...

- - - Updated - - -

Also Thanks Rahul for your suggestion, my code is now running perfectly
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top