• 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. Identify uniquely a session

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 15095
  • 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

Identify uniquely a session

netbug
netbug over 8 years ago

Hi,

I would like to identify uniquely the session I am in. I have a config file which I don't want to be overwritten when I use the same script in another Cadence session. For that I would like to append to my config file "config.txt" something meaningful and unique.

Thanks in advance.

Best regards,

Pedro

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Pedro,

    You could use getCurrentTime(), ipcGetPid() to get the current time or process id respectively if you want it to be meaningfully named, or you could use makeTempFileName() to make the filename unique.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • netbug
    netbug over 8 years ago

    Hi Andrew,

    Thanks for your answer. I've used ipcGetPid(), and it does exactly what I wanted.

    Best regards,

    Pedro

    ipcGetPid
    ipcGetPid
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Pedro,

    One thing to be wary of - if you're running virtuoso on multiple machines, it's possible (albeit fairly unlikely) that two users may have the same process-id. Could include the user name using getLogin() to retrieve that. There's no public function to get the host name (although easy enough to call the UNIX "hostname" command to retrieve that):

    id=ipcBeginProcess("hostname")
    ipcWait(id)
    hostName=ipcReadProcess(id)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • netbug
    netbug over 8 years ago
    Hi Andrew,
    Thanks for that piece of information. What you've written above works, of course :-)
    In the beginning I was planning to use makeTempFileName() instead of ipcGetPid() in order to get an unique identifier, as you suggested on a previous post, but I had a fundamental problem:
    my program is divided into functions which need to access the variable "myConfigFile". This variable is composed of "somename_ makeTempFileName_output.txt", so it is unique. Moreover, this variable should be global, but instead of that I am passing the var to each function. Why ? Because I am obtaining the "unbond variable error" and I can't solve this basic problem. To overcome this, and not have the need to pass variables to all functions, I've tried to call makeTempFileName() inside each function but that returns different codes. So I was left with the option of passing the value to the functions. :-(

    Thanks for your help.

    Best regards,
    Pedro
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Pedro,

    Not really sure why either your global variable access didn't work (without seeing the code), but global variables are bad practice anyway...

    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