ipcWriteProcess arguments.

Discussion in 'Cadence' started by girish, Oct 28, 2004.

  1. girish

    girish Guest

    Is it possible to pass the value of a "variable" to the child process'
    stdin using ipcWriteProcess()?
    I am calling a child process inside a loop and would like to pass the
    iteration number down to it.

    for example, below is a portion of my OCEAN script:


    while( i<5

    id=ipcBeginProcess("ipc_test1")
    ipcWriteProcess(id "***") ;*** I'D LIKE TO WRITE THE VALUE OF i HERE
    ipcWait(id)

    run()

    selectResult( 'tran )

    ocnPrint(?output myPort i("/Ipwl/PLUS"))

    plot(getData("/Ipwl/PLUS") getData("/Vr") )

    i++
    )


    ipcWriteProcess() seems to accepts only strings. Is there some other
    function that will allow me to pass the value of variables? I have
    just started with SKILL, so any pointers will be greatly appreciated.
    Thanks.

    Girish.
    UVA
     
    girish, Oct 28, 2004
    #1
  2. You can write/read with the subprocess with strings only.

    Do something like this,
    ipcWriteProcess(id sprintf(nil, "%d", i))

    If the type of variable is unknown, this would do,
    ipcWriteProcess(id sprintf(nil, "%L", i))

    Regards,
    Suresh
     
    Suresh Jeevanandam, Oct 28, 2004
    #2
  3. girish

    S. Badel Guest

    Yes, you could also pass it as a command-line parameter

    id=ipcBeginProcess( sprintf( nil "ipc_test1 %d" i ) )

    just a note, i think you should call ipcWaitForProcess( id )
    before starting to send data to make sure the process is
    ready for communication.

    cheers,
    stephane
     
    S. Badel, Oct 28, 2004
    #3
  4. girish

    fogh Guest

    MyDebugMode=not(())
    S="*"
    S=sprintf(nil "%s*" S)
    S=strcat(S "*" "\n" sprintf(nil "%L" i))
    ipcWriteProcess(id S)
    MyDebugMode&&info("I just sent %L to %L by IPC." S id)
     
    fogh, Oct 28, 2004
    #4
  5. girish

    girish Guest

    yeah!!! it works!
    thanks so much suresh and stephane. both the ipcWriteProcess() and
    command line solutions work great using sprintf()!
    I'll make sure to insert the ipcWaitForProcess(id) after invoking a
    process and before communicating with it. thanks again stephane.

    Girish.
    UVA
     
    girish, Oct 28, 2004
    #5
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.