• 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 ensure that only one hiRegTimer process is running...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 5925
  • 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 ensure that only one hiRegTimer process is running at any one time

blankman
blankman over 1 year ago

Hi All,

I see that when using hiRegTimer, calling it multiple times initiates it each time, so that there then are multiple hiRegTimer processes running in parallel.

I wish to use hiRegTimer in a way, that if it is called more than once, each time it is called kills the previous hiRegTimer process, so that only one hiRegTimer process is running at any one time. Is it possible to do this?

Thanks,

B

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    B,

    You can't - hiRegTimer doesn't offer the ability to do this. However, you might want to consider using my CCStimer package that provides a more convenient interface and introduces the idea of having job IDs, being able to specify repeating jobs, and also provides a mechanism to terminate scheduled jobs given their job ID. It uses hiRegTimer underneath, but also allows you to schedule closures and function objects which can be useful too.

    Of course, you still have to use this wisely because everything is still single-threaded and so you don't want to be scheduling code that takes a lot of resources on a frequent basis.

    Here's my article: How to schedule a repeating function with a timer in SKILL

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 1 year ago in reply to Andrew Beckett

    Thanks Andrew, adding use-case below in case you might know of an easier means of implementing?

     

    A procedure that allows the user to toggle off the visibility of “Boundary”, “FigGroup” and “Custom Placement Area” objects to allow the user more visual clarity when viewing larger/top level layouts. After 5 minutes the visibility of these objects automatically switch back on again.

     

    I had been using hiRegTimer within this procedure to do this (as below), however resulting the aforementioned issue when called multiple times. Is there another means by which such a delay in turning back on the Object vis could be achieved? Reading the code you provided it sounds like it can freeze the interface if ran for any considerable length of time, if I understand correctly?

     

    hiRegTimer("AutoOnImproveVis()" 3000)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 1 year ago in reply to blankman

    Hi,

    Can't you use a global variable to set a timestamp?

    Everytime your procedure is called, you check the previous timestamp, deduce what to do accordingly

    Then you reset the timestamp using current time

    The associated functions you might want to check: getCurrentTime compareTime timeToString 

    Hope this helps,

    Aurélien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 1 year ago in reply to AurelBuche

    Thanks Aurélien, appreciated, B

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to blankman
    blankman said:
    A procedure that allows the user to toggle off the visibility of “Boundary”, “FigGroup” and “Custom Placement Area” objects to allow the user more visual clarity when viewing larger/top level layouts. After 5 minutes the visibility of these objects automatically switch back on again.

    This sounds (to me) a very odd use model (and personally I'd think that could be pretty annoying that it suddenly changes back 5 minutes later when you're in the middle of doing something, or have wandered over to a colleague to bring them over to show them what you've seen - and it changed while you were away!). However, if you really want to do this - then using hiRegTimer or my CCStimer makes sense - not sure there's any other real way.

    blankman said:
    I had been using hiRegTimer within this procedure to do this (as below), however resulting the aforementioned issue when called multiple times. Is there another means by which such a delay in turning back on the Object vis could be achieved? Reading the code you provided it sounds like it can freeze the interface if ran for any considerable length of time, if I understand correctly?

    You could easily use the CCStimer for this - keeping track of a global handle when this is scheduled and then if called again you could terminate the current "job" and reschedule again (updating the global handle to the latest registered timer).

    The "freeze the interface for any considerable length of time" bit is just saying that you should be cautious if you are running something very frequently and the callback you're calling takes a long time to execute (that doesn't seem likely to be the case from what you've described).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 1 year ago in reply to Andrew Beckett

    Thanks very much Andrew, appreciated, I will take a closer look at CCStimer (have not had a lot of time on my hands lately). Kind regards, B

    • 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