• 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. How to get back to tcl after exiting in OCEAN and/or SKILL...

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 143
  • Views 5483
  • 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

How to get back to tcl after exiting in OCEAN and/or SKILL?

Reinice
Reinice over 12 years ago

Hi All,

Good Day. 

I 'am running tcl in compiling/creating OCEAN and/or SKILL files. When I exit in OCEAN and/or SKILL I can't get back to tcl to compile the remaining tcl codes. Is there a way to get back to tcl after exiting in OCEAN and/or SKILL?

Thank you very much in advance.

Regards,

Reinice

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Hi Reinice,

    You'll have to give more details of what you're doing - how you are launching OCEAN from Tcl, for exampe - what does the Tcl script look like. I see no reason why this shouldn't work in principle - so I'd need to understand what you're doing.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Reinice
    Reinice over 12 years ago

    Hi Andrew,

    I 'am using exec ocean -restore "file.ocn" & when launching OCEAN/SKILL from tcl. Actually I' am using tcl(puts function) to create OCEAN/SKILL files then I invoke it using the command I mentioned.

    Thanks and Regards,

    Reinice

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Reinice,

    So don't use the & at the end of the exec! That is backgrounding the process - and so you don't know when it finished.

    If I do:

    proc dothis {} {                           
      exec ocean -restore runSim.ocn               
      puts hello                                   
    }  

    "hello" is output after the simulation has finished (this assumes that runSim.ocn has an exit() call at the end).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Reinice
    Reinice over 12 years ago

    Hi Andrew,

    I'll try your suggestion. I'll get back to you ASAP and tell what was the outcome.

    Thanks and Regards,

    Reinice

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Reinice
    Reinice over 12 years ago

    Hi Andrew,

    I removed the "&" sign in the exec command but still it did not returned to tcl.

    Here is what I want to happen in my tcl:

    proc main {design_user tool_u analysis_name} {

    exec ocean -restore "file.ocn"

    main $design_user $tool_u $analysis_name

    }

    1. I have a main procedure.

    2. I exec file.ocn inside the main procedure.

    3. Then I will call main procedure after exec command have finished.

    Also, is there a way to see the progress of my exec command? So that I' am not guessing what it's status?

    Thanks and Regards,

    Reinice

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Reinice,

    Here's how you'd do this in Tcl (nothing really to do with OCEAN - it's just Tcl techniques):

     proc showOutput {channel} {
      global finished
      if {[eof $channel] || [catch {gets $channel line}]} {
        close $channel
        set finished 1
      } else {
        puts $line
      }
    }
      
    # global flag so that the vwait will return when
    # the showOutput function tells it that the pipe
    # has closed
    set finished 0

    # open a pipe from ocean, and set it up to be
    # line buffered, with a file event to read the output
    # as each line appears
    set chan [open "| ocean -restore runSim.ocn"]
    fconfigure $chan -buffering line
    fileevent $chan readable [list showOutput $chan]
    vwait finished

    puts "NOTE: simulation has now finished"

     

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Reinice
    Reinice over 12 years ago

    Hi Andrew,

    I've tried your sample script but I' am having problem how to exit in ocean session. In your example runSim.ocn let's say I have a exit() function at the end of the file. Eventhough I have exit() function, still I' am not exiting in ocean session. It seems that finished in vwait finished did not changed.

    Thanks and Regards,

    Reinice

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Hi Reinice,

    Are you running "ocean" with "-nograph"? I'm wondering whether maybe you have a popup which is appearing but you can't see it because you're in nograph mode. Maybe if you run without -nograph mode you see it?

    Also try running the same OCEAN script from the command line (rather than from within Tcl) to see what happens. Even try "virtuoso -restore yourScript.ocn" and see what happens.

    Sometimes the popup that appears at the end is because of:

    a) something that needs saving (in which case maybe doing a dbPurge() of the design will fix it)
    b) modifications to the display.drf being done as part of a PDK's libInit.il (using drLoadDrf without nil as the second argument)

    I have seen people solve this by calling exit() twice in the OCEAN script, but that's a bit of a hack - better to try to find the root cause.

    Regards,

    Andrew.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Reinice
    Reinice over 12 years ago

    Hi Andrew,

    I 'am not using "-nograph" when running "ocean"

    I tried to run my OCEAN script from the command line and even tried "virtuoso -restore myScript.ocn", it runs/executes and exits ocean session and virtuoso session respectively and returned back to the command line without any popup.

    I also tried to do calling exit() twice in myScript.ocn and nothing happened. It did not return to main procedure.

    Here is how I implemented your suggestion

    proc main {design_user tool_u analysis_name} {

    proc showOutput {channel} {
      global finished
      if {[eof $channel] || [catch {gets $channel line}]} {
        close $channel
        set finished 1
      } else {
        puts $line
      }
    }
      
    set finished 0

    set chan [open "| ocean -restore myScript.ocn"]
    fconfigure $chan -buffering line
    fileevent $chan readable [list showOutput $chan]
    vwait finished

    puts "NOTE: simulation has now finished"

    main $design_user $tool_u $analysis_name 

    }

    It seems that finished in vwait finished did not change? and myScript.ocn executes and did not return to main procedure after exit().

    Thanks and Regards,

    Reinice

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Hi Reinice,

    From a quick check, it appeared to work for me as is, but I think you really ought to add "global finished" within the main proc (that's what the "man vwait" page suggests).

    If that doesn't fix it, has the ocean executable actually exited (check the processes running with "ps")?

    Andrew.

    • 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