• 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. VI Editor Script

Stats

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

VI Editor Script

xv12
xv12 over 13 years ago
I am using the function dbWriteSkill to dump the layout to a file and want to modify to just stretch the length and everything contact metal implant will also stretch.
I want to use the vi editor to modify.  Does anyone have a quick way to do it. For me I have to delete one by one and it take a longtime  
Below is the partial dump file
dbD_0xcd1f768 = dbCreatePolygon(dbD_0xcc0c42c list(16 252)
 list(2.650000e+01:2.930000e+01 2.240000e+01:2.930000e+01 2.240000e+01:7.000000e+00
      7.000000e+00:7.000000e+00 7.000000e+00:2.520000e+01 2.240000e+01:2.520000e+01
      2.240000e+01:2.930000e+01 2.900000e+00:2.930000e+01 2.900000e+00:2.900000e+00
      2.650000e+01:2.900000e+00 ) )
And this is what I want to change.
 (pcLayer = 16)
 (pcPurpose = "drawing")
 (pcInst = dbCreatePolygon(pcCellView
  list(pcLayer pcPurpose)
  list((26.5:(29.3 + l_float0offset))
      (22.4:(29.3 + l_float0offset))
      (22.4:7.0)
      (7.0:7.0)
      (7.0:(25.2 + l_float0offset))
      (22.4:(25.2 + l_float0offset))
      (22.4:(29.3 + l_float0offset))
      (2.9:(29.3 + l_float0offset))
      (2.9:2.9)
      (26.5:2.9)
  )
  • Cancel
  • dmay
    dmay over 13 years ago

    Why would you want to do it this way? The Skill language is sufficient to be able to adjust all those coordinate values without you having to dump a text file, edit that text file in vi and then reload it. If you can explain more clearly what you wish to do with the layout (rather than explaining the odd methodology), I'm sure someone on this forum can help you.

    Which shapes do you want to modify? ("everything contact metal implant" is a little unclear)
    How do you want to modify them? ("stretch the length" - are you wanting to stretch all in the y direction by l_float0offset?)

    foreach(shp geGetEditCellView()~>shapes
      when(member(shp~>layerName list("contact" "metal" "implant))
        case(shp~>objType
          ("polygon"
            newPtList=nil
            foreach(pt shp~>points
              do something with the point and build a new point list
            )
            shp~>points=newPtList
          )
          ("rect"
            adjust the bbox
            shp~>bBox = bBox
          )
          ("path"
            newPtList=nil
            foreach(pt shp~>points
              do something with the point and build a new point list
            )
            shp~>points=newPtList
          )
          (t
            printf("Found %s objType and did not adjust it\n" shp~>objType)
          )
        )
      )
    )

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 13 years ago

    Hi Xv12,

    I agree with Derek, and I'd like to build on his suggestions.  For adjusting points you can use the function geTransformUserPoint() with an appropriate transform to adjust each point, and you can use the geTransformUserBBox() to adjust a box, such as for the 'rect' case.  So, if you wished to move something in the y direction, the transform argument to these functions might look like

    list(0:yOffset "R0")

    If you are performing a stretch, then you would need to decide which point or points need to remain and which ones are to be adjusted. There is a function leStretchFig() that could perform a SKILL-level stretch (i.e. without needing to haev the layout open graphically, if needing to perform batch processing, for example).

    The dbWriteSkill method is probably not the best or most efficient approach.

    I hope this helps - but as Derek mentioned, more details about what you need/want to do would be useful in getting better answers and solutions.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • xv12
    xv12 over 13 years ago
    Thanks for your information. The reason for not doing Pcell is because it is very time consuming. There are many layers with doughnut shape. In addition, the layout only changes in the height direction. Everything else stays the same. The layout only allows to "grow" in the height direction. When the height stretches, additional contacts will be placed. Tien
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 13 years ago

     Hi Tien,

    Neither Derek nor I mentioned PCells, so I'm not sure where you got this from.  It is possible to write SKILL that can act directly on a layout or schematic cellview (or multiple cellviews, one at a time) so that the cellview can be queried and even modified in a procedural fashion.  Are the "doughnut" shapes of objType "donut", or are they polygons constructed as closed shapes?  If you have additional shapes to be placed as another shape is stretched, have you considered using a multi-part path (MPP) ROD object as can be created using the menu Create -> Multipart Path ?  Then the contact shapes can be added as the master path shape is stretched...

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • xv12
    xv12 over 13 years ago
    May be my question was not clear. But thanks for all the info, I would consider those inputs for future use. I think it is very useful for what I am dong. But going back to Vi question, all I really need was just the command(s) on how to get rid of the zeroes so I don't need to re-type, and the data was just a partial of several hundreds lines. I need to construct the graphical layout quickly and can someone point to me that I can use vi to replace those zeroes to get those points to form a simple pcell without doing the stretch manually.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    You're mixing terminology all over the place here, which makes it very unclear. The example you gave in the original post looked like pcell code (i.e. what you were changing to, with all those pcCellView references etc), but yet you say you don't want to create a pcell. Then in this last append you say you want to "form a simple pcell". It's no wonder nobody understands what you're trying to do!

    As has been said consistently, dumping to SKILL and editing the SKILL is not a terribly efficient way of stretching some shapes. It would be easier to write some SKILL code to identify the shapes you want to edit (maybe even select them in the layout editor) and then have SKILL code manipulate the points for those shapes.

    If you're asking a question about how to change a floating point number in the dumped SKILL code in vi to a number without an exponent, then that's going to be quite hard. However, getting rid of the multiple zeros is just a matter of doing:

    :g/0*e/s//e/g

    If you want to preserve one 0, use:

    :g/0+e/s//0e/g

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • xv12
    xv12 over 13 years ago
    Thanks Derek for the info. My bad for posting unclear and confuse question..Will take me sometime but I will try your suggestion on my other pcell.

    Best Regards,
    Tien
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • xv12
    xv12 over 13 years ago
    Thanks Andrew,
    The first one is what I am looking for and using it I know Vi has that capability. Sorry for posting unclear  

    Your guys are really great help and fast.

    Appreciate! and thank you all.

    Tien
    • 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