• 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. hiRegTimer is not calling my procedure

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 15219
  • 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

hiRegTimer is not calling my procedure

WTony
WTony over 7 years ago

Hi all,

I'm trying to use hiRegtimer to pause my code without blocking my virtuoso session

my code:

procedure(yhwDeleteLabel(yhwText)
 let((yhwCV yhwLabel)
  yhwCV = geGetWindowCellView()
  yhwLabel = setof(l yhwCV~>shapes l~>theLabel==yhwText && l~>track)
  if(yhwLabel then
   dbDeleteObject(car(yhwLabel))
  )
 )
)

  yhwText = "netA"
  hiRegTimer("yhwDeleteLabel(yhwText)" 10)

it never go inside my procedure. if I call yhwDeleteLabel(yhwText) without hiRegTimer then it works. What is wrong in my code.

I also tried to use ipcsleep() but it block my virtuoso session.

the purpose of the code was to show an info message in the layout session then disappear after 1 second display.

Thanks

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    It works for me - however, it doesn't seem to cause the window to refresh, so maybe you need to call hiRedraw() or something like that after the call to your function. I found that without this I need to move my cursor around in the window and then the text appears to vanish (it's gone, but the window doesn't refresh immediately).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • WTony
    WTony over 7 years ago in reply to Andrew Beckett

    hi Andrew,

    I tried to debug with SKILL IDE tool and it show clearly that it didn't call my procedure 

    i include my 3 procedure:

    procedure(yhwInfo(yhwText)
    let((cv winBox edgeAdjustX edgeAdjustY textAdjust x y textSize yhwLabel)
    cv=geGetWindowCellView()
    yhwLabelsDelete(cv)
    leSetLayerVisible(list("ALPHA" "drawing") t)
    winBox = geGetWindowBox(hiGetCurrentWindow())
    edgeAdjustX=0.02 ; 2% of horizontal display size
    edgeAdjustY=0.04
    textAdjust=0.023 ; 2.3% of vertical display size
    x=leftEdge(winBox)+(rightEdge(winBox)-leftEdge(winBox))*edgeAdjustX
    y=topEdge(winBox)-(topEdge(winBox)-bottomEdge(winBox))*edgeAdjustY
    textSize=(topEdge(winBox)-bottomEdge(winBox))*textAdjust
    yhwLabel = dbCreateLabel(cv "ALPHA" x:y yhwText "centerLeft" "R0" "roman" textSize)
    dbCreateProp(yhwLabel "track" "boolean" t)
    hiRegTimer("yhwDeleteLabel(yhwText)" 10)
    )
    )

    procedure(yhwLabelsDelete(cv)
    let((yhwLabels)
    yhwLabels = setof(l cv~>shapes l~>objType=="label" && l~>track)
    if(yhwLabels then
    foreach(item yhwLabels
    dbDeleteObject(item)
    )
    )
    )
    )

    procedure(yhwDeleteLabel(yhwText)
    let((yhwCV yhwFindLabel)
    info("\n*****%s*****\n" yhwText)
    yhwCV = geGetWindowCellView()
    yhwFindLabel = setof(l yhwCV~>shapes l~>theLabel==yhwText && l~>track)
    if(yhwFindLabel then
    info("DELETE\n")
    dbDeleteObject(car(yhwFindLabel))
    )
    yhwText = nil
    hiRedraw()
    )
    )

    from the IDE tool message:

    <<< Break >>> on explicit 'break' request
    Entering new debug toplevel due to breakpoint:
    stopped before evaluating (winBox = geGetWindowBox(hiGetCurrentWindow()))
    stopped before evaluating (edgeAdjustX = 0.02)
    stopped before evaluating (edgeAdjustY = 0.04)
    stopped before evaluating (textAdjust = 0.023)
    stopped before evaluating (x = (leftEdge(winBox) + ((& - &) * edgeAdjustX)))
    stopped before evaluating (y = (topEdge(winBox) - ((& - &) * edgeAdjustY)))
    stopped before evaluating (textSize = ((topEdge(winBox) - bottomEdge(winBox)) * textAdjust))
    stopped before evaluating (yhwLabel = dbCreateLabel(cv "ALPHA" (x:y) yhwText "centerLeft" ... ))
    stopped before evaluating dbCreateProp(yhwLabel "track" "boolean" t)
    stopped before evaluating hiRegTimer("yhwDeleteLabel(yhwText)" 10)
    <<< Exiting yhwInfo >>>

    for some reason, it didn't call my procedure yhwDeleteLabel.

    Thanks

    Tony

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to WTony

    Hi Tony,

    From this, I'm not sure how you can conclude that it didn't call your function - assuming you're single stepping in the debugger, it wouldn't single step into the callback in hiRegTimer anyway, because that's executed from when the UI updates, not from the code sequence you're running in the debugger. It probably would have been better to do:

    trace(yhwDeleteLabel)

    However, having seen the full code, the issue will be that yhwText won't be in scope at the time the function is called. It's an argument to yhwInfo and that will have returned (and so the scope will have ended) by the time the hiRegTimer string is invoked. Even then, it would have been evaluated in the global scope - so you wouldn't have that variable defined (probably).

    It might be better to change the code line to:

    hiRegTimer(sprintf(nil "yhwDeleteLabel(%L)"  yhwText) 10)

    What that would do is change the call in the timer to have the literal string that was passed into the function - so there's no dependency on using (say) a global variable to track the string.

    You could also use:

    _stacktrace=50
    sstatus(errsetTrace t)

    to see if the hiRegTimer is calling the expression but failing with an error.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • WTony
    WTony over 7 years ago in reply to Andrew Beckett

    Hi Andrew,

    You are right, after changing to your line. it works perfectly.

    Thanks so much

    Tony

    • 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