• 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. transfer normal hot key layer to the function recall st...

Stats

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

transfer normal hot key layer to the function recall style

toyakoyosu
toyakoyosu over 1 year ago

Hi!  I already done my script for the hot  key set,

but wanna make the script shorter and easy maintain,

hence I think  aybe use the function  recall,

I wanna  use group list or foreach syntax and  make bundle select layers as group,

but how to change my script to the funtion recall?

because  current I try and debug at CIW iinterfacce but reply have error show unbound variable grp1    grp2    grp3

here is my rookie  image

1.
hiSetBindKey("Layout" "<Key>1" "smwLayersVisible(grp1)")

hiSetBindKey("Layout" "<Key>2" "smwLayersVisible(grp2)")

hiSetBindKey("Layout" "<Key>3" "smwLayersVisible(grp3)")

2.
create list  group

 foreach(grp1
      list(
          '("M1" "drawing")
          '("CT" "drawing")
          '("M1_PIN" "drawing")
          )
 leSetLayerVisible(grp1 t)
  leSetLayerSelectable(grp1 t)
 );end foreach

foreach(grp2
      list(
          '("M2" "drawing")
          '("VIA1" "drawing")
          '("M2_PIN" "drawing")
          )
 leSetLayerVisible(grp2 t)
  leSetLayerSelectable(grp2 t)
 );end foreach

foreach(grp3
      list(
          '("M3" "drawing")
          '("VIA2" "drawing")
          '("M3_PIN" "drawing")
          )
 leSetLayerVisible(grp3 t)
  leSetLayerSelectable(grp3 t)
 );end foreach

etc...

already fixed and done script as below
thanks!

;;this script mean when you toggle the layer, ;;will combine the default set bindkey. ;;Toggle layer an easy visible ;;To easy see layout Metal layer ;;Separate front end and backend hiSetBindKey("Layout" "1" "toggleMetal1LayersVisible()") hiSetBindKey("Layout" "2" "toggleMetal2LayersVisible() hiRedraw()") hiSetBindKey("Layout" "3" "toggleMetal3LayersVisible() hiRedraw()") hiSetBindKey("Layout" "4" "toggleMetaltopLayersVisible() hiRedraw()") hiSetBindKey("Layout" "6" "toggleBackEndLayersVisible() hiRedraw()") hiSetBindKey("Layout" "7" "toggleFrontEndLayersVisible() hiRedraw()") hiSetBindKey("Layout" "8" "leSetAllLayersVisible(t) hiRedraw()") hiSetBindKey("Layout" "Alt1" "setMetal1LayersVisible()") hiSetBindKey("Layout" "Alt2" "setMetal2LayersVisible() hiRedraw()") hiSetBindKey("Layout" "Alt3" "setMetal3LayersVisible() hiRedraw()") hiSetBindKey("Layout" "Alt4" "setMetalTopLayersVisible() hiredraw()") procedure(toggleMetal1LayersVisible() leSetEntryLayer('("M1" "drawing")) leSetAllLayerVisible(nil) foreach(laylsw list( '("M1" "drawing") '("CT" "drawing") '("M1_PIN" "drawing") ) leSetLayerVisible(laylsw t) leSetLayerSelectable(laylsw t) );end foreach );end procedure procedure(toggleMetal2layersVisible() leSetEntryLayer('("M2" "drawing")) leSetAllLayerVisible(nil) foreach(laylsw list( '("M2" "drawing") '("MV1" "drawing") '("M2_PIN" "drawing") ) leSetLayerVisible(laylsw t) leSetLayerSelectable(laylsw t) );end foreach );end procedure procedure(toggleMetal3layersVisible() leSetEntryLayer('("M3" "drawing")) leSetAllLayerVisible(nil) foreach(laylsw list( '("M3” "drawing") '("MV2" "drawing") '("M2_PIN" "drawing") ) leSetLayerVisible(laylsw t) leSetLayerSelectable(laylsw t) );end foreach );end procedure

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    How about something like this (if I've understood you correctly):

    procedure(smwLayersVisible(layerList @optional (visible t))
      let((lpp)
        foreach(layer layerList
          lpp=if(listp(layer) then layer else list(layer "drawing"))
          leSetLayerVisible(lpp visible)
          leSetLayerSelectable(lpp visible)
        )
        t
      )
    )

    then you can use:

    hiSetBindKey("Layout" "<Key>1" "smwLayersVisible('(\"M1\" \"CT\" \"M1_PIN"\))")
    hiSetBindKey("Layout" "<Key>2" "smwLayersVisible('(\"M2\" \"VIA1\" \"M2_PIN"\))")

    etc. Or if you really want to hide away the layer details, you could do:

    procedure(smwLayersVisible(groupName)
      let((group)
        group=case(groupName
          (M1layers '(("M1" "drawing") ("CT" "drawing") ("M1_PIN" "drawing")))
          (M2layers '(("M2" "drawing") ("VIA1" "drawing") ("M2_PIN" "drawing")))
          (M3layers '(("M3" "drawing") ("VIA2" "drawing") ("M3_PIN" "drawing")))
        )
        foreach(layer group
          leSetLayerVisible(layer t)
          leSetLayerSelectable(layer t)
        )
        t
      )
    )

    Then:

    hiSetBindKey("Layout" "<Key>1" "smwLayersVisible('M1layers)")
    hiSetBindKey("Layout" "<Key>2" "smwLayersVisible('M2layers)")
    hiSetBindKey("Layout" "<Key>3" "smwLayersVisible('M3layers)")

    or something like that. None of this is tested - and it wasn't entirely clear what you wanted.

    Andrew

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

    Hi! Andrew,

    sorry English is my first language, but I try descirbe more detail,  
    I wonder use hot key and make layer visible and selectable,
    but currently my script seems a little bit heavy and long to maintain,
    that's I try use function recall and make bundle layer as group(like M1, contact and M1_text)
    and bind key like this(use function recall M1layers to M3layers) 

    hiSetBindKey("Layout" "<Key>1" "smwLayersVisible('M1layers)")
    hiSetBindKey("Layout" "<Key>2" "smwLayersVisible('M2layers)")
    hiSetBindKey("Layout" "<Key>3" "smwLayersVisible('M3layers)")

    maybe my stubborn mind,
    now I try the second one script you provide,
    have 3 paragraph need to verify, 

    foreach(layer group
    leSetLayerVisible(layers t)
    leSetLayerSelectable('(layers t))
    )

    the script you provide have error as below
    *Error* eval: unbound variable - layers

    is "layers" could link to "groupName"??
    or have any suggestion for me to try?
    thanks!

    here is my old script as below,


    hiSetBindKey("Layout" "<Key>1" "toggleMetal1LayersVisible()")
    hiSetBindKey("Layout" "<Key>2" "toggleMetal2LayersVisible() hiRedraw()")
    hiSetBindKey("Layout" "<Key>3" "toggleMetal3LayersVisible() hiRedraw()")

    procedure(toggleMetal1LayersVisible()
    leSetEntryLayer('("M1" "drawing"))
    leSetAllLayerVisible(nil)
    foreach(laylsw
    list(
    '("M1" "drawing")
    '("CT" "drawing")
    '("M1_PIN" "drawing")
    )
    leSetLayerVisible(laylsw t)
    leSetLayerSelectable(laylsw t)
    );end foreach
    );end procedure

    procedure(toggleMetal2layersVisible()
    leSetEntryLayer('("M2" "drawing"))
    leSetAllLayerVisible(nil)
    foreach(laylsw
    list(
    '("M2" "drawing")
    '("MV1" "drawing")
    '("M2_PIN" "drawing")
    )
    leSetLayerVisible(laylsw t)
    leSetLayerSelectable(laylsw t)
    );end foreach
    );end procedure

    procedure(toggleMetal3layersVisible()
    leSetEntryLayer('("M3" "drawing"))
    leSetAllLayerVisible(nil)
    foreach(laylsw
    list(
    '("M3" "drawing")
    '("MV2" "drawing")
    '("M2_PIN" "drawing")
    )
    leSetLayerVisible(laylsw t)
    leSetLayerSelectable(laylsw t)
    );end foreach
    );end procedure

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to toyakoyosu
    toyakoyosu said:
    foreach(layer group
    leSetLayerVisible(layers t)
    leSetLayerSelectable('(layers t))
    )

    the script you provide have error as below
    *Error* eval: unbound variable - layers

    is "layers" could link to "groupName"??
    or have any suggestion for me to try?
    thanks!

    You appear to have changed my code. I had layer not layers for the leSetLayerVisible call. Why did you change this? It won't work since there's no  variable called layers.

    Here's what I said:

    Andrew Beckett said:
    procedure(smwLayersVisible(groupName)
      let((group)
        group=case(groupName
          (M1layers '(("M1" "drawing") ("CT" "drawing") ("M1_PIN" "drawing")))
          (M2layers '(("M2" "drawing") ("VIA1" "drawing") ("M2_PIN" "drawing")))
          (M3layers '(("M3" "drawing") ("VIA2" "drawing") ("M3_PIN" "drawing")))
        )
        foreach(layer group
          leSetLayerVisible(layer t)
          leSetLayerSelectable(layer t)
        )
        t
      )
    )

    Did you try that or did you type it in yourself and make a mistake?

    Regards,

    Andrew 

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

    Hi! Andrew, 

    I tried and modified you provide, 
    sorry it's my wrong key in.

    but result not fit my previous script procedure,
    CIW show 

    function smwLayerVis redefined
    t
    Version : IC618 (IC6.1.8 ISR34), LINUX
    smwLayerVis('M1layers)
    t

    for example
    I type bind key 1 and layer only show the M1, CT and M1_PIN layer, hide another layer, entry layer stay at M1
    I type bind key 2 and layer only show the M2, VIA1 and M2_PIN layer,  hide another layer, entry layer stay at M2
    I type bind key 3 and layer only show the M3, VIA2 and M3_PIN layer,  hide another layer, entry layer stay at M3  

    procedure(smwLayersVisible(groupName)
      let((group)
        group=case(groupName
          (M1layers '(("M1" "drawing") ("CT" "drawing") ("M1_PIN" "drawing")))
          (M2layers '(("M2" "drawing") ("VIA1" "drawing") ("M2_PIN" "drawing")))
          (M3layers '(("M3" "drawing") ("VIA2" "drawing") ("M3_PIN" "drawing")))
        )
        foreach(layer group
          leSetLayerVisible(layer t)
          leSetLayerSelectable(layer t)
        )
        t
      )
    )

    could I know the red mark "t" means?

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

    Well, it wasn't clear in the original post what functionality you wanted - and I was not trying to fully write it for you - I assumed you'd adapt it to your needs. If we adjust it to be closer to your original functionality which was to make all layers invisible except those you wanted, then you'd change it to:

    procedure(smwLayersVisible(groupName)
      let((group)
        group=case(groupName
          (M1layers '(("M1" "drawing") ("CT" "drawing") ("M1_PIN" "drawing")))
          (M2layers '(("M2" "drawing") ("VIA1" "drawing") ("M2_PIN" "drawing")))
          (M3layers '(("M3" "drawing") ("VIA2" "drawing") ("M3_PIN" "drawing")))
        )
        ; set the current entry layer to the first in the group, and make everything else invisible
        leSetEntryLayer(car(group))
        leSetAllLayerVisible(nil)

        foreach(layer group
          leSetLayerVisible(layer t)
          leSetLayerSelectable(layer t)
        )
        t
      )
    )

    The final t just sets the return value of the function. Otherwise it would return the list of layers it processed; given that you probably don't want to see the list of layers processed, I thought it would be cleaner to return t (it won't affect the functionality though if this line was omitted)

    Andrew

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

    Hi! Andrew, 

    sorry late reply, I have busy work at last two weeks.
    thanks your grateful support,
    it could work, almost close my idea.
    but could you use function recall at two hot key?
    like the script you provide 
    add another hot key

    hiSetBindKey("Layout" "Shift<Key>1" "smwLayersVisible('M1layers t)")
    hiSetBindKey("Layout" "Shift<Key>2" "smwLayersVisible('M2layers t)")
    hiSetBindKey("Layout" "Shift<Key>3" "smwLayersVisible('M3layers t)")

    and keep the hot key
    hiSetBindKey("Layout" "<Key>1" "smwLayersVisible('M1layers)")
    hiSetBindKey("Layout" "<Key>2" "smwLayersVisible('M2layers)")
    hiSetBindKey("Layout" "<Key>3" "smwLayersVisible('M3layers)")

    I add new hot key not only toggle layer, but also use stack layer and visiable
    just wanna easy maintain the layer set
    like M1layers, M2layers and M3layers

    have any idea and follow you script provide?

    thanks! 

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

    I'm sorry, but I have absolutely no idea what you are asking for here.

    Andrew

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

    I'm sorry, but I have absolutely no idea what you are asking for here.

    Andrew

    • 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