Running a skill procedure in the background and some interval.

Discussion in 'Cadence' started by tattvamasi, Sep 28, 2005.

  1. tattvamasi

    tattvamasi Guest

    Whats the best and easiest way to run a skill process, a procedure in
    the background.
    For example for the following two procedures,,
    procedure(trial()
    hiRegTimer("t1() trial()" 10)
    )

    procedure( t1()
    printf("Hmm..\n")
    )

    I would like to run t1 in the background every second, if and only if
    the previous t1() function has completed

    Thanks,
    Partha
     
    tattvamasi, Sep 28, 2005
    #1
  2. Well, bear in mind that SKILL isn't multithreaded. What that means is that any
    SKILL function being scheduled by hiRegTimer() will only run when it returns to
    the top level event loop - this means that if a SKILL function is already
    running, the next scheduled timer function will not start until it completes.

    However, you may be asking how to get it so that it doesn't schedule another run
    if a previous call has complete successfully (whatever "successfully" means in
    your case). This would normally be done by using a semaphore (e.g. a global
    variable) which is used to indicate the success/failure of an operation. Then
    you'd check that semaphore to decide whether you want to schedule it to run
    again.

    You do need to be careful scheduling something to run with 1 second intervals
    that you don't mess up the performance of the tools; if the code takes any
    significant time to run, it's going to impact interactive performance.

    Regards,

    Andrew.
     
    Andrew Beckett, Sep 29, 2005
    #2
  3. tattvamasi

    tattvamasi Guest

    Andrew,
    Thanks for your input, that is what I feared:(.
    Can you please furnish an example of the semaphore, not clear to me
    from the post above.
    So when V-XL talks about running the connectivity extractor in the
    background, it is not a truly backgrounded process?

    I came with the following way to try and run a skill process
    periodically from shell, Is this a good solution? ( I still have many
    things to figure out, since I know dbAccess only supports a subset of
    functions).
    Or is ipcSkillProcess a better alternative?

    I was informed by someone that there is this thing called MPS..( multi
    process skill?). Is it true?

    Thankyou .
    Partha


    procedure(trial1(ipcId exitStatus)
    printf("f\n")
    hiRegTimer("t1() " 10)
    )

    procedure( t1()
    let((cv)
    printf("%s\n" getCurrentTime())
    cv = deGetCellView()
    (ipcBeginProcess sprintf( nil "/home/pvn/runS.sh %s" cv) "" nil nil
    'trial1)
    ))

    And then in file runS.sh

    #!/bin/sh
    args="$*"
    argn=$#
    dest=`echo ${args} | cut -f${argn} -d' '`
    echo $dest
    dbAccess << EOF|tail -1
    myP = outfile("/home/pvn/hah")
    fprintf( myP "printing...$d\n" 1)
    foreach( inst $dest~>instances
    fprintf( myP "printing...%s\n" inst~>cellName)
    )
    close(myP)
     
    tattvamasi, Sep 29, 2005
    #3
  4. Hi Partha,

    No. It is something that is triggered when you make changes in the layout - and
    it is done at the C level. It's not a background process. It does some
    incremental extraction as you make changes in the layout.
    This approach is fine - although you obviously have to be careful about
    making any changes to the database because it would be locked separately
    as it's a separate process.

    I don't think ipcSkillProcess would help necessarily - that just provides you
    an additional pair of ports to send SKILL commands and results via. It can be
    useful at times.

    In short, there are a variety of different approachs you might take - and it
    depends on exactly what you're doing as to which makes most sense!
    MPS is a remote procedure call mechanism. It was formerly called "Multi Process
    SKILL" but was renamed "Message Passing Subsystem" because it is used in
    non-SKILL tools too.

    However, this is not something that is a public, documented, capability and so
    you should not use it - it is liable to change, and is not supported for
    customer use.

    Regards,

    Andrew.
     
    Andrew Beckett, Sep 30, 2005
    #4
  5. tattvamasi

    tattvamasi Guest

    Fantastic!
    Thanks Andrew.
    Partha

     
    tattvamasi, Sep 30, 2005
    #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.