loadContext seg faults

Discussion in 'Cadence' started by Joel, Sep 13, 2006.

  1. Joel

    Joel Guest

    I have been trying to convert some skill code into a context. Whenever
    I load the context I run into problems working within Cadence.

    If I load the context at startup, icfb seg faults when I try to open a
    schematic window.

    If I delay loading the context until I get into ADE I get the following
    message repeatedly whenever I try to work within ADE. For example,
    selecting "Netlist and Run" gives the following two lines:
    ** GC: non-cons/nil in cdr slot of cons cell @ 0x0xce49034
    ** GC: non-cons/nil in cdr slot of cons cell @ 0x0xce49034

    The behaviour seems to be independent of what is in the context. I
    will reproduce the shortest path I have to a seg fault:

    $ cat mytest.il
    ;; Simple function
    procedure(MyHelloWorld()
    printf("Hello world!\n")
    )

    $ cat MakeContext.il
    ;; Simple create context
    procedure(MyMakeContext()
    setContext("mytest")
    load("mytest.il")
    saveContext("mytest.cxt")
    )
    MyMakeContext()
    exit()

    $ icfb -ilLoadIL MakeContext.il

    Then in icfb -nograph (or ocean):
    Hello world!
    t
    Loading oasis.cxt
    Loading analog.cxt
    Loading asimenv.cxt
    Segmentation fault


    Does anyone know what I am doing wrong?
     
    Joel, Sep 13, 2006
    #1
  2. You need to ensure you are loading all dependency contexts before doing the
    setContext. So if you change MakeContext.il to:

    procedure( getContext(cxt)
    ;;------------------------
    ;; Given a context name load the context into the session
    (let ((ff (prependInstallPath (strcat "etc/context/" cxt ".cxt"))))
    (cond ((null (isFile ff)) nil)
    ((null (loadContext ff))
    (printf "Failed to load context %s\n" cxt))
    ((null (callInitProc cxt))
    (printf "Failed to initialize context %s\n"
    cxt))
    (t (printf "Loading Context %s\n" cxt))
    )
    )
    )


    ;; Simple create context
    procedure(MyMakeContext()
    ; load functions needed.
    getContext("skillCore")
    getContext("hiBase")
    setContext("mytest")
    load("mytest.il")
    saveContext("mytest.cxt")
    )
    MyMakeContext()
    exit()


    it prevents the crash.

    Regards,

    Andrew.
     
    Andrew Beckett, Sep 19, 2006
    #2
  3. Joel

    Joel Guest

    That worked! Thank you very much. I sincerely appreciate the reply.
     
    Joel, Sep 19, 2006
    #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.