Strange behaviour: it does not run anymore ! Calibre in Background +Skill

Discussion in 'Cadence' started by bedoune, Jun 25, 2008.

  1. bedoune

    bedoune Guest

    Hello All,

    Once again, i need your help.

    I wrote a skill program that runs Calibre in background with a GUI.
    Thanks to your advices, Calibre does not freeze dfII during the run.

    To run Calibre, i need first to source a setup file.

    The code i used was almost this one:

    com = strcat("source " Myfile)
    csh(com)

    com = strcat("calibre ... ")

    CCSipcBeginProcessWithUserData(
    Com ;; run calibre
    "" ;; hostname
    'DataHandler
    'DataHandler
    'ExitProc
    CvList
    )

    where CCSipcBeginProcessWithUserData is a function written by andrew
    and found on sourcelink.

    Sometimes, this code works very fine. and sometimes, i get the error
    message:
    sh : calibre : not found

    I think i need to run my 'source...' and my 'calibre ...' on one
    stroke, like
    com = strcat(" ' csh -c source" Myfile " ; calibre ...' " )
    CCSipcBeginProcessWithUserData(
    Com
    ...
    )

    but in this case, the error message i get is:
    sh: csh -c source ... : not found

    so , do you have an idea on how to merge my 2 commands to be executed
    in one stroke by CCSipcBeginProcessWithUserData() function ??

    Thanks a lot for your help.

    Regards,

    b.
     
    bedoune, Jun 25, 2008
    #1
  2. I thought I'd answered this before. The command you'd need is

    csh -c 'source filename; calibre'

    so you'll need

    com = strcat("csh -c 'source " Myfile " ; calibre ...'" )

    You had quotes in the wrong place, and spaces missing. I assume the Com in the
    CCSipcBeginProcessWithUserData vs the com in the above statement was a typo you
    don't have in your actual code?

    I cannot see how the original:

    com = strcat("source " Myfile)
    csh(com)

    com = strcat("calibre ... ")

    can have worked, because the csh() would have executed as a child process, which
    sourced the file, and then exited. Any environment changes it made would have
    been limited to the child csh, and not passed back to the DFII parent.
    Consequently, it would not affect the calibre job you launched. This is basic
    UNIX stuff, nothing to do with Cadence, that child processes inherit their
    environment, but do not affect the environment of the launching (parent) process.

    The only way I can see that launching calibre would have worked is that it was
    in your $PATH before you started Virtuoso.

    Regards,

    Andrew.
     
    Andrew Beckett, Jun 25, 2008
    #2
  3. bedoune

    bedoune Guest

    hello Andrew,

    you're right, i made a mistake with char ' . Even if it's basic unix
    command, i didn't know this one.

    Thanks to your advices, Calibre runs every time now. thanks a lot.
    Calibre is running in background, and dfII is not frozen. I can
    continue to work.

    But i have another problem that i don't understand.

    When i run calibre (drc for example ) on a small cell (run time of 2
    or 3 minutes ), i can work in another cell ... during this time, my
    program is on going and then finish "normally".

    When i run a drc on a "big" cell (calibre runs during 20 minutes for
    example), and if i work in another cell, my skill program does not
    execute my ExitProc() procedure. so my program does not exit normally.

    If i don't work in another during calibre run time, all is ok.

    I don't understand why it's ok for short run times and why it's not ok
    for "long" run time.
    do you have an idea ?

    thanks and regards,

    b.
     
    bedoune, Jun 26, 2008
    #3
  4. Sorry, I'd have to see it, most likely. It's quite possible that there are some
    symptoms you're misinterpreting here. Also, I've no idea what your whole program
    is doing and what the interactions are, etc, etc.

    Regards,

    Andrew.
     
    Andrew Beckett, Jun 26, 2008
    #4
  5. bedoune

    bedoune Guest

    Hello Andrew,

    Let me describe what my program does:

    From my cellview, i run my Drc UI.
    A specific folder is created : Foo/CellName/Drc ; this folder will
    contain all results files from Calibre.
    Options files are created for stream out and drc.

    Then i push my "ok" button. Pushing ok makes the active cellview in
    read only, creates a gds, and
    runs the following command:
    CCSipcBeginProcessWithUserData(
    Com ;; run
    calibre
    "" ;;
    hostname
    'DataHandler
    'DataHandler
    'ExitProc
    CvList
    )

    Com is the command described above, in the last posts.

    CvList contains my cellview Id and the path Foo/CellName/Drc

    My ExitProc procedure is very simple:
    just putting my cellview in 'append mode' and then
    csh("Nedit " error files).

    Nothing else.


    so, when calibre runs, i cannot work in my cell (because read only)
    as df II is not frozen, i can work in another cell.

    so, if i run a drc on a big cell (like a top cell), calibre runs
    during 20 minutes (for example).

    During this 20 minutes, if i decide to watch rain, my ExitProc
    procedure is executed and error files are displayed.

    But if i decide to work in another cell, my ExitProc is not executed.
    Calibre finished normally and error files are created, but not
    displayed. And my cellview is still in read only.
    Just ExitProc is not executed. It's unfortunate.


    But if i run a drc on a small cell (calibre run time of 2-3 minutes),
    i can work in another cell without worries: error files
    are displayed.

    I hope you will have enough informations to help me ^^'
    Let me know otherwise.


    do you have an idea ?

    thanks and regards,

    b.
     
    bedoune, Jun 27, 2008
    #5
  6. bedoune

    S. Badel Guest

    I think I have had problems in the past with exit handlers not being executed for obscure reasons.
    Unfortunately, I can not remember if I managed to solve it or not... (I know, it doesn't help).

    Wild question : do you know that there's an existing interface for calibre to plug into virtuoso ?
    It basically does what you are doing, so it would be just as easy to use it...

    Good luck anyway,
    Stéphane
     
    S. Badel, Jun 27, 2008
    #6
  7. bedoune

    bedoune Guest

    Bonjour Stephane,

    When you do speak about the calibre inteface, do you think at Calibre
    RVE ?

    If it's this one, we don't use it in my company because of price :(
    I've ever used Calibre RVE. Indeed, it's very useful.

    Or do you think about another interface ?

    Thanks and regards,

    b.
     
    bedoune, Jun 27, 2008
    #7
  8. bedoune

    S. Badel Guest

    Hello,

    Actually yes and no. The interface I'm talking of is a SKILL interface that provides Calibre menus
    in Virtuoso ; it allows to run DRC, LVS and LPE with just a few mouseclicks and takes care of
    streaming out the GDS file. You can also see the results in DRV and error markers cross-highlighted
    in Virtuoso.

    I must admit I did not think of the license issue, whether it's shipped with every calibre license
    or specifically with RVE, I do not know that. At first sight you might need a calibre interactive
    license.

    You can check for the file $MGC_HOME/shared/pkgs/icv/tools/queryskl/skillREADME


    Stéphane
     
    S. Badel, Jun 27, 2008
    #8
  9. The likely scenario is that some error is occurring in your exit handler, and
    you're not seeing it. See my sourcelink solution 11300060 which talks about this
    and how to workaround it so you can see the errors.

    But I'd also take Stephane's advice on the availability of existing interfaces
    to Calibre rather than reinventing the wheel...

    Regards,

    Andrew.
     
    Andrew Beckett, Jun 27, 2008
    #9
  10. bedoune

    bedoune Guest

    hello,

    thanks a lot for your answers.
    Unfortunately, to use any existing UI, we need to buy licenses. That's
    why i need to develop an UI by myself. Of course, i would prefer to
    save my time, and keep focusing on my main job.

    Anyway, if someone knows about free calibre UI compatible with
    virtuoso, it will be a pleasure for me to use it ^^

    I will let you know later the results of andrew-san's advice .

    thanks and regards,

    b.
     
    bedoune, Jun 27, 2008
    #10
  11. bedoune

    bedoune Guest

    Hi,

    I tried the solution 11300060.

    the errset function is very useful. If i introduce some bad code, the
    error is caught and a message is displayed in the CIW.

    Unfortunately, in my program, the Exit Handler is sometimes not
    executed, and errset did not catch any error ...

    I don't understand why. It's unpredictible, and i can not repeat this
    "bug".

    What i did:

    procedure(foo()
    errset(IpcProc() t)
    )


    procedure(IpcProc()
    CCSipcBeginProcessWithUserData(...)
    )

    thanks a lot for your lights.

    Regards,

    b.
     
    bedoune, Jul 3, 2008
    #11
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.