• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Load SKILL file, call procedure and get return value (string...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 17785
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Load SKILL file, call procedure and get return value (string) from Linux Terminal

mohebur
mohebur over 6 years ago

I need to call few SKILL procedure one by one. Each of the procedure is written in it's own file. So I need to load the SKILL file before calling the procedure. I also need the return value; generally a string might be some other data type; from the calling procedure. I know I can write the commands in a file and use "virtuoso -nograph -replay commands_file" to load and run the procedures. Is there a way to load file and call procedure without writing in a file? How can I get the return values?

  • Cancel
Parents
  • ebecheto
    ebecheto over 6 years ago

    That script called shout.il should answer your needs :

    ;; copyleft ebecheto
    defun( shout (command @optional (rmNL nil) (verb t) )
    (let (ipcId ret) ;// not to use with complex shell command , no time stamp specified
    ipcId=ipcBeginProcess(command)
    ipcWaitForProcess(ipcId)
    ret=ipcReadProcess(ipcId 30) ;=>"now you see it..."
    when(verb printf("SHELL>%s" ret))
    when(rmNL rexCompile("\n") ret=rexReplace( ret "" 1));<== bad idea if multiline answer...
    ret
    ))
    printf("shout(\"hostname\")\n")
    printf("ret=shout(\"ls *.log\")\n")
    printf("ret=shout(\"env\")\n")
    printf("ret=shout(\"echo $SHELL\")\n")
    printf("ret=shout(\"spectre -help bsim3v3\")\n")
    printf("ret=shout(\"cds_root virtuoso\")\n")
    ;printf("ret=shout(\"echo `date +'_%Hh%M_%F'`\")\n")
    printf("ret=shout(\"echo `date +'%%F_%%Hh%%M_'`\")\n")
    ;printf("ret=shout(\"echo `date +F`TATA\")\n")

    Don't shout it too loud though.

    ++

    Hope it helps,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • ebecheto
    ebecheto over 6 years ago

    That script called shout.il should answer your needs :

    ;; copyleft ebecheto
    defun( shout (command @optional (rmNL nil) (verb t) )
    (let (ipcId ret) ;// not to use with complex shell command , no time stamp specified
    ipcId=ipcBeginProcess(command)
    ipcWaitForProcess(ipcId)
    ret=ipcReadProcess(ipcId 30) ;=>"now you see it..."
    when(verb printf("SHELL>%s" ret))
    when(rmNL rexCompile("\n") ret=rexReplace( ret "" 1));<== bad idea if multiline answer...
    ret
    ))
    printf("shout(\"hostname\")\n")
    printf("ret=shout(\"ls *.log\")\n")
    printf("ret=shout(\"env\")\n")
    printf("ret=shout(\"echo $SHELL\")\n")
    printf("ret=shout(\"spectre -help bsim3v3\")\n")
    printf("ret=shout(\"cds_root virtuoso\")\n")
    ;printf("ret=shout(\"echo `date +'_%Hh%M_%F'`\")\n")
    printf("ret=shout(\"echo `date +'%%F_%%Hh%%M_'`\")\n")
    ;printf("ret=shout(\"echo `date +F`TATA\")\n")

    Don't shout it too loud though.

    ++

    Hope it helps,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • mohebur
    mohebur over 6 years ago in reply to ebecheto

    I think you misunderstood my question. I don't want to call shell commands from SKILL function. I want to call SKILL function from shell (csh in my case). I need to load .il file, call the function and get return value from the function.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to mohebur

    There isn't really a direct way to do this, but it's easy enough to implement with a bit of thought (it's a bit of an odd request though). You could have a generic script called generic.il:

    errset(load(getShellEnvVar("SOURCEFILE")))
    returnVal=errsetstring(getShellEnvVar("FUNCTIONTOCALL"))
    printf("RETURN VAL:%L\n" car(returnVal))
    exit()

    Then you create this simple wrapper shell script, runSingleCommand:

    #!/bin/sh
    
    export SOURCEFILE=$1
    export FUNCTIONTOCALL=$2
    virtuoso -nograph -restore generic.il | grep "^RETURN VAL:" | sed -e 's/^RETURN VAL://'

    Here's an example of a trial script to try it with, trial.il :

    procedure(helloWorld(a)
      strcat("Hello World " a)
    )

    And finally how you run it:

    UNIX> runSingleCommand trial.il 'helloWorld("Andrew")'
    "Hello World Andrew"

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • mohebur
    mohebur over 6 years ago in reply to Andrew Beckett

    Thanks Andrew. It's a bit workaround but it works.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information