• 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. Layout/PCell size scaling

Stats

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

Layout/PCell size scaling

Aldo2
Aldo2 over 10 years ago

Hello,

Is there a command from Virtuoso menu to scale a layout of a custom size factor?

Is there a skill command that I could introduce in a PCell definition (inside pcDefinePCell) to scale the cell itself of a size factor given in CDF?

Thank you

Best regards,

Aldo

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Hi Aldo,

    There's a UNIX command called "XScale" which can be used to scale databases. Note however that this won't be useful for pcells, because it simply scales the coordinates in the database files, and anything generated from a pcell will be re-generated when you open the database.

    You can call dbCreateXformPCell() which will create you a pcell for a particular cellView, which allows you to provide a scale factor on the instance (this is intended to be effectively a replacement in OpenAccess-enabled versions for the old CDB "mag" parameter, which doesn't exist in OA).

    Maybe one of those will help you?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Aldo2
    Aldo2 over 10 years ago

    Hi Andrew,

    Could I use dbCreateXformPCell() inside the PCell definition (i.e. inside pcDefinePCell() )?

    Could you provide an example code to add a skill command to the Virtuoso menu bar (I would like to have dbCreateXformPCell()  always available from menu)?

    What about leSizeShape? Could it be used in a for() loop by selecting and then re-sizing all the shapes (both in pcDefinePCell and in Virtuoso layout editor menu)?

    Thank you

    Best regards,

    Aldo 

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

    Hi Aldo,

    First of all, there's a difference between sizing and scaling. Sizing is moving the edges of a shape out (or in) by a certain dimension (so you could oversize by 0.2um for example), whereas scaling is a transformation that multiplies each coordinate by a factor. So leSizeShape is a different operation to scaling.

    Calling dbCreateXformPCell inside the pcDefinePCell wouldn't make any sense - because it creates a pcell itself. Instead you might want to use dbTransformCellView(). This example does this in order to take advantage of the angle part, but it equally could use the magnification factor:

    ;------------------------------------------------------------------------
    ; Example of using dbTransformCellView() within a pcell to allow
    ; arbitrary rotation.
    ;
    ; Andrew Beckett and Gilles Lamant
    ; 17th January 2006
    ;------------------------------------------------------------------------
    
    pcDefinePCell(
        list(ddGetObj("master") "rotpcell1" "layout")
    
        ;----------------------------------------------------------------
        ; Formal parameters
        ;----------------------------------------------------------------
        (
            (width 6.0)
            (length 1.0)
            (angle 0.0)
            (layer1 "metal1")
            (layer2 "metal2")
        )
    
        ;----------------------------------------------------------------
        ; Code itself
        ;----------------------------------------------------------------
        let((rect)
            ;----------------------------------------------------------------
            ; Create some shapes
            ;----------------------------------------------------------------
            dbCreateRect(
                pcCellView
                layer1
                list(0:0 width:length)
                )
            ;----------------------------------------------------------------
            ; Since rotating an ellipse would mean that the bounding box gets
            ; rotated, but the axes of the ellipse would stay orthogonal, we
            ; need to convert to polygon
            ;----------------------------------------------------------------
            dbConvertEllipseToPolygon(dbCreateEllipse(
                pcCellView
                layer2
                list(2:3 width+2:length+3)
                ) 16)
            dbCreateLabel(pcCellView "text" 0.0:0.0 sprintf(nil "%g" angle)
                "lowerLeft" "R0" "stick" 1.0)
            ;----------------------------------------------------------------
            ; Transform the whole cellView, using an arbitrary magnification
            ; and angle
            ;----------------------------------------------------------------
            dbTransformCellView(pcCellView 1.0 angle)
        ) ; let
    ) ; pcDefinePCell

    Similarly I doubt you'd want dbCreateXformPCell on a menu, because it creates a new pcell. If you want to transform all the shapes in the current cellView, you might want to create a simple form which allows you to specify the factor (and optionally angle).

    Be warned though that only shapes can be transformed; the contents of instances don't get affected. Below is an implementation of a rotator pcell (which does scaling too) which was sort-of a precursor to dbCreateXformPCell. You'll see that it has to flatten the hierarchy to be able to transform everything:

    ;------------------------------------------------------------------------
    ; This example illustrates how to implement a generic instance
    ; rotator with arbitrary angles.
    ;
    ; The code may not fully handle connectivity.
    ; 
    ; If the master changes after the pcell has been evaluated, that will
    ; not be immediately reflected, as that would not trigger a pcell
    ; re-evaluation.
    ;
    ; This code is not intended to rotate pcells - that is best handled
    ; in the pcell itself, using the dbTransformCellView() function directly.
    ; If a pcell is rotated, only the default pcell parameters will be used.
    ; 
    ; Andrew Beckett and Gilles Lamant
    ; 17th January 2006
    ;------------------------------------------------------------------------
    
    pcDefinePCell(
        list(ddGetObj("master") "rotator" "layout")
    
        ;----------------------------------------------------------------
        ; Formal parameters
        ;----------------------------------------------------------------
        (
            (angle 0.0)
            (magnification 1.0)
            (lib "")
            (cell "")
            (view "")
            (nsides 16)
        )
    
        ;----------------------------------------------------------------
        ; Code itself
        ;----------------------------------------------------------------
        let((inst master success)
            ;----------------------------------------------------------------
            ; Do some sanity checking to ensure the placed cellView exists
            ;----------------------------------------------------------------
            when(ddGetObj(lib cell view)
                master=dbOpenCellViewByType(lib cell view)
                when(master
                    ;--------------------------------------------------------
                    ; Create the instance and then flatten it to 32 levels
                    ; of hierarchy
                    ;--------------------------------------------------------
                    inst=dbCreateInst(pcCellView master "" 0:0 "R0")
                    dbFlattenInst(inst 32 t t)
                    ;--------------------------------------------------------
                    ; Some shape types (ellipses) do not rotate as expected,
                    ; so need to convert them to polygons
                    ;--------------------------------------------------------
                    foreach(shape pcCellView~>shapes
                        case(shape~>objType
                            ("ellipse" dbConvertEllipseToPolygon(shape nsides))
                        )
                    )
                    dbCreateLabel(pcCellView "text" 0.0:0.0 
                        sprintf(nil "Ang:%g Mag:%g" angle magnification)
                        "lowerLeft" "R0" "stick" 1.0)
                    ;----------------------------------------------------------------
                    ; Transform the whole cellView, using an arbitrary magnification
                    ; and angle
                    ;----------------------------------------------------------------
                    dbTransformCellView(pcCellView magnification angle)
                    success=t
                ) ; when
            ) ; when
            ;----------------------------------------------------------------
            ; Place a marker if the cellView cannot be opened
            ;----------------------------------------------------------------
            unless(success
                getWarn()
                dbCreateMarker(
                    pcCellView
                    sprintf(nil "Cellview %L/%L/%L cannot be opened" lib cell view)
                    "pcellRotator"
                    list(0:0 0:1 1:1 1:0)
                    nil
                    t t "error"
                ) ; dbCreateMarker
            ) ; unless
        ) ; let
    ) ; pcDefinePCell

    Kind Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Aldo2
    Aldo2 over 10 years ago

    Hi Andrew,

    dbTransformCellView is what I need!

    Thank you very much

    Kind regards,

    Aldo

    • 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