PLI problem

Discussion in 'Cadence' started by Monika Talwar, May 14, 2004.

  1. ..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
     
    Monika Talwar, May 14, 2004
    #1
  2. Hi Monika,

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

    Andrew.
     
    Andrew Beckett, May 14, 2004
    #2
  3. Monika Talwar

    gennari Guest

    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
     
    gennari, May 15, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.