• 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. fork (or run view() on different thread)

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 144
  • Views 14325
  • 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

fork (or run view() on different thread)

drdanmc
drdanmc over 7 years ago

Is there a way to use the view() command in a different thread somehow?  For example, in ADE-L, when a simulation is running, the spectre.out log window is getting updates but my virtuoso session is otherwise still responsive.  I am guessing that this is because of using view() like view(my_file nil "my_title" t) and that spectre has been launched via ipc.  Every once in a while I have something running in skill that is somewhat lengthy (10-20 minutes) and  like to have an output log file get tailed.  I tried view() but that window doesn't refresh until after the long job is done.  In the mean time, I've been using something like:

log_file="my_log.txt"

log_port = outfile(log_file)

fprintf(log_port, "Start of log...\n") drain(log_port)

cid=ipcBeginProcess(strcat("xterm -sb -geometry 100x120+20+20 -title my_log -e tail -f " log_file))

ipcWaitForProcess(cid, 5)

;; long skill stuff that along the way writes to log_port

close(log_port)

ipcKill(cid)

view(log_file)

is this pretty much the only way or is there some way to tell view() to run in a different thread somehow?  I'm guessing this is the only way but thought I'd ask and also since there is at least something that works, someone else may find it useful.   This can be helpful in an ocean environment.

-Dan

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Hi Dan,

    I thought I'd written a reply to something similar recently - and given that I found this code in my SKILL area as an experiment in December, I assume I did - but I can't find where I answered it!

    Anyway, the trick is to use hiSetViewfile to the same file and a hiFlush to refresh the window. The t argument in view() isn't enough. The challenge is that SKILL isn't multi-threaded, and so you have to force the UI event loop to update periodically.

    procedure(slowUpdateView()
    let((prt)
    prt=outfile("./locallog.log" "a")
    for(i 1 10
    fprintf(prt "Line %d\n" i)
    drain(prt)
    hiSetViewfile(WINID "./locallog.log")
    hiFlush()
    ipcSleep(5)
    )
    close(prt)
    )
    )

    procedure(mainCode()
    let((prt)
    prt=outfile("./locallog.log" "w")
    fprintf(prt "First line\n")
    close(prt)
    WINID=view("./locallog.log" nil nil t)
    slowUpdateView()
    )
    )

    Hope this helps!

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Hi Dan,

    I thought I'd written a reply to something similar recently - and given that I found this code in my SKILL area as an experiment in December, I assume I did - but I can't find where I answered it!

    Anyway, the trick is to use hiSetViewfile to the same file and a hiFlush to refresh the window. The t argument in view() isn't enough. The challenge is that SKILL isn't multi-threaded, and so you have to force the UI event loop to update periodically.

    procedure(slowUpdateView()
    let((prt)
    prt=outfile("./locallog.log" "a")
    for(i 1 10
    fprintf(prt "Line %d\n" i)
    drain(prt)
    hiSetViewfile(WINID "./locallog.log")
    hiFlush()
    ipcSleep(5)
    )
    close(prt)
    )
    )

    procedure(mainCode()
    let((prt)
    prt=outfile("./locallog.log" "w")
    fprintf(prt "First line\n")
    close(prt)
    WINID=view("./locallog.log" nil nil t)
    slowUpdateView()
    )
    )

    Hope this helps!

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
No Data

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