• 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 use ?modifyCallback on hiCreateStringField() properly...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 14668
  • 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 use ?modifyCallback on hiCreateStringField() properly?

Sheppy
Sheppy over 9 years ago

Hello,

For a string field of a form, I want to specify a callback function which gets triggered after each keystroke. I use the function hiCreateStringField() and I specify the ?modifyCallback to trigger the function I want (it performs a rexMatchp() on a list that has all cells in a given library and puts this list as the ?choices list in an other (cyclic) form field, thus the list gets updated dynamically, making it easier to locate a cell in a library).

Somehow it doesn't work properly since I get errors.

To start, this is working fine, and the callback function works properly (just to make clear that there is no error in the code of the callback function):

hiCreateStringField(
  ?name       'BcipFindCellsToBrowse
  ?prompt     "Cells to browse:"
  ?value      ""
  ?defValue   ""
  ?callback   "tempProc()"
  ?editable   t
  ?enabled    t
)

This is the tempProc():

procedure( tempProc()
  let( ( ( temp nil ) )
    BcipGuiForm~>BcipCellsToBrowse~>value = nil
    if( equal( BcipGuiForm~>BcipFindCellsToBrowse~>value "" )
    then
      BcipGuiForm~>BcipCellsToBrowse~>choices = BcipDefineCellnameList( BcipGuiForm~>BcipLibrariesToBrowse~>value )
    else
      foreach( item BcipDefineCellnameList( BcipGuiForm~>BcipLibrariesToBrowse~>value )
        when( rexMatchp( BcipGuiForm~>BcipFindCellsToBrowse~>value item )
          temp = cons( item temp )
        ) ;;; end of when
      ) ;;; end of foreach item
      BcipGuiForm~>BcipCellsToBrowse~>choices = reverse( temp )
    ) ;;; end of if
  ) ;;; end of let
) ;;; end of procedure tempProc

So, when typing in the springfield, after it loses focus it performs tempProc() and the ?choices list of BcipCellsToBrowse gets updated accordingly.

When I do the following:

hiCreateStringField(
  ?name             'BcipFindCellsToBrowse 
  ?prompt           "Cells to browse:"
  ?value            ""
  ?defValue         ""
  ?modifyCallback   "tempProc()"
  ?editable         t
  ?enabled          t
)

It generates errors.

After each keystroke, the procedure tempProc() gets executed (I know that since the ?choices list gets updated correctly) but the following error is reported in the CIW:

*Error* eval: not a function - 'BcipFindCellsToBrowse
*Error* car: Can't take car of atom - ERROR

I get the same error if I replace "tempProc()" with "printf(\"Help\")".

When I look at the documentation, the explanation for ?callback differs significantly from the ?modifyCallback explanation.

The ?modifyCallback passes three values to the callback function (s_filename, t_lastTextValue and g_sourceOfChange) and it expects to get back either t, nil or a value. This is where it is breaking in my code, I suppose. I have tried several things (like returning a "t" at the end of tempProc()) but none of them worked.

So I would like to know:

  • the ?modifyCallback passes three values, how do I access them (for an other form I really want to know what the g_sourceOfChange is)
  • How do I return something to satisfy the ?modifyCallback of the field?
  • And what should I return (simply "t")?
  • Is there a smarter method for what I want (something already build into Cadence/SKILL)?

Any help is highly appreciated since I hate to distribute code that works but generates errors.

With kind regards,

Sjoerd

ps:

This is what BcipDefineCellnameList() does:

procedure( BcipDefineCellnameList( refLib "l" )
  let( ( ( lib nil )
    ( libDbId nil )
    ( cell nil )
    ( cellNameList nil ) )

    foreach( lib refLib
      libDbId = ddGetObj( lib )
      foreach( cell libDbId~>cells
        if( member( cell~>name cellNameList )
        then
          cellNameList = cellNameList
        else
          cellNameList = append( cellNameList list( cell~>name ) )
        ) ;;; end if
      ) ;;; end foreach cell
    ) ;;; end foreach lib

    cellNameList = ( sort cellNameList nil )

  ) ;;; end let
) ;;; end procedure BcipDefineCellnameList

refLib is a list of strings, each string is the name of a library.

  • Cancel
Parents
  • Sheppy
    Sheppy over 9 years ago

    Hi Andrew,

    Fantastic, it works! Thanks for your quick reply.

    With kind regards,

    Sjoerd

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Sheppy
    Sheppy over 9 years ago

    Hi Andrew,

    Fantastic, it works! Thanks for your quick reply.

    With kind regards,

    Sjoerd

    • Cancel
    • Vote Up 0 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