Problem in loading SKILL file! Processes???

Discussion in 'Cadence' started by Reotaro Hashemoto, Jun 25, 2009.

  1. Hi,

    I've created a simple file that contains set of commands calling
    functions, this file looks like:

    myCreateNetlist(libName cell1 list(par11 val11 par21 val21 par31
    val31))
    myCreateNetlist(libName cell2 list(par12 val12 par22 val22 par32
    val32))
    myCreateNetlist(libName cell3 list(par13 val13 par23 val23 par33
    val33))
    .....

    The function myCreateNetlist() is based on calling Calibre netlisting
    function:
    _mgc_rve_create_cdl_netlist()

    This function uses si somehow to create the netlist through
    ipcBeginProcess (i cant see in the file any usage of ipcWait...)

    This is part of the skill_query file in Calibre: ($CALIBRE_HOME/shared/
    pkgs/icv/tools/queryskl/mgc_export.skl)

    ......
    procedure( _mgc_rve_create_cdl_netlist(libName cellName viewName
    fileName "tttt")
    prog( (si_cmd)
    mgc_rve_set_cdlout_keys(libName cellName viewName
    fileName)
    when( mgc_rve_globals->show_cdl_dlg && !
    mgc_rve_export_cdl_dlg(t)
    return()
    ) ; when
    printf("\n*** Calibre Interactive: Exporting netlist
    for cell %s ***\n" cellName)
    g_mgcExportCdlConnectFile = fileName
    when( mgc_rve_create_sienv_file()
    si_cmd = mgc_rve_export_netlist_cmd(libName
    cellName viewName fileName)
    ipcBeginProcess(si_cmd "" 'mgc_rve_cdl_handler
    'mgc_rve_cdl_handler 'mgc_rve_cdl_postFunc)
    ) ; when
    return(t)
    ) ; prog
    ) ; _mgc_rve_create_cdl_netlist
    ......

    What happens is:
    when I load the file of commands, it stops after processing first
    line, although if i executed line by line in CIW it works!!!

    Should I somehow wait for each command to be executed?

    I've tried to use ipcSkillProcess() together with ipcWaitForProcess()
    but reached nothing...

    Any suggestions?

    Thanks,
    Ahmad
     
    Reotaro Hashemoto, Jun 25, 2009
    #1
  2. Reotaro Hashemoto

    Riad KACED Guest

    Dear Ahmad,

    The _mgc_rve_create_cdl_netlist() function is running ipc in a
    synchroneoes mode, communicating using the data and exit handlers. So
    there is no need to ipcWait in this instance.
    I'm busy these to create something to run on your example, but if you
    post a simple version of your myCreateNetlist() that I could run as it
    is then I could help more. Sorry, I'm usually more helpful but hardly
    finding any spare time now ... Besides, the Calibre command has got a
    postFunc. Well i don't see any reason for it to stop your process but
    it's good to know what it is doing anyway.

    Looking forward for your details.

    Regards,
    Riad.
     
    Riad KACED, Jun 25, 2009
    #2
  3. Reotaro Hashemoto

    Ahmad Guest

    Salamu alaykom Riad,

    Thanks a lot for your reply. An exact example to re-produce my
    situation is to create a file (let's call: "calNetlistEx.il") and load
    in CIW, the file can simply contain:

    ;=============== Start here ======================
    libName="anyExistingLib" ;; Please replace with any existing lib
    you've
    cellName="anySchematicCellInThisLib" ;; Put the name of any cell name
    (schematic)

    _mgc_rve_create_netlist(libName cellName "schematic" strcat(libName
    cellName "_1.spi"))
    _mgc_rve_create_netlist(libName cellName "schematic" strcat(libName
    cellName "_2.spi"))
    _mgc_rve_create_netlist(libName cellName "schematic" strcat(libName
    cellName "_3.spi"))
    _mgc_rve_create_netlist(libName cellName "schematic" strcat(libName
    cellName "_4.spi"))
    _mgc_rve_create_netlist(libName cellName "schematic" strcat(libName
    cellName "_5.spi"))
    _mgc_rve_create_netlist(libName cellName "schematic" strcat(libName
    cellName "_6.spi"))
    _mgc_rve_create_netlist(libName cellName "schematic" strcat(libName
    cellName "_7.spi"))

    ;==================== End here =========================

    When u load this file in CIW, you'll notice that it creates the last
    netlist only, although if u tried to copy and paste commands directly
    one by one in CIW (rather than loading the file) it works! Seems like
    it's somehow overloaded..

    Does that make sense? Do u have an idea to solve?

    Thanks and best regards,
    Ahmad
     
    Ahmad, Jun 27, 2009
    #3
  4. Reotaro Hashemoto

    Riad KACED Guest

    Hi Ahmad,

    This does not work because the underlying program, i.e. "si" is
    running the job in the same area. Your jobs are eventually overriding
    each other, look at the CDS.log to see that thinks are getting
    overwritten.
    In your case, you need to write your own skill code that invoke 'si'
    in a synchronous mode, i.e run the first export, wait up until it
    finishes, run the 2nd and so on .... Multiple invoke of that Calibre
    command on the same lib/cell/view is not the right way in your case.

    Regards,
    Riad.
     
    Riad KACED, Jun 29, 2009
    #4
  5. Reotaro Hashemoto

    Ahmad Guest

    Hello Riad,

    Thanks a lot for your time to test and reply.

    So, how should I write the SKILL code of 'si' invocation?

    Best regards,
    Ahmad
     
    Ahmad, Jun 29, 2009
    #5
  6. Reotaro Hashemoto

    Riad KACED Guest

    Salam Ahmad,

    Pretty easy, just look at the Cadence's Design Data Translator’s
    Reference Manual, $CDSHOME/doc/transref/transref.pdf or use cdsdoc/
    cdnshelp
    Look at section: Running CDL Out from the Command Line. This says:
    1. Prepare the si.env file.
    Among other information, the si.env file carries the name of the
    design to be netlisted. For more information, see the section
    Preparing an si.env File on page 223.
    2. Type the following at the command line:
    si -batch -command netlist

    I let you read the remaining of it.

    So if we go back to your calibre function example, then one could make
    use of function _mgc_rve_create_cdl_netlist since it does create the
    si.env file upon the skil global variable cdlOutKeys. It does also set
    the batch command for you. All you need is to replace the asynchronous
    ipc call by a synchronous one, i.e run a first export, wait, run a
    second etc ...

    This is a bit of code I have made for you (minimum update of the
    _mgc_rve_create_cdl_netlist function). Give it a look and update it at
    your convenience ! try it using the code you have posted earlier,
    changing _mgc_rve_create_netlist call by AhmadcreateCdlNetlist.
    A bit of doc reading, curiosity and reverse-engineering and ... Bob's
    your uncle :)

    Cheers,
    Riad !

    procedure( AhmadcreateCdlNetlist(libName cellName viewName fileName
    "tttt")
    prog( (pid si_cmd)
    mgc_rve_set_cdlout_keys(libName cellName viewName fileName)
    when( mgc_rve_globals->show_cdl_dlg && !mgc_rve_export_cdl_dlg(t)
    return()
    ) ; when
    printf("\n*** Exporting netlist for cell %s ***\n" cellName)
    g_mgcExportCdlConnectFile = fileName
    when( mgc_rve_create_sienv_file()
    si_cmd = mgc_rve_export_get_cdl_cmd(libName cellName viewName
    fileName)
    pid=ipcBeginProcess(si_cmd)
    ipcWait(pid)
    printf("%L" ipcReadProcess(pid))
    ) ; when
    return(t)
    ) ; prog
    ) ; AhmadcreateCdlNetlist
     
    Riad KACED, Jun 30, 2009
    #6
  7. Reotaro Hashemoto

    Ahmad Guest

    Thanks a lot Riad for the help...

    I was out of the office for a while so I couldn't test it.

    Unfortunately, using your code with ipcWait() didn't solve the
    problem.

    I still get the same error message:
    "si: Simulation is already running in run directory "blablabla".\n"

    Using a delay (through long for loop for around 20 seconds solved it,
    but i don't think this is the best solution :-(

    Thanks for any additional hints..

    Ahmad
     
    Ahmad, Jul 6, 2009
    #7
  8. Reotaro Hashemoto

    Riad KACED Guest

    Hi Amhad,

    There is no reason for the code I have provided not to work. I'm
    pretty much sure you have got something else odd in your whole
    program. Are you sure you have re-loaded your script with the right
    functions to be called ?
    The ipcWait() causes the parent process to suspend until the child
    terminates.
    Anyway, it's better getting in touch with your Cadence AE in this
    case.

    Regards,
    Riad.
     
    Riad KACED, Jul 8, 2009
    #8
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.