PLI problem

M

Monika Talwar

Guest
..Hello,

I am working on creating PLI for the verilog code.
It gives segmentation fault.
Initilally, the application linked successfully and simulated well.
But
while quiting the simulation after the exit statement, the simulator
was
print following statements

ncsim> exit
ncsim: *internal* (sv_seghandler - trapno -1).
ncsim: *internal* (sv_seghandler - SIGSEGV while handling SIGSEGV).

In my C code, I was using some static data structure to which i was
allocating memory more than once without de-allocating the previous
memory,
to use it for different features.

I then resolved the memory allocation problem by creating seperate
data-stucture for each requitement.

But the changes led to blunder. The simulator now terminates the
simulation
at runtime, after printing following message

ncsim: *internal* (sv_seghandler - SIGSEGV while handling SIGSEGV).

I am unable to figure out wat is the problem.
I call the PLI routine once only and thats in initial block of the
verilog code. I never call the pli routine afterwards.

Moreover, the segmentation fault problem is with NS-simulator only. I
used the same pli with Modelsim without any problem.

Please reply at the earliest as i am struck because of this.

I am using 05.00-p001 version of ncverilog

I will be greatful of your help.

Next Unread
 
Hi Monika,

Without seeing the code, it would be nigh on impossible to figure this out,
sorry!

Andrew.

On 14 May 2004 07:02:38 -0700, monikatalwar@hotmail.com (Monika Talwar) wrote:

.Hello,

I am working on creating PLI for the verilog code.
It gives segmentation fault.
Initilally, the application linked successfully and simulated well.
But
while quiting the simulation after the exit statement, the simulator
was
print following statements

ncsim> exit
ncsim: *internal* (sv_seghandler - trapno -1).
ncsim: *internal* (sv_seghandler - SIGSEGV while handling SIGSEGV).

In my C code, I was using some static data structure to which i was
allocating memory more than once without de-allocating the previous
memory,
to use it for different features.

I then resolved the memory allocation problem by creating seperate
data-stucture for each requitement.

But the changes led to blunder. The simulator now terminates the
simulation
at runtime, after printing following message

ncsim: *internal* (sv_seghandler - SIGSEGV while handling SIGSEGV).

I am unable to figure out wat is the problem.
I call the PLI routine once only and thats in initial block of the
verilog code. I never call the pli routine afterwards.

Moreover, the segmentation fault problem is with NS-simulator only. I
used the same pli with Modelsim without any problem.

Please reply at the earliest as i am struck because of this.

I am using 05.00-p001 version of ncverilog

I will be greatful of your help.

Next Unread
--
Andrew Beckett
Senior Technical Leader
Custom IC Solutions
Cadence Design Systems Ltd
 
The problem is likely with your code and not with the Verilog simulator.
You're probably writing to an invlaid memory address. Do you use arrays in
the C code? If so, the easiest way to locate common errors is to make sure
every access of the arrays or other dynamically allocated memory was within
the allocated bounds. The errors you get will be different beacuse the
memory allocation depends on the state of the operating system. In the
original case where it crashed in the end of the call you probably had the
same error, but it didn't crash during the runtime execution because the
invalid memory address still belonged to your program in that case.

Frank

"Monika Talwar" <monikatalwar@hotmail.com> wrote in message
news:e71b773.0405140602.f647cd3@posting.google.com...
.Hello,

I am working on creating PLI for the verilog code.
It gives segmentation fault.
Initilally, the application linked successfully and simulated well.
But
while quiting the simulation after the exit statement, the simulator
was
print following statements

ncsim> exit
ncsim: *internal* (sv_seghandler - trapno -1).
ncsim: *internal* (sv_seghandler - SIGSEGV while handling SIGSEGV).

In my C code, I was using some static data structure to which i was
allocating memory more than once without de-allocating the previous
memory,
to use it for different features.

I then resolved the memory allocation problem by creating seperate
data-stucture for each requitement.

But the changes led to blunder. The simulator now terminates the
simulation
at runtime, after printing following message

ncsim: *internal* (sv_seghandler - SIGSEGV while handling SIGSEGV).

I am unable to figure out wat is the problem.
I call the PLI routine once only and thats in initial block of the
verilog code. I never call the pli routine afterwards.

Moreover, the segmentation fault problem is with NS-simulator only. I
used the same pli with Modelsim without any problem.

Please reply at the earliest as i am struck because of this.

I am using 05.00-p001 version of ncverilog

I will be greatful of your help.

Next Unread
 

Welcome to EDABoard.com

Sponsor

Back
Top