• 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. Skill code to change Metal width

Stats

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

Skill code to change Metal width

ManjunathYalameli
ManjunathYalameli over 1 year ago

Hi All, 

I am trying to write a skill code to change the metal width bindkey. without opening its query form. 

Here is my skill code

hiSetBindKey("Layout" "Ctrl<key>q" "change_metal_width()")
procedure(change_metal_width()
selected=geGetSelSet()
hiFocusToCIW( )
float_num=enterNumber()
selected~>width=float_num
)

This code works perfectly but I need to focus into CIW then I enter number the it changes width, If I comment hiFocusCIW() then run the script, view get stuck. Then I press ESC it comes back to normal without changing metal width. Please let me know what other commands I can use it.

Thank you in advance. 

  • Cancel
Parents
  • RicardoGV1
    RicardoGV1 over 1 year ago

    Hi Manju,

    I answered my version on Aurel response about strokes bindkeys but I think the reply is waiting for aproval by an admin to be shown on the forum.
    But meanwhile, here is another approach I use, which can increase width with the mouse wheel

    Just uncomment bindkeys at the end and write your techGrid on the first lines instead of the GetTechGrid()

    Regards,
    R.Gómez


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;                                                                                    ;;
    ;; Change width:                                                                      ;;
    ;; This skill changes the width of the wires and vias depending on the                ;;
    ;; Technology Grid spacing                                                            ;;
    ;;                                                                                    ;;
    ;; AUTOR: Ricardo                                                                     ;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    /*THIS IS THE INFORMATION TEMPLATE FOR ALL THE SCRIPTS
        Comments:
            1-Example
            2-Example2
                +More info
               
        Use:
          1.- select wire or via and use ctrl+shift+mousewheel to expand, also its variations ctr+mousewheel to expand diferent directions

        Features:

        Ideas:

        ToDo:          
                       
        Errors:
         
       
        FutureFixData:

        Dependences:

        CurrentlyWorking:
       
        DoneInCurrentCommit:
       
    */


    procedure(CCSChangeWidth2(increment  @optional (XY "both")(Selection geGetSelSet()))
      let((incrementWire incrementVia tk pwi rw rw1 ln lp hs hp win RoutingList ViasList LR UD rw2 rw3 ln2 lp2 hs2 hp2 win2 via ratio ratio1)
       
       
        ;multiplied by increment to get direction (increment or decrement)
        incrementWire=_IncrementMult*increment*GetTechGrid()*2;;this cannot be the min grid
        incrementVia=_IncrementMult*increment*GetTechGrid()

        win=hiGetCurrentWindow()
        ; delete hilight set if already exists in case increment/decrement
        ; is done before timer has kicked in
        pwDeleteHilight(win)
        tk=geGetEditCellView()
       
        ;Filtering objs
        ViasList = setof(x Selection x~>objType == "stdVia");filtering to only vias
        RoutingList = setof(x Selection or(x->objType=="path" x->objType=="pathSeg"))
       
        ;increasing sizes
        when(RoutingList != nil
            pwi=car(RoutingList)
            rw=pwi~>width+incrementWire
           
            ;println(rw)
            pwi~>width=rw

            rw1=artMakeStringPrec15(rw);artMakeString is having troubles with floats
            ;println(rw1)
            ln=pwi~>layerName
            lp=pwi~>layerPurpose
            hs=geCreateHilightSet(geGetEditCellView() list(ln lp) nil)
            hs~>enable=t
            ; store the hilight set as a property on the window to
            ; retrieve later for deletion.
            win~>pwCommonHS=hs
            hp=hiGetPoint(win)
            geAddHilightLabel(hs hp rw1 "centerCenter" "R0" "stick" rw nil)
            hiRegTimer(lsprintf("pwDeleteHilight(window(%d))" win->windowNum) 5)
        )
        when(ViasList != nil
            via=car(ViasList)
            LR=car(via->layer1Enc)
            UD=cadr(via->layer1Enc)
            case(XY
                ("both"
                    foreach(_via ViasList
                        _via->layer1Enc=list(LR+incrementVia UD+incrementVia)
                        _via->layer2Enc=list(LR+incrementVia UD+incrementVia)
                    )
                )
                ("x"
                    foreach(_via ViasList
                        _via->layer1Enc=list(LR+incrementVia UD)
                        _via->layer2Enc=list(LR+incrementVia UD)
                    )
                )
                ("y"
                    foreach(_via ViasList
                        _via->layer1Enc=list(LR UD+incrementVia)
                        _via->layer2Enc=list(LR UD+incrementVia)
                    )
                )
           
            )
           
            ;println(rw)
            ;pwi2~>width=rw
            ;println(ChangeWidthMode)

            rw2=artMakeStringPrec15(car(via->layer1Enc));artMakeString is having troubles with floats
            rw3=artMakeStringPrec15(cadr(via->layer1Enc));artMakeString is having troubles with floats
            ;println(rw1)
            ;ln2=pwi~>layerName
            ;lp2=pwi~>layerPurpose
            hs2=geCreateHilightSet(geGetEditCellView() list("text" "drawing") nil)
            hs2~>enable=t
            ; store the hilight set as a property on the window to
            ; retrieve later for deletion.
            win~>pwCommonHS=hs2
            hp2=hiGetPoint(win)
            ratio=car(via->layer1Enc)
            ratio1=cadr(via->layer1Enc)
            geAddHilightLabel(hs2 list( ((car(hp2)-0.9)+car(hp2)*ratio/32) cadr(hp2))                               rw2 "centerCenter" "R0" "stick" ratio*2 nil)
            geAddHilightLabel(hs2 list( car(hp2)                        ((cadr(hp2)+0.1)+cadr(hp2)*ratio1/32))      rw3 "centerCenter" "R0" "stick" ratio1*2 nil)
            hiRegTimer(lsprintf("pwDeleteHilight(window(%d))" win->windowNum) 5)
        )
      )
    )

    ; retrieve hilight set from the window, and delete if valid
    procedure(pwDeleteHilight(@optional (win hiGetCurrentWindow()))
      when(geIsValidHilightSet(win->pwCommonHS)
        geDeleteHilightSet(win->pwCommonHS)
      )
    )

    ChangeWidthMode="Left"
    procedure(ChangeMode()
        if(Mode=="Left"
            Mode="Right"
            Mode="Left"
        )
    )

    _IncrementMult=1
    procedure(ChangeIncrement()
    println("entro")
        if(_IncrementMult==1
            _IncrementMult=5
            _IncrementMult=1
        )
    )

    ;hiSetBindKey("Layout" "Shift <Key>/" "ChangeMode()") ; ChangeMode
    hiSetBindKey("Layout" "<Key>KP_Divide" "ChangeIncrement()") ; ChangeIncrement
    /*On Merged Bindkeys
    hiSetBindKey("Layout" "Shift Ctrl<Btn4Down>" "CCSChangeWidth2(0.005 \"both\")") ; Mouse scroll wheel up
    hiSetBindKey("Layout" "Shift Ctrl<Btn5Down>" "CCSChangeWidth2(-0.005 \"both\")") ; Mouse scroll wheel down

    hiSetBindKey("Layout" "Ctrl<Btn4Down>" "CCSChangeWidth2(0.005 \"x\")") ; Mouse scroll wheel up
    hiSetBindKey("Layout" "Ctrl<Btn5Down>" "CCSChangeWidth2(-0.005 \"x\")") ; Mouse scroll wheel down

    hiSetBindKey("Layout" "Shift<Btn4Down>" "CCSChangeWidth2(0.005 \"y\")") ; Mouse scroll wheel up
    hiSetBindKey("Layout" "Shift<Btn5Down>" "CCSChangeWidth2(-0.005 \"y\")") ; Mouse scroll wheel down
    */
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • RicardoGV1
    RicardoGV1 over 1 year ago

    Hi Manju,

    I answered my version on Aurel response about strokes bindkeys but I think the reply is waiting for aproval by an admin to be shown on the forum.
    But meanwhile, here is another approach I use, which can increase width with the mouse wheel

    Just uncomment bindkeys at the end and write your techGrid on the first lines instead of the GetTechGrid()

    Regards,
    R.Gómez


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;                                                                                    ;;
    ;; Change width:                                                                      ;;
    ;; This skill changes the width of the wires and vias depending on the                ;;
    ;; Technology Grid spacing                                                            ;;
    ;;                                                                                    ;;
    ;; AUTOR: Ricardo                                                                     ;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    /*THIS IS THE INFORMATION TEMPLATE FOR ALL THE SCRIPTS
        Comments:
            1-Example
            2-Example2
                +More info
               
        Use:
          1.- select wire or via and use ctrl+shift+mousewheel to expand, also its variations ctr+mousewheel to expand diferent directions

        Features:

        Ideas:

        ToDo:          
                       
        Errors:
         
       
        FutureFixData:

        Dependences:

        CurrentlyWorking:
       
        DoneInCurrentCommit:
       
    */


    procedure(CCSChangeWidth2(increment  @optional (XY "both")(Selection geGetSelSet()))
      let((incrementWire incrementVia tk pwi rw rw1 ln lp hs hp win RoutingList ViasList LR UD rw2 rw3 ln2 lp2 hs2 hp2 win2 via ratio ratio1)
       
       
        ;multiplied by increment to get direction (increment or decrement)
        incrementWire=_IncrementMult*increment*GetTechGrid()*2;;this cannot be the min grid
        incrementVia=_IncrementMult*increment*GetTechGrid()

        win=hiGetCurrentWindow()
        ; delete hilight set if already exists in case increment/decrement
        ; is done before timer has kicked in
        pwDeleteHilight(win)
        tk=geGetEditCellView()
       
        ;Filtering objs
        ViasList = setof(x Selection x~>objType == "stdVia");filtering to only vias
        RoutingList = setof(x Selection or(x->objType=="path" x->objType=="pathSeg"))
       
        ;increasing sizes
        when(RoutingList != nil
            pwi=car(RoutingList)
            rw=pwi~>width+incrementWire
           
            ;println(rw)
            pwi~>width=rw

            rw1=artMakeStringPrec15(rw);artMakeString is having troubles with floats
            ;println(rw1)
            ln=pwi~>layerName
            lp=pwi~>layerPurpose
            hs=geCreateHilightSet(geGetEditCellView() list(ln lp) nil)
            hs~>enable=t
            ; store the hilight set as a property on the window to
            ; retrieve later for deletion.
            win~>pwCommonHS=hs
            hp=hiGetPoint(win)
            geAddHilightLabel(hs hp rw1 "centerCenter" "R0" "stick" rw nil)
            hiRegTimer(lsprintf("pwDeleteHilight(window(%d))" win->windowNum) 5)
        )
        when(ViasList != nil
            via=car(ViasList)
            LR=car(via->layer1Enc)
            UD=cadr(via->layer1Enc)
            case(XY
                ("both"
                    foreach(_via ViasList
                        _via->layer1Enc=list(LR+incrementVia UD+incrementVia)
                        _via->layer2Enc=list(LR+incrementVia UD+incrementVia)
                    )
                )
                ("x"
                    foreach(_via ViasList
                        _via->layer1Enc=list(LR+incrementVia UD)
                        _via->layer2Enc=list(LR+incrementVia UD)
                    )
                )
                ("y"
                    foreach(_via ViasList
                        _via->layer1Enc=list(LR UD+incrementVia)
                        _via->layer2Enc=list(LR UD+incrementVia)
                    )
                )
           
            )
           
            ;println(rw)
            ;pwi2~>width=rw
            ;println(ChangeWidthMode)

            rw2=artMakeStringPrec15(car(via->layer1Enc));artMakeString is having troubles with floats
            rw3=artMakeStringPrec15(cadr(via->layer1Enc));artMakeString is having troubles with floats
            ;println(rw1)
            ;ln2=pwi~>layerName
            ;lp2=pwi~>layerPurpose
            hs2=geCreateHilightSet(geGetEditCellView() list("text" "drawing") nil)
            hs2~>enable=t
            ; store the hilight set as a property on the window to
            ; retrieve later for deletion.
            win~>pwCommonHS=hs2
            hp2=hiGetPoint(win)
            ratio=car(via->layer1Enc)
            ratio1=cadr(via->layer1Enc)
            geAddHilightLabel(hs2 list( ((car(hp2)-0.9)+car(hp2)*ratio/32) cadr(hp2))                               rw2 "centerCenter" "R0" "stick" ratio*2 nil)
            geAddHilightLabel(hs2 list( car(hp2)                        ((cadr(hp2)+0.1)+cadr(hp2)*ratio1/32))      rw3 "centerCenter" "R0" "stick" ratio1*2 nil)
            hiRegTimer(lsprintf("pwDeleteHilight(window(%d))" win->windowNum) 5)
        )
      )
    )

    ; retrieve hilight set from the window, and delete if valid
    procedure(pwDeleteHilight(@optional (win hiGetCurrentWindow()))
      when(geIsValidHilightSet(win->pwCommonHS)
        geDeleteHilightSet(win->pwCommonHS)
      )
    )

    ChangeWidthMode="Left"
    procedure(ChangeMode()
        if(Mode=="Left"
            Mode="Right"
            Mode="Left"
        )
    )

    _IncrementMult=1
    procedure(ChangeIncrement()
    println("entro")
        if(_IncrementMult==1
            _IncrementMult=5
            _IncrementMult=1
        )
    )

    ;hiSetBindKey("Layout" "Shift <Key>/" "ChangeMode()") ; ChangeMode
    hiSetBindKey("Layout" "<Key>KP_Divide" "ChangeIncrement()") ; ChangeIncrement
    /*On Merged Bindkeys
    hiSetBindKey("Layout" "Shift Ctrl<Btn4Down>" "CCSChangeWidth2(0.005 \"both\")") ; Mouse scroll wheel up
    hiSetBindKey("Layout" "Shift Ctrl<Btn5Down>" "CCSChangeWidth2(-0.005 \"both\")") ; Mouse scroll wheel down

    hiSetBindKey("Layout" "Ctrl<Btn4Down>" "CCSChangeWidth2(0.005 \"x\")") ; Mouse scroll wheel up
    hiSetBindKey("Layout" "Ctrl<Btn5Down>" "CCSChangeWidth2(-0.005 \"x\")") ; Mouse scroll wheel down

    hiSetBindKey("Layout" "Shift<Btn4Down>" "CCSChangeWidth2(0.005 \"y\")") ; Mouse scroll wheel up
    hiSetBindKey("Layout" "Shift<Btn5Down>" "CCSChangeWidth2(-0.005 \"y\")") ; Mouse scroll wheel down
    */
    • 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