• 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. Changing amount of rows and columns in a selected contact...

Stats

  • Locked Locked
  • Replies 13
  • Subscribers 146
  • Views 20024
  • 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

Changing amount of rows and columns in a selected contact cell

blankman
blankman over 14 years ago

Hi all, Im trying to add bind keys to increment and decrement the amount of rows and columns in a selected contact cell.

 

Im using...

procedure(BSchangeVia2x1()
foreach(fig geGetSelSet()
  when(fig~>objType=="inst"
      propValue = car(fig~>prop~>value)
      fig~>prop~>value=propValue+1
    )
    )
)
hiSetBindKey("Layout" "Alt<key>KP_Add" "BSchangeVia2x1()")

 

However this increments both row and column values. Is there a way to increment only the row value and leave the column value as is?

Cheers,

Brian.

  • Cancel
  • dmay
    dmay over 14 years ago

    Brian,
    Take a look at the prop~>name values. You are incrementing every property by one. Since there are both row and column properties, you will therefore increment both. It is also possible that there are other properties that are not integers and will cause your code to fail. You can actually increment the value of the row and column settings by directly accessing the property by name.

    fig~>row =  fig~>row + 1  (assuming row is the property name)

    Also, in your code you are getting the prop value using:

    car(fig~>prop~>value)

    You are using "car" because fig~>prop is a list and therfore fig~>prop~>value is a list. However, you are incrementing ALL props with this since fig~>prop is a list:

    fig~>prop~>value = propValue + 1

    If you just want to change the first prop:

    car(fig~>prop~>value) = propValue + 1

    This is more consistent with the way you retrieved the value in the first place. However, the property list is not always going to be in the order you expect. You should look at the property name before you adjust the value either by going to the known property directly as I demonstrated (fig~>row), or by checking the name like this:

    foreach(prop fig~>prop
      when(fig~>prop~>name=="row"
        fig~>prop~>value = fig~>prop~>value + 1
      )
    )

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Or you could use dbFindProp or dbGetPropByName instead of that last foreach:

    prop=dbFindProp(fig "row")
    prop~>value=prop~>value+1

    Andrew (sorry, not very responsive at the moment; too much time needed for the day job)

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    Thanks lads, that did the trick. I appreciate the help!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • sudheer g
    sudheer g over 14 years ago

    hello guys,

    can we use the car(.....) function on the left hand side...

    ex: 

    car(fig~>prop~>value)=propvalue+1;

    is it possible?

    i think not...

    if it is impossible to use car(....) on the left hand side how can we modify only rows in that?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • sudheer g
    sudheer g over 14 years ago

     hey try this

     procedure(viarowincrement()
    fig=geGetSelSet()
    foreach(fig geGetSelSet()
    when(fig~>objType=="inst"
    rov=fig~>row
    fig~>row=rov+1
    );when
    );foreach
    );procedure
    hiSetBindKey("Layout" "Alt Shift<key>=" "viarowincrement()")

    procedure(viarowdecrement()
    fig=geGetSelSet()
    foreach(fig geGetSelSet()
    when(fig~>objType=="inst"
    rov=fig~>row
    if(rov>2
    fig~>row=rov-1
    );if
    );when
    );foreach
    );procedure
    hiSetBindKey("Layout" "Alt Shift<key>-" "viarowdecrement()")



    procedure(viacolumnincrement()
    fig=geGetSelSet()
    foreach(fig geGetSelSet()
    when(fig~>objType=="inst"
    colum=fig~>column
    fig~>column=colum+1
    );when
    );foreach
    );procedure
    hiSetBindKey("Layout" "Ctrl Shift<key>=" "viacolumnincrement()")

    procedure(viacolumndecrement()
    fig=geGetSelSet()
    foreach(fig geGetSelSet()
    when(fig~>objType=="inst"
    colum=fig~>column
    if(colum>2
    fig~>column=colum-1
    );if
    );when
    );foreach
    );procedure
    hiSetBindKey("Layout" "Ctrl Shift<key>-" "viacolumndecrement()")

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    Heres the code I ended up using. I noticed I had to delete the property once values had reached below 2 columns as it output strange behaviour for negative row and column values..

     

    ;Procedures to change already placed contact -> column/row


    procedure(BSchangeViaHorizInc()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                  prop=dbFindProp(fig "column")
                if( prop != nil
                    then fig~>column = fig~>column + 1
                    else dbCreateProp(fig "column" "int" 2)
                )
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Multiply" "BSchangeViaHorizInc()")

    procedure(BSchangeViaHorizDec()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                  prop=dbFindProp(fig "column")
                if( prop != nil
                    then     if( fig~>column >= 3
                            then fig~>column = fig~>column - 1
                            else dbDeletePropByName(fig "column")
                        )
                    else    nil
                )
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Divide" "BSchangeViaHorizDec()")

    procedure(BSchangeViaVertInc()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                  prop=dbFindProp(fig "row")
                if( prop != nil
                    then fig~>row = fig~>row + 1
                    else dbCreateProp(fig "row" "int" 2)
                )
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Add" "BSchangeViaVertInc()")

    procedure(BSchangeViaVertDec()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                  prop=dbFindProp(fig "row")
                if( prop != nil
                    then     if( fig~>row >= 3
                            then fig~>row = fig~>row - 1
                            else dbDeletePropByName(fig "row")
                        )
                    else    nil
                )
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Subtract" "BSchangeViaVertDec()")

    procedure(BSchangeVia2x1()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                dbDeletePropByName(fig "row")
                dbCreateProp(fig "row" "int" 2)
                dbDeletePropByName(fig "column")
                )
            )
        )
    )
    hiSetBindKey("Layout" "Shift Alt<key>KP_Subtract" "BSchangeVia2x1()")

    procedure(BSchangeVia1x2()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                dbDeletePropByName(fig "column")
                dbCreateProp(fig "column" "int" 2)
                dbDeletePropByName(fig "row")
                )
            )
        )
    )
    hiSetBindKey("Layout" "Shift Alt<key>KP_Add" "BSchangeVia1x2()")

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    And also the via justification.....

    ;Procedures to change already placed contact -> justification

    procedure(BSchangeViaLeft()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                dbDeletePropByName(fig "xBias")
                dbCreateProp(fig "xBias" "string" "right")
                dbDeletePropByName(fig "yBias")
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Home" "BSchangeViaLeft()")

    procedure(BSchangeViaRight()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                dbDeletePropByName(fig "xBias")
                dbCreateProp(fig "xBias" "string" "left")
                dbDeletePropByName(fig "yBias")
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Page_Up" "BSchangeViaRight()")

    procedure(BSchangeViaUp()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                dbDeletePropByName(fig "yBias")
                dbCreateProp(fig "yBias" "string" "bottom")
                dbDeletePropByName(fig "xBias")
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Up" "BSchangeViaUp()")

    procedure(BSchangeViaDown()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                dbDeletePropByName(fig "yBias")
                dbCreateProp(fig "yBias" "string" "top")
                dbDeletePropByName(fig "xBias")
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Begin" "BSchangeViaDown()")

    procedure(BSchangeViaCenter()
        foreach(fig geGetSelSet()
            when(fig~>objType=="inst"
                dbDeletePropByName(fig "yBias")
                dbDeletePropByName(fig "xBias")
            )
        )
    )
    hiSetBindKey("Layout" "Alt<key>KP_Right" "BSchangeViaCenter()")

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • vmartins
    vmartins over 14 years ago

    Hi to all, great job but I dont know what cadence version was used but in version 6

    is not working....

    it gives back this message:

    BSchangeViaHorizDec()
    (db:0x17910412)

     and nothing happen to the via.

     

    keep up with the good feature.

    Vasco

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Vasco,

    Looking at the code, it was written for IC5141 (or earlier) - essentially it follows the CDB model for vias (which are just instances). In OpenAccess, vias are separate objects - and the code checks that they are instances. It's not as simple as checking that the selected objects are vias - the property names are different, and the dbFindProp would fail. Needs a fairly hefty overhaul (don't have time to do this myself, unfortunately).

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • vmartins
    vmartins over 14 years ago

    Hi, thanks for the reply...

    I see, update changes... anyway I didn't need a so complex code, just a way to input variables in the a field inside the option form.

     But thanks for the help anyway, maybe some other time.

    best regards and keep up with the good work

    Vasco 

    • 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