Rod User

March 21, 2018 | Author: FrankLiu | Category: Hierarchy, Trademark, Parameter (Computer Programming), Databases, Reserved Word


Comments



Description

Virtuoso® Relative Object Design User Guide Product Version 5.0 July 2002 © 1998-2002 Cadence Design Systems, Inc. All rights reserved. Printed in the United States of America. Cadence Design Systems, Inc., 555 River Oaks Parkway, San Jose, CA 95134, USA Trademarks: Trademarks and service marks of Cadence Design Systems, Inc. (Cadence) contained in this document are attributed to Cadence with the appropriate symbol. For queries regarding Cadence’s trademarks, contact the corporate legal department at the address shown above or call 1-800-862-4522. All other trademarks are the property of their respective holders. Restricted Print Permission: This publication is protected by copyright and any unauthorized use of this publication may violate copyright, trademark, and other laws. Except as specified in this permission statement, this publication may not be copied, reproduced, modified, published, uploaded, posted, transmitted, or distributed in any way, without prior written permission from Cadence. This statement grants you permission to print one (1) hard copy of this publication subject to the following conditions: 1. The publication may be used solely for personal, informational, and noncommercial purposes; 2. The publication may not be modified in any way; 3. Any copy of the publication or portion thereof must include all original copyright, trademark, and other proprietary notices and this permission statement; and 4. Cadence reserves the right to revoke this authorization at any time, and any such use shall be discontinued immediately upon written notice from Cadence. Disclaimer: Information in this publication is subject to change without notice and does not represent a commitment on the part of Cadence. The information contained herein is the proprietary and confidential information of Cadence or its licensors, and is supplied subject to, and may be used only by Cadence’s customer in accordance with, a written agreement between Cadence and its customer. Except as may be explicitly set forth in such agreement, Cadence does not make, and expressly disclaims, any representations or warranties as to the completeness, accuracy or usefulness of the information contained in this document. Cadence does not warrant that use of such information will not infringe any third party rights, nor does Cadence assume any liability for damages or costs of any kind that may result from use of such information. Restricted Rights: Use, duplication, or disclosure by the Government is subject to restrictions as set forth in FAR52.227-14 and DFAR252.227-7013 et seq. or its successor. Virtuoso Relative Object Design User Guide July 2002 3 Product Version 5.0 Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Syntax Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Keyword-Value Pair Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1 Relative Object Design Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Creating Parameterized Cells with ROD Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Named Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Hierarchical Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Handles on ROD Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 System-Defined Handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 User-Defined Handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Aligning Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 When Are ROD Alignments Recalculated? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Separating Aligned ROD Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 ROD Objects in Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Querying Objects for Alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Stretchable Parameterized Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 The Stretchable Pcell Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Assigning Handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Specifying Environment Variables for Stretchable Pcells . . . . . . . . . . . . . . . . . . . . . . 44 Specifying the Frequency of Pcell Regeneration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Results of Stretching a Handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Displaying Pcell Stretch Handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Multipart Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Connectivity for Multipart Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 System-Defined Handles for Multipart Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Multipart Rectangles as ROD Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Creating a Multipart Rectangle from Other Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Contents Virtuoso Relative Object Design User Guide July 2002 4 Product Version 5.0 Editing Multipart Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Multipart Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Types of Subparts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Master Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Offset Subpaths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Enclosure Subpaths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Sets of Subrectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Ends of Paths and Subrectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Making Paths Choppable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Connectivity for Multipart Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 System-Defined Handles for Multipart Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Multipart Paths as ROD Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Creating a Path from Other Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Editing Multipart Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Creating Objects from Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Creating a Rectangle from Another Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Creating a Polygon from Another Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Creating a Path from Another Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Maintaining Connections for ROD Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Preserving Maintained Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 2 Accessing Information about ROD Objects . . . . . . . . . . . . . . . . . . 113 About ROD Objects and ROD Object IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Getting the ROD Object ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Getting the ROD Object ID Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Storing the ROD Object ID as a Variable (Avoid) . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Checking Whether an Object Is a ROD Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Accessing ROD Object Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Examples of Using ~> to Display Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Getting System-Defined Handle Values with a Script . . . . . . . . . . . . . . . . . . . . . . . 125 Getting User-Defined Handle Names with a Script . . . . . . . . . . . . . . . . . . . . . . . . . 128 Virtuoso Relative Object Design User Guide July 2002 5 Product Version 5.0 3 Using Relative Object Design Functions. . . . . . . . . . . . . . . . . . . . . . 131 Editing ROD Objects with the Virtuoso Layout Editor . . . . . . . . . . . . . . . . . . . . . . . . 132 Data Types for SKILL Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Using Variables in ROD Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Maximum String Length for ROD Function Arguments . . . . . . . . . . . . . . . . . . . . . . 135 Using Special Characters in Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 rodAddMPPChopHole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 rodAddPoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 rodAddToX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 rodAddToY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 rodAlign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Aligning ROD Objects Using rodAlign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 rodAssignHandleToParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Displaying Parameter Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 User-Defined Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Virtuoso Relative Object Design User Guide July 2002 6 Product Version 5.0 rodCreateHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Creating Handles Using rodCreateHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 rodCreatePath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 ROD Connectivity Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Offset Subpath Arguments (l_offsetSubpathArgs) . . . . . . . . . . . . . . . . . . . . . . . . . . 191 Enclosure Subpath Arguments (l_encSubpathArgs) . . . . . . . . . . . . . . . . . . . . . . . . 193 Subrectangle Arguments (l_subrectArgs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 Creating Self-Intersecting Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Specifying Arguments as nil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Specifying Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 Formatting List-of-Lists Arguments for Subparts . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 How the System Creates Subrectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 Disconnecting Shapes in a Multipart Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 Making a Former MPP Part into a ROD Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 Creating Paths with rodCreatePath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 rodCreatePolygon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 rodCreateRect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 ROD Connectivity Arguments for Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Subrectangle Arguments (l_subrectArgs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Creating Objects Using rodCreateRect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Creating a Named Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Creating a Multipart Rectangle with Rows/Columns of Master Rectangles . . . . . . . 248 Filling Bounding Boxes with Master Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 Virtuoso Relative Object Design User Guide July 2002 7 Product Version 5.0 Creating Rectangles on a Terminal and Net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 Creating Rectangular Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 rodDeleteHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 rodFillBBoxWithRects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 rodGetHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 rodGetNamedShapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 rodGetObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Using rodGetObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 rodIsFigNameUnused . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 rodIsHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 rodIsObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 Virtuoso Relative Object Design User Guide July 2002 8 Product Version 5.0 rodNameShape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 Naming Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 rodPointX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 rodPointY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 rodSubPoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 rodUnAlign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Unaligning All Zero-Level Shapes in a Cellview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 rodUnNameShape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 Unnaming All Named Shapes in a Cellview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 Virtuoso Relative Object Design User Guide July 2002 9 Product Version 5.0 Solutions to Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Solutions for rodAlign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Solutions for rodCreateHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 Solutions for rodCreatePath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 Solutions for rodCreateRect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 Solutions for rodGetObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 Solutions for rodNameShape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 A Using Environment Variables with ROD . . . . . . . . . . . . . . . . . . . . . . 297 Checking the Value of a ROD Environment Variable . . . . . . . . . . . . . . . . . . . . . . . . 299 How the System Evaluates ROD Environment Variables . . . . . . . . . . . . . . . . . . . . . 299 Changing the Settings of ROD Environment Variables . . . . . . . . . . . . . . . . . . . . . . 299 B Accessing the Cellview ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 Getting the Cellview ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 C Using Design Rules in ROD Functions . . . . . . . . . . . . . . . . . . . . . . . 303 Using Design Rules for Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Accessing Design Rules with techGetSpacingRule . . . . . . . . . . . . . . . . . . . . . . . . . 304 D Displaying Pin Names in a Layout Window. . . . . . . . . . . . . . . . . . . 305 Setting the Pin Names Environment Variable in .cdsenv . . . . . . . . . . . . . . . . . . . . . 305 Turning on Pin Names in the Display Options Form . . . . . . . . . . . . . . . . . . . . . . . . . 305 Virtuoso Relative Object Design User Guide July 2002 10 Product Version 5.0 E How Virtuoso Layout Editor Works with ROD Objects . . . . . . 309 F Code Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 Using ROD to Create Multipart Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 Using Stretchable Pcells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 Creating a Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 Creating a Contact Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 Creating a Guard Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 Creating a Shielded Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 Creating a Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 Getting the Resistance for a ROD Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 getRodPathLength Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 createResHandle Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 Stretchable MOS Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 Code for simplemos Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 Code for contcov User-Defined Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 Code for myStretch User-Defined Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 G Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 Warnings in the CIW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 Template templateName is replacing an existing template by the same name . . 337 Creating instance forces unname of ROD object . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 ROD object ID changes after Undo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 Dialog Box Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 Why is a dialog box asking about saving the technology file? . . . . . . . . . . . . . . . . . 339 Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 Virtuoso Relative Object Design User Guide July 2002 11 Product Version 5.0 Preface Welcome to the Virtuoso Relative Object Design User Guide. Virtuoso ® relative object design (ROD) is a set of high-level functions for defining simple to complex layout objects and their relationships to each other, without the need to use low-level Cadence ® SKILL language functions. This user guide is designed for readers who are familiar with the Cadence ® SKILL language and have created parameterized cells using SKILL or the graphical user interface. If you are not familiar with SKILL, Cadence suggests that you attend the “SKILL for Programmers” course. Note: For information about how the Virtuoso ® layout editor commands work with Virtuoso ® relative object design (ROD) objects, see Appendix E, “How Virtuoso Layout Editor Works with ROD Objects”. The Preface discusses the following: I Related Documents on page 11 I Syntax Conventions on page 12 ❑ Keyword-Value Pair Arguments on page 13 Related Documents The following documents contain information about related tools and the SKILL language. I For what’s new, refer to the Virtuoso Relative Object Design Product Notes. I For outstanding product change requests (PCRs), refer to the Virtuoso Relative Object Design Known Problems and Solutions. I For information about how to performdesign tasks with the Virtuoso® layout editor, refer to the Virtuoso Layout Editor User Guide. I For information about how to perform design tasks with the Virtuoso® XL Layout Editor, refer to the Virtuoso XL Layout Editor User Guide. Virtuoso Relative Object Design User Guide Preface July 2002 12 Product Version 5.0 I For information about parameterized cell SKILL functions, refer to the Custom Layout SKILL Functions Reference Manual. I To create parameterized cells with the graphic user interface or low-level SKILL functions, refer to the Virtuoso Parameterized Cell Reference. I For a tutorial on creating parameterized cells using the graphic user interface, refer to the Cell Design Tutorial. I For examples of pcells, refer to the Sample Parameterized Cells Installation and Reference. I For general information about technology files, how to use them, and how to use the technology file graphical user interface commands, refer to the Technology File and Display Resource File User Guide. I For reference information about technology rules and defining classes and subclasses, refer to the Technology File and Display Resource File ASCII Syntax Reference Manual. I For information about the Cadence ® SKILL language functions that operate on technology files and display reference files, refer to the Technology File and Display Resource File SKILL Reference Manual. I For information about database SKILL functions, including data access, refer to the Cadence Design Framework II SKILL Functions Reference Manual. I For information about basic SKILL functions, such as car, foreach, if, and while, refer to the SKILL Language Reference Manual. I For information about library structure, the cds.lib configuration file, or name mapping for data shared across multiple Cadence tools, refer to the Cadence Application Infrastructure User Guide. I For information about how to install products, refer to the Cadence Installation Guide. Syntax Conventions The syntax conventions used in this document are described below. text Indicates text you must type exactly as it is presented. z_argument... Indicates text that you must replace with an appropriate argument. The prefix indicates the data type(s) the argument can accept, for example t_ for text. The three dots indicate that you Virtuoso Relative Object Design User Guide Preface July 2002 13 Product Version 5.0 can repeat the argument. Substitute one or more names or values. Do not type the data type or underscore. | Separates possible choices for a single argument and takes precedence over any other character. Also separates the values returned by a SKILL function. [ ] Indicate and enclose optional arguments. { } Indicate you must specify one of the enclosed arguments. => Precedes the values returned by a SKILL function. Keyword-Value Pair Arguments Many ROD functions have keyword-value pairs for arguments. For example, the rodCreateHandle function uses keyword-value pairs as arguments: rodCreateHandle( [?name t_name] ?type t_type ?value g_value ?rodObj R_rodObj The keyword (?name, ?type, and so on) is the name of the argument. You must type it preceded by a question mark ( ? ); follow the keyword with a space and the value or expression you want to assign to the argument. For example: rodCreateHandle( ?name "floatHandle" ?type "float" ?value 3.3 ?rodObj rodObj In the example above, the keyword ?rodObj is set to the value represented by R_rodObj. Virtuoso Relative Object Design User Guide Preface July 2002 14 Product Version 5.0 Virtuoso Relative Object Design User Guide July 2002 15 Product Version 5.0 1 Relative Object Design Concepts The topics covered in this chapter are Introduction on page 16 Creating Parameterized Cells with ROD Functions on page 16 Handles on ROD Objects on page 18 Aligning Objects on page 35 ROD Objects in Hierarchy on page 37 Stretchable Parameterized Cells on page 38 Multipart Rectangles on page 55 Multipart Paths on page 59 Creating Objects from Objects on page 90 Connectivity on page 108 Maintaining Connections for ROD Objects on page 109 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 16 Product Version 5.0 Introduction Virtuoso ® relative object design (ROD) is a set of high-level functions for defining simple to complex layout objects and their relationships to each other, without the need to use low-level Cadence ® SKILL language functions. ROD lets you create objects and define their relationships at a high level of abstraction, so you can concentrate on your design objectives. ROD automatically handles the intricacies of traversing the design hierarchy and simplifies the calculations required to create and align geometries. Generally, with a single ROD function call, you can accomplish a task that otherwise would require several lower-level SKILL function calls. For example, creating a pin required a series of low-level SKILL function calls, but with ROD, you use a single function to create a shape and designate it as a pin. You can create entities such as guard rings, contact arrays, and transistors with one function call. You can also create an object froman existing object just by specifying the size of the new object. ROD functions allow you to I Create hierarchical parameterized cells easily I Name rectangles, polygons, paths, lines, dots, labels, and text display objects I Access objects by name through all levels of hierarchy I Access points and other information stored on objects through all levels of hierarchy I Align ROD objects to each other or to specific coordinates I Assign handles to pcell parameters for interactive stretching I Create multipart rectangles and multipart paths I Create objects from other objects For a complete description of the ROD functions, see Appendix 3, “Using Relative Object Design Functions”. Creating Parameterized Cells with ROD Functions Using ROD functions to create geometries for pcells increases your productivity by reducing the difficulty and complexity of the code you have to write. To create SKILL pcells without ROD, you must use low-level SKILL database access functions to build and manipulate geometries. You end up spending a great deal of time and effort calculating and tracking geometry coordinates. Complex SKILL pcells are much easier to create and maintain when you create geometries with ROD functions. Instead of writing code to compute point Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 17 Product Version 5.0 coordinates across levels of hierarchy, you create high-level building blocks and align themin relation to each other. Historically, using programs to create large macro cells and full-chip assemblies required a tremendous effort by SKILL developers who were dedicated exclusively to writing pcell code. ROD provides high-level design capture support so that even designers with limited programming experience can create complex pcells easily, and those with advanced programming abilities can generate sophisticated cells and blocks. Once you capture a design in the formof parameterized code, it is easy to generate a variety of cell modules using different parameter values and different technology rules. Also, creating a single design that captures your intention reduces errors frommanipulating low-level layout objects independently of each other. Major advantages for using ROD to create pcells are: I You can base the pcell parameters on rules from your technology file, making the pcells tolerant of changes to your technology I You can assign point handles to pcell parameters that let you update the parameters interactively by stretching the pcell in the Virtuoso ® layout editor Before you use ROD functions in pcells, see the safety rules for creating SKILL pcells in “Creating Pcells Using SKILL” in the Virtuoso Parameterized Cell Reference. For examples of pcells, see the Sample Parameterized Cells Installation and Reference. Named Objects You can assign a name to a zero-level object (an ordinary database shape, such as a rectangle or polygon) either by naming an existing object with the rodNameShape function or by using a RODcreate function to create an object. You can also name a shape when you create it with the Virtuoso layout editor. You can access information through hierarchy about named objects, such as instances and named shapes. Hierarchical Name To access information about a named shape or instance through hierarchy, use its hierarchical name and the top-level cellview ID. A hierarchical name consists of the names of the instances through which you need to descend to reach the desired named shape or instance. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 18 Product Version 5.0 The following figure shows the hierarchy in a layout cellview containing the named shape polyRect. Its hierarchical name is INV1/ptr1/polyRect. When you name an existing database shape using the ROD naming function, the function creates ROD information associated with the shape. This information is stored in a ROD object and is identified by a unique RODobject ID. The information contained in a ROD object includes its name and database ID. When you create a newshape with a RODcreation function, the function creates a named database shape and a ROD object. Handles on ROD Objects A handle is an attribute of, or item of information about, a ROD object, such as the coordinates of a point on the bounding box around an object, the width of the bounding box of an object, or the resistance of an object. You can access handles through all levels of hierarchy. There are two kinds of handles: system-defined handles and user-defined handles. When you create a RODobject, the systemautomatically defines a number of handles for the object. The values of system-defined handles are not stored in memory but are calculated on demand when you reference the handles by their names. The values of user-defined handles are stored in memory. The value of a system-defined point handle is the coordinates for a point on the object or on its bounding box, relative to the coordinate system of the top-level layout cellview. For a detailed description of how the system calculates coordinates through hierarchy, see “ROD Objects in Hierarchy” on page 37. Using the rodAlign function, you can use handles to align one object to another object to store information, or to access information about an object that is at a lower level in the design hierarchy. Y X polyRect ptr1 of pTran INV1 of inverter Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 19 Product Version 5.0 System-Defined Handles The system automatically defines the following types of handles for most ROD objects: I Bounding box point handles I Bounding box width and length handles I Segment point handles I Segment length handles ROD dots, labels, and text display objects are defined by a single point, so all of their point handles evaluate to their origin point and their length and width handles evaluate to zero. Note: For multipart paths, the system also provides the handle mppBBox, which contains a list of the lower-left and upper-right coordinates of the bounding box around the whole multipart path. The following table summarizes the types of handles and the ROD object(s) to which they apply. Bounding Box Point Handles There are nine system-defined point handles associated with the bounding box around every ROD object: I One at each corner I One in the center of each edge I One in the center of the bounding box Table 1-1 System-Defined Handles for ROD Objects Type of Handle Applies to... Bounding Box Point Handles All ROD objects except dots, labels, and text display objects Bounding Box Width and Length Handles All ROD objects except dots, labels, and text display objects mppBBox ROD multipart paths Segment Point Handles ROD rectangles, polygons, and paths Segment Length Handles ROD rectangles, polygons, and paths Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 20 Product Version 5.0 The system automatically names and calculates values for bounding box point handles. Names indicate the position of the handle, as shown for a polygon in the following figure. Figure 1-1 Bounding Box Point Handles for a Polygon You can abbreviate boundingcR box point handle names as follows: Bounding Box Width and Length Handles The system provides floating-point handles named width and length for the width and length of the bounding box for a named object, where width is the horizontal measurement and length is the vertical measurement. upperLeft or uL lowerLeft or lL upperCenter or uC lowerCenter or lC upperRight or uR lowerRight or lR centerLeft or cL centerCenter or cC centerRight or cR X lowerRight upperRight centerRight X X X lowerCenter centerCenter upperCenter X X X lowerLeft upperLeft centerLeft X X Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 21 Product Version 5.0 Note: For a rectangle, the bounding box has the same width and length as its shape. For a polygon, the system calculates values for the width and length handles associated with the bounding box, as shown below. Figure 1-2 Bounding Box Width and Length Handles for a Polygon For a single-part path, the system calculates values for the width and length handles associated with the bounding box, as shown below. length Boundingbox around a ROD object width length width Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 22 Product Version 5.0 Figure 1-3 Bounding Box Width and Length Handles for a Single-Part Path For a multipart path, when the systemcalculates values for the width and length handles, it always uses the width and length of the bounding box around the master path. Figure 1-4 Bounding Box Width and Length Handles for a Multipart Path length width width length Bounding box around master path Subpath Master path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 23 Product Version 5.0 For multipart paths, there is one additional handle: mppBBox. The mppBBox handle contains a list of the lower-left and upper-right coordinates of the bounding box around the whole multipart path. Figure 1-5 Bounding Box mppBBox Handle for the Whole Multipart Path About Segments of Rectangles, Polygons, and Paths For rectangles, polygons, and paths that are ROD objects, the system assigns several point handles to each segment of the object. You can use these segment point handle names to reference points on the boundary of the object. For relative object design, a segment of a rectangle or polygon is defined as an edge, or finite line between two points, partially forming the boundary of the object. For example, a six-sided polygon has six segments (six edges). Subpath Master path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 24 Product Version 5.0 Figure 1-6 Segments of a Polygon For paths, segments include the width of the path and both edges. For example, the following path has four segments. Figure 1-7 Segments of a Path The system assigns a name to each segment of the object, using the prefix segment followed by a number: segmentn, where n begins at zero and is the segment number. For ROD rectangles, segments are always numbered as if they were defined in a clockwise direction, starting in the lower-left corner. segment segment segment segment segment segment segment segment segment segment Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 25 Product Version 5.0 Figure 1-8 Numbering the Segments of a Rectangle For ROD polygons, the system numbers segments in the direction in which the polygon was created, starting with the first point defined. The six-sided polygon below was created in a clockwise direction. Figure 1-9 Numbering the Segments of a Polygon X The starting point is always in the lower-left corner for rectangles. segment 1 segment 3 segment 2 segment 0 segment 2 X segment 5 segment 0 segment 1 segment 3 segment 4 Starting point Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 26 Product Version 5.0 Note: If you create a polygon with the Virtuoso layout editor and then assign a name to it using the rodNameShape function, the systemnumbers segments starting with the first point you defined when you created the polygon. The segments of the path below were created in a clockwise direction. Figure 1-10 Numbering the Segments of a Path Segment Point Handles for Polygons and Rectangles For rectangles and polygons, the system calculates the following point handles: I For each segment, three point handles: one at the beginning, middle, and end of the segment. Their names are: startn, midn, and endn, where n is the segment number. The endn handle for a segment and the startn handle for the next segment share the same point. I For the last segment, the three handles described above, plus three more handles: startLast, midLast, and endLast. The six-sided polygon in the following figure was created starting in the upper-left corner of the highest segment, with the segments defined clockwise. Starting point segment 1 segment 3 X segment 0 segment 2 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 27 Product Version 5.0 Figure 1-11 Segment Point Handles for a Polygon The starting point of the first segment is also the ending point of the sixth segment, so the value of the start0 point handle is the same as the value of the end5 point handle. The system calculates values for three additional point handles for the last segment of the polygon, which in this case is the sixth segment. The illustration shows three system-defined segment point handles—start0, end5, and endLast—for the same point. For rectangles, the systemalways uses the lower-left corner as the starting point and defines segments in a clockwise direction. Figure 1-12 Segment Point Handles for a Rectangle start0, end5, endLast X X end2, start3 end0, start1 X mid1 X end4, start5, startLast X mid0 X mid4 X mid5, midLast X mid2 X X X mid3 end3, start4 end1, start2 X Starting point Segments of a polygon X X X X X X X X start0, end3, endLast end0, start1 end1, start2 end2, start3, startLast mid1 mid3, midLast mid0 mid2 The starting point is always in the lower-left corner for rectangles. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 28 Product Version 5.0 For rectangle, the lower left corner is always its starting point, so when you rotate a rectangle, the handle values change. Segment Point Handles for Paths When naming segment point handles for paths, the system takes into account the direction of the path. The names of handles on the left in relation to the direction of the path contain the word Left, and the names of handles on the right contain the word Right. For example, if the single segment below was a road, and you were driving on it in the direction shown, then the handles on the top edge of the segment are named Left segment handles and handles on the bottomedge of the segment are named Right segment handles. Figure 1-13 Segment Point Handles for a Single-Segment Path The point handle names for a multisegment path are shown below. X X X startRight0 startLeft0 start0 X X X X X X endRight0 endLeft0 end0 midRight0 midLeft0 mid0 You are driving in this direction Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 29 Product Version 5.0 Figure 1-14 Segment Point Handles for a Multisegment Path For paths, the system calculates the values of two additional point handles: startCenter0 and endCenterLast. For paths with the end type flush, the startCenter0 and endCenterLast handles have the same values as the start0 and endLast handles. However, for paths with the layer extending beyond the centerline, which have an end type of variable, offset, or octagon, the startCenter0 and endCenterLast handles have different values than the start0 and endLast handles, as shown in the following figure. start0 end2, endLast startLeft0 midLeft0 X X X X X X X X X X X X X X startRight0 endRight2, endRightLast endLeft2, endLeftLast midRight0 mid0 endRight0, startRight1 endLeft0, startLeft1 end0, start1 X X X midRight2, midRightLast midLeft2, midLeftLast mid2, midLast endRight1, startRight2, startRightLast endLeft1, startLeft2, startLeftLast midLeft1 mid1 X X X midRight1 Direction of path end1, start2, startLast X Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 30 Product Version 5.0 Figure 1-15 Point Handles for Extended-Type Paths For paths with an end type of flush, offset, or variable, segment point handles are on the path boundary or path centerline. However, for paths with the end type octagon, some segment point handles at the path ends and where path segments join are actually outside the path boundary. For example, for the following path, the startLeft0, startRight0, endRight0, startRight1, endLeft1, endLeftLast, endRight1, and endRightLast segment point handles are located outside of the path itself. endLast startLeft0 startCenter0 X X X X X startRight0 endRight2, endRightLast endLeft2, endLeftLast X Direction of path start0 X X endCenterLast Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 31 Product Version 5.0 Figure 1-16 Segment Point Handles for Paths with Octagonal Ends Segment Length Handles The system provides one segment length handle for each segment for objects that have segments. For paths, the systemprovides a length handle for the centerline of each segment, excluding extensions, if any. Note: For multipart paths, the systemdefines handles based on the points of the master path only, with the exception of the mppBBox handle. The system names length handles lengthn, where n is the segment number. The handle for the length of the first segment is length0. The system increases n by 1 for each additional segment, in the direction in which the object was created. (Rectangles are always created in a clockwise direction, starting in the lower-left corner.) The system also provides the handle lengthLast for the last segment. Direction of path startLeft0 startCenter0 X X X startRight0 X endRight0, startRight1 endLeft1, endLeftLast X X endRight1, endRightLast X start0 X endCenter0 end0 X endLeft0, startLeft1 X end0, start1 X Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 32 Product Version 5.0 Figure 1-17 Segment Length Handles for a Rectangle For rectangle, the lower left corner is always its starting point, so when you rotate a rectangle, the handle values change. The six-sided polygon in the following figure was created starting in the upper-left corner of the highest segment, with the segments defined clockwise. Figure 1-18 Segment Length Handles for a Polygon Note: If you create a polygon with the Virtuoso layout editor and then assign a name to it using the rodNameShape function, the systemnumbers segments starting with the first point you defined when you created the polygon. For a path, the system computes values for segment length handles along the path centerline. The names of segment length handles for a four-segment path are shown next. X The starting point is always in the lower-left corner for rectangles. length1 length3, lengthLast length2 length0 length4 length0 Starting point X length2 length1 length5, lengthLast length3 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 33 Product Version 5.0 Figure 1-19 Segment Length Handles for a Multisegment Path Accessing the Path Width The system does not automatically compute the value for the width of a ROD path. (The width handle measures the width of the bounding box around a path.) However, you can access the path width by using the ROD object ID and the ROD attribute for the database ID of the object (dbId) with the database access operator (~>). For a multipart path, for example, the following statement returns the width of the master path: rodId~>dbId~>width Why Are There Multiple Handles for the Same Point? In some cases, the system provides more than one handle for the same point. Although multiple handles for the same point might seem redundant, they provide you with flexibility. For example, if you do not knowthe number of segments an object has, you can refer to points on the last segment by using point handle names containing the word Last. For example, for an eight-sided polygon created in a clockwise direction, with the starting point in the upper-right corner, the segments are numbered segment 0 through segment 7. length0 Direction of path Starting point X length2 length1 length3, lengthLast Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 34 Product Version 5.0 Figure 1-20 Multiple Handle Names for the Same Point User-Defined Handles You can define your own handles to store points, calculations, and other information. When you define a new handle, you specify the name (or let it default) and assign a value. The values of user-defined handles are stored in the database. The information stored can have any of the following data types: point integer Boolean floating-point number string SKILL expression If you let the name of your new handle default, the system assigns a name unique within the cellview, as follows: handle0, handle1, handle2, etc. For example, if a layout cellview contains two ROD objects, and you create one user-defined handle for each object without specifying handle names, the system assigns the name handle0 to the handle on the first object and handle1 to the handle on the second object. If you create a handle without specifying a name, you can find out what the system named the new handle. For a code example showing how to do this, see “Problem 3-6 Querying a System-Assigned Handle Name” on page 178. end6, start7, startLast segment 3 segment 5 start0, end7, endLast Starting point X segment 1 mid6, midLast segment 0 segment 2 segment 6 segment 7 segment 4 X X Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 35 Product Version 5.0 Aligning Objects You can specify the position of one named object in relation to another named object with the rodAlign function. This is called relative alignment. To align two named objects, identify the object you want to align (aligned object) and the object or point you want to align it to (reference object or reference point). Usually, you align objects by specifying a point handle on each object. You can also specify the distance between the two objects in the direction of the X axis, the Y axis, or both. The alignment between two objects is preserved when you manipulate either object and when you save and close the layout cellview. For example, when you move a reference object, the aligned object moves with it. An alignment can involve any named geometry at any level of hierarchy and any design rule that is defined in your technology file. For example, you can align a point handle on object B to a point handle on object A (the reference object) and specify the distance between themas equal to the minimumdesign rule for the layer in your technology file. When you move object A, object B also moves, and vice versa. A B Align B with A Reference object Aligned object X X Point handle on object B is aligned to point handle on object A. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 36 Product Version 5.0 Or you might want to align the centerLeft point handle on the object named D in the instance nTrans2 to the centerRight point handle on the reference object, B in the instance nTrans1. When Are ROD Alignments Recalculated? The system automatically calculates and applies alignments for named objects whenever I A layout cellview is opened in edit mode I Either object involved in an alignment is edited in any way (moved, rotated, stretched, etc.), at any level of the hierarchy I You reload your technology file When you open a cellview in edit mode, the system automatically calculates and applies all alignments assigned to the ROD objects in the cellview. Caution When you open a cellview in read-only mode, the system cannot apply alignments. If the cellview contains aligned ROD objects, you might not be seeing the most current version of the design data. If you want the system to display a message in the command interpreter window (CIW) warning that ROD alignments might not be current, turn on the ROD environment variable readCellviewWarningOn by setting it equal to t. Reference object nTrans1 nTrans2 Aligned object nTrans2/D is aligned to nTrans1/B. C D A B X X Separation Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 37 Product Version 5.0 Separating Aligned ROD Objects You can specify the separation for ROD objects in the direction of the X axis, the Y axis, or both. Usually, one or more design rules determines the value of the separation. You can use a SKILL expression with technology file variables to calculate the separation across one or more levels of hierarchy. The system automatically reevaluates SKILL expressions used in alignment whenever it needs to recalculate the alignment. ROD Objects in Hierarchy When you access a point handle associated with a ROD object with the rodGetHandle function or the ROD object ID and the database access operator (~>), the system automatically transforms (converts) the coordinates of the point up through the hierarchy into the coordinate system of the top-most cellview containing the object. You specify levels of hierarchy in the name of the object. The following example shows a cellview, CCC, containing two levels of hierarchy. The first level contains the instance IB1 of cell BBB; the second level contains two instances of AAA and some zero-level objects that are not shown. The hierarchical name for the shape polyRect in instance IA1 of AAA, where instance IA1 is in the instance IB1 of BBB, is IB1/IA1/polyRect The hierarchical name for the shape polyRect in instance IA2 is IB1/IA2/polyRect For detailed examples showing how to access objects through hierarchy, see “Using rodGetObj” on page 266. polyRect IA1 of AAA polyRect IB1 of BBB Cellview CCC IA2 of AAA Top level of hierarchy Next level of hierarchy Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 38 Product Version 5.0 Querying Objects for Alignments You can query any named object to see what the object is aligned to. When you query a hierarchical object, the system displays all top-level alignments for the object. To see the alignments for an object , you can use the Virtuoso ® layout editor Edit Properties command (click on RODat the top of the form) or type commands in the CIW. For an example showing how to query an object in the CIW, see “Examples of Using ~> to Display Information” on page 119. Stretchable Parameterized Cells When you create a SKILL pcell, you can make its instances “stretchable” by assigning point handles to the parameters of the pcell with the rodAssignHandleToParameter function. This kind of handle is called a stretch handle. A pcell with stretch handles is called a stretchable pcell. Assigning stretch handles to pcell parameters lets you graphically change the value of those parameters for pcell instances after you place them. You do this by selecting one or more handles and using the Stretch command. You are not actually stretching objects within the pcell or stretching the pcell itself. Instead, you are graphically updating the value of the parameters associated with the selected handles. Graphically stretching a pcell instance has the same result as editing its parameters using the Edit Properties form. Note: You cannot undo stretching a pcell instance. For more information about point handles, see “Handles on ROD Objects” on page 18. You specify the direction in which a handle stretches as either X or Y. For example, if you have a pcell containing a single rectangle and want to stretch the width of the rectangle, you could assign the centerRight point handle to the width parameter of the pcell and specify a pcell Stretch handles display as small diamonds. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 39 Product Version 5.0 stretch direction of X. This lets you change the value of the width parameter by stretching the centerRight point handle horizontally. When you assign a handle to a parameter, you can define your own function to calculate the value of the pcell parameter to which you are assigning the handle. The system passes the increment or decrement resulting from stretching the assigned handle(s) to the user-defined function as input and uses the value returned by the function to replace the value of the parameter. The Stretchable Pcell Process The process for stretching pcells is described below. As you do this: I Start the Stretch command and select one or more stretch handles. Note: If you have trouble selecting stretch handles, try turning off the Gravity On option on the Layout Editor Options form. I Click to indicate the new location. The system does the following: I When you first select a stretch handle (or more than one stretch handle) for which there is display information specified, such as a parameter name and value, the systemshows the information next to the upper-right corner of the pcell. I As you move the cursor, the system does the following, in the sequence in which the handle-to-parameter assignments are specified in the pcell code and according to the frequency specified for regenerating the pcell: ❑ When there are no user-defined functions associated with the handles, the system applies the increment or decrement directly to the value of the parameters. pcell width gets larger centerRightpoint handle pcell width gets smaller Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 40 Product Version 5.0 ❑ When there are user-defined functions, the system sends the increment or decrement to the user-defined functions, executes the functions, and replaces the value of the parameters with the values returned by the functions. ❑ Displays an outline of the regenerated pcell and updates the information displayed, if any. The steps of this process repeat until you complete the stretch. For a flowchart of the process, see Figure 1-21 on page 41. For a step-by-step process for using stretchable pcells, see “Stretchling Parameterized Cells” in the Virtuoso Layout Editor User Guide. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 41 Product Version 5.0 Figure 1-21 Flowchart for the Stretchable Pcell Process Assigning Handles To make a pcell stretchable, in your pcell code, you can assign I One point handle to one parameter I Multiple point handles to one parameter I One point handle to multiple parameters I Three point handles at once by specifying an edge Move the cursor Start the Stretch command and select one or more handles System shows drag outline and updates display information System updates parameter values System executes user-defined functions, if any exist End the Stretch command System displays handle information, if any exists Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 42 Product Version 5.0 To assign handles to parameters, use the rodAssignHandleToParameter function. In each rodAssignHandleToParameter statement, you can assign one or more point handles to one parameter and specify one stretch direction (X or Y). To assign a handle to multiple parameters, you must write multiple rodAssignHandleToParameter statements for the pcell. Assigning Multiple Handles to One Parameter You can assign more than one handle to one parameter. For example, if you assign the upperRight, centerRight, and lowerRight point handles to the width parameter of a pcell that contains only a rectangle and specify a stretch direction of X, then you can change the value of the width parameter by stretching any or all of the three point handles horizontally. Assigning One Handle to Multiple Parameters You can assign one handle to two or more parameters. When you stretch the handle, the stretch might affect more than one of the associated parameters. For example, if you want to use one handle to stretch an object in the direction of both the X and Y axes, you assign the same handle to two parameters by writing two rodAssignHandleToParameter statements. In one statement, you assign the handle to the first parameter with a stretch direction of X, and in the other statement, you assign the same handle to a second parameter with a stretch direction of Y. The following example shows a pcell containing only a rectangle. You could assign the upperRight point handle to the width parameter with a stretch direction of X, and assign the upperRight point handle again to the length parameter with a stretch direction of Y. Then you can change the value of the width parameter by stretching the upperRight point handle horizontally as shown in a previous example and change the value of the length parameter by stretching the upperRight point handle vertically. pcell width gets larger pcell width gets smaller Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 43 Product Version 5.0 Assigning the same handle to two different parameters requires two separate rodAssignHandleToParameter statements. You can also change the value of both the width and length parameters by stretching the upperRight point handle at any other angle. Assigning Handles by Specifying Bounding Box Edges You can assign three bounding box point handles for a ROD object to a pcell parameter at once by specifying the name of the bounding box edge. Specifying an edge automatically assigns all three point handles on the edge to the same parameter. For example, for a rectangle that is a pcell, the bounding box edges you can specify are upperEdge, lowerEdge, leftEdge, rightEdge. pcell width length gets smaller pcell width length gets larger upperRight point handle pcell width length upperRight point handle pcell width length Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 44 Product Version 5.0 When you specify upperEdge, you simultaneously specify the three point handles on the bounding box: upperLeft, upperCenter, and upperRight. Specifying Environment Variables for Stretchable Pcells You can set the environment variables listed below to influence what the system does when you stretch a handle: I updatePCellIncrement A floating-point layout editor environment variable specifying how often the system updates pcell parameters and regenerates the pcell during a stretch operation. The default is at every grid snap, as defined by the technology file variable mfgGridResolution. If you want to vary the update frequency for different handle-to-parameter assignments within the same pcell, you can specify the f_updateIncrement argument for the rodAssignHandleToParameter statement for each handle-to-parameter assignment. The value of the f_updateIncrement argument overrides the value of the layout editor environment variable updatePCellIncrement. I displayStretchHandles A Boolean graphic editor and layout editor environment variable specifying whether stretch handles are displayed in layout cellviews. The default is t, which displays stretch handles. I stretchHandlesLayer Astring graphic editor environment variable specifying the layer on which stretch handles are displayed. The default is the y0 layer and drawing purpose. I constraintAssistedMode A Boolean Virtuoso ® XL Layout Editor environment variable that controls the Constraint Assisted Mode. When it is turned on, you might not be able to edit stretchable pcells by stretching their handles. You can turn off Constraint Assisted Mode on the Layout XL Options formor by setting the XL environment variable constraintAssistedMode to nil. upperLeft upperRight pcell upperCenter Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 45 Product Version 5.0 For a description of how to set graphic editor and layout editor environment variables, see “Environment Variable Functions” in the Custom Layout SKILL Functions Reference. For a description of the XL environment variables, see “Setting Environment Variables” in the Virtuoso XL Layout Editor User Guide. Specifying the Frequency of Pcell Regeneration You specify how often the systemupdates pcell parameters and regenerates the pcell during a stretch operation with the f_updateIncrement argument. You can also use the layout editor environment variable updatePCellIncrement to control the frequency of pcell regeneration. The default for both is to update the pcell parameters and regenerate the pcell at every grid snap, as defined by the mfgGridResolution variable in your technology file. Results of Stretching a Handle The results you get from stretching a handle depend on the code written for the pcell, including I Where the stretch handle is located I Whether stretching the handle affects the instance boundary I Whether the origin point of the instance is allowed to move I How the stretch direction and stretch type are specified I The data type of the parameter to which the handle is assigned I Whether the parameter value is computed by a user-defined function I Whether the instance is rotated I The settings of the environment variable that influence stretchable pcells I How often the system regenerates the pcell Results of Specifying the Stretch Type The stretch type determines whether the parameter is increased or decreased in relation to the stretch direction. The stretch type can be either relative or absolute. I For a stretch type of relative, the stretch is in relation to the center of the pcell. I For a stretch type of absolute, the stretch is in relation to the X or Y axis. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 46 Product Version 5.0 The results of a stretch often depend on whether or not the origin point of the pcell instance can move. The origin point is usually the lower-left corner. For handles in some locations, the results of a stretch are the same for both stretch types, whether the origin point can move or not. In the following examples, the pcell contains a single rectangle, so handles on the bounding box of the rectangle are also on the boundary of the instance. There are no user-defined functions. In the example below, the centerRight point handle of a rectangle is assigned to the width parameter of the pcell with the stretch direction X. The width parameter controls the width of the rectangle. For this sample pcell, stretching to the right always increases width no matter what the stretch type is and whether or not the origin point can move, because the handle is located in the middle of the right edge. Conversely, stretching to the left always decreases width for this pcell. However, for handles in most locations, the results of stretching are different for each stretch type and when the instance origin point can move or not move. pcell Origin point X Y 0:0 centerRight stretch handle width pcell X Y 0:0 width pcell X Y 0:0 width Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 47 Product Version 5.0 Note: Defining the origin point of a pcell instance as movable is most useful when the stretch type is relative and the location of the stretch handle coincides with and affects the bounding box of the pcell instance. Results for the Relative Stretch Type For a stretch type of relative, stretching a handle away from the center of its ROD object increments the associated pcell parameter, while stretching towards the center of the ROD object decrements the associated pcell parameter. A stretch away fromthe center makes the object larger and a stretch towards the center makes the object smaller. The results of stretching a handle might vary depending on whether the instance origin point can move during a stretch. In the example below, the centerLeft point handle on the rectangle is assigned to the width parameter of the instance, with a stretch direction of X. The pcell contains only the rectangle. When you stretch the centerLeft handle to the left (away from the center of the pcell), the width parameter is incremented, so the width of the rectangle and instance gets larger. pcell Origin point X Y 0:0 centerLeft stretch handle width pcell Relative stretch away from center and origin point can move X Y 0:0 pcell Relative stretch away from center and origin point cannot move X Y 0:0 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 48 Product Version 5.0 In both cases, the width of the rectangle and instance gets larger. However, if the instance origin point cannot move, the width of the rectangle and instance expands to the right. For a relative stretch, when you stretch the centerLeft handle to the right (towards from the center of the pcell), the width parameter is decremented, so the width of the rectangle and instance gets smaller. In both cases, the width of the rectangle and instance gets smaller. However, if the instance origin point cannot move, the width of the rectangle and instance shrinks from the right. Results for the Absolute Stretch Type For a stretch type of absolute, stretching in a positive direction in relation to the X or Y axis increments the associated pcell parameter, while stretching in a negative direction decrements the associated pcell parameter. The results of stretching a handle might vary depending on whether the origin point can move during a stretch. In the example below, the lowerCenter point handle is assigned to the Relative stretch towards center and origin point can move pcell X Y 0:0 Relative stretch towards center and origin point cannot move pcell X Y 0:0 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 49 Product Version 5.0 length parameter of a rectangle that comprises a pcell. The stretch direction is specified as Y. For an absolute stretch, when the stretch handle is on the bottomof the object and you stretch upward (in a positive direction along the Y axis), the length parameter is incremented, so the object gets larger. How the rectangle expands depends on whether the origin point can move. When the origin can move, the edge on which the handle is located can move also, which allows the handle to move during the stretch. An absolute stretch of the lowerCenter point handle upward along the Y axis increases the length parameter, making the rectangle and instance larger by moving the edge on which the handle is located. When the origin cannot move, the edge on which the handle is located cannot move either, which prevents the handle from moving during the stretch. An absolute stretch of the lowerCenter point handle upward along the Y axis increases the length parameter, pcell Origin point X Y 0:0 length lowerCenter stretch handle pcell Absolute positive stretch and origin point can move X Y 0:0 length pcell Absolute positive stretch and origin point cannot move X Y 0:0 length Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 50 Product Version 5.0 making the rectangle and instance larger by moving the edge opposite from where the handle is located. For an absolute stretch, when the handle is on the bottom of the object and you stretch downward (in a negative direction along the Y axis), the length parameter is decremented, so the object gets smaller. Howthe rectangle shrinks depends on whether the origin point can move. In both cases, the length of the rectangle and instance get smaller. When the origin can move, an absolute stretch of the lowerCenter point handle downward along the Y axis decrements the length parameter by moving the lower edge of the rectangle. However, when the origin cannot move, an absolute stretch decrements the length parameter by moving the edge opposite from where the handle is located. Results of Stretching Multiple Handles When you select more two or more handles to stretch at the same time, the systemprocesses each handle in the sequence in which the handle-to-parameter assignments appear in the pcell code. The results depend partly on how the handles affect pcell parameters. I When the selected handles are assigned to the same parameter and affect that parameter in the same way, the system applies only the change to the parameter from the handle that appears first in the handle-to-parameter assignments in the pcell code; the system ignores the results of stretching the other handles. I When the selected handles are assigned to the same parameter but affect the same parameter in different ways, the system applies the change from each handle to that same parameter, cumulatively. pcell Absolute negative stretch and origin point can move X Y 0:0 length pcell Absolute negative stretch and origin point cannot move X Y 0:0 length Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 51 Product Version 5.0 I When the selected handles affect different parameters, the system applies the change from each handle to each parameter individually. In the following example, the pcell contains a single rectangle. There are no user-defined functions for the handles. The three point handles, upperRight, centerRight, and lowerRight, are all assigned to the width parameter of the pcell with the stretch direction of X. The width parameter controls the width of the rectangle. pcell X Y 0:0 width Pcell contains one rectangle. pcell X Y 0:0 Stretch handles upperRight, centerRight, and lowerRight width Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 52 Product Version 5.0 When you stretch by +3 along the X axis, all three point handles affect the width parameter in the same way, so stretching all three handles gets the same result as stretching only one or two of the handles. Stretching Multiple Handles on the Same Point When there are multiple stretch handles on the same point, and you select that point (or one of the handles on it), all stretch handles on the point are selected. Results of Dragging a Handle During a Stretch As you move the cursor during a stretch operation, the system displays an outline of the instance and shows how it is changing. If you want to see an outline of each individual object in the pcell and the pcell boundary, you can turn on the Drag Enable property for the object layers. You can set this property by choosing the Technology File – Edit Layers command in the Command Interpreter Window. For instructions on how to set the Drag Enable property, see “Cannot See Objects Inside Pcell During Stretch” in the Virtuoso Layout Editor User Guide. Replace CDFs with User-Defined Functions In this release,stretching a pcell does not execute CDFs associated with the pcell parameters. For now, you should use user-defined functions to perform tasks formerly performed by CDFs. For more information about user-defined functions, see “User-Defined Functions” on page 165 and the Sl_userFunction argument description for the rodAssignHandleToParameter function. pcell X Y 0:0 width Change is +3 in X. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 53 Product Version 5.0 Example of Stretching a Sample MOS Transistor The following pcell contains a MOS transistor with two contact arrays. You can stretch the MOS transistor in a negative direction towards the Y axis to reduce the number of contacts in the array from two to one, using the Virtuoso layout editor Stretch command. 1. Choose Edit – Stretch. 2. Select the upperCenter stretch handle on the left contact array using an area-selection box. Note: If you have trouble selecting the stretch handle, try turning off the Gravity On option on the Layout Editor Options form. 3. To enter the reference point, click on the upperCenter stretch handle on the left contact array. The following information appears to the right of the pcell: leftcov = 1 As you move the cursor down, the information changes to leftcov = 0.25 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 54 Product Version 5.0 4. To enter the new location, click above the bottom transistor. 5. Exit the Stretch command by pressing Escape. The MOS transistor pcell instance now looks like this: For a detailed description of howto stretch pcells, see “Stretching Parameterized Cells” in the Virtuoso Layout Editor User Guide. Displaying Pcell Stretch Handles You can control whether pcell stretch handles display either with the layout editor Display Options form or by setting the graphic editor and layout editor environment variable displayStretchHandles in the CIW. The default is to display stretch handles. For Click here. leftcov = 0.25 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 55 Product Version 5.0 information about how to do this, see “Pcell Stretch Handles Are Not Visible” in the Virtuoso Layout Editor User Guide. To specify the layer on which stretch handles are displayed, set the graphic editor environment variable stretchHandlesLayer. Multipart Rectangles A multipart rectangle (MPR) is a single object composed of multiple parts on the same or on different layers. The parts consist of one or more named master rectangles and one or more arrays of unnamed subrectangles. Each named master rectangle is a separate object with ROD attributes, created at level zero in the hierarchy. Each unnamed subrectangle is an ordinary database shape with no ROD attributes, created at level zero in the hierarchy. You create MPRs with the rodCreateRect function. For example, you might create a single master rectangle with a two-dimensional array containing four subrectangles, a single master rectangle overlapped by rows and columns of subrectangles (a two- dimensional array), One master rectangle Four subrectangles Master rectangle Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 56 Product Version 5.0 one master rectangle with two one-dimensional arrays containing five subrectangles each, or six master rectangles and a two-dimensional array containing four subrectangles. The array of subrectangles repeats for each master rectangle (you define the array once). Connectivity for Multipart Rectangles You can create connectivity for all master rectangles and/or for any array of subrectangles by associating them with a specific terminal and net. You can also make all master rectangles into pins and/or all subrectangles of any array into pins. One master rectangle First array of subrectangles Second array of subrectangles Master rectangles Master rectangles Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 57 Product Version 5.0 System-Defined Handles for Multipart Paths For multipart rectangles, the system defines handles based on the points of the master rectangles only. Subrectangles are ordinary database shapes with no ROD attributes. The handles for master rectangles are the same as for any ROD rectangle. For more information, see “System-Defined Handles” on page 19. Multipart Rectangles as ROD Objects When you create multipart rectangles, the system creates a rectangle and ROD object information for each master rectangle, including its name and database ID. The ROD object is identified by a ROD object ID. The database IDs for a multipart rectangle identify the master rectangles. Subrectangles are regular, unnamed database shapes without any ROD attributes. For a detailed description of ROD objects and ROD object IDs, see “About ROD Objects and ROD Object IDs” on page 113. Creating a Multipart Rectangle from Other Objects You can create a new master rectangle without specifying points by using one or more of the following as source objects: an instance or any ROD object. For a detailed overviewabout creating objects fromother objects, see “Creating Objects from Objects” on page 90. Editing Multipart Rectangles For a summary of how the Virtuoso ® layout editor commands work with ROD objects, see Appendix E, “How Virtuoso Layout Editor Works with ROD Objects”. Using commands that are not fully supported for ROD objects could cause the objects to lose the ROD information associated with them, changing the objects into ordinary, unnamed shapes. When you select any part of a master rectangle or its associated subrectangles, the whole master rectangle and all associated subrectangles are selected. The master rectangle is highlighted on the current selection layer, while the arrays of subrectangles are highlighted on different layers to let you see which part is the master and which parts are arrays of subrectangles. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 58 Product Version 5.0 When you modify a multipart rectangle with the layout editor, changes to a master rectangle also affect all of its associated subrectangles; you cannot edit or copy an array of subrectangles or individual subrectangles. Stretching Multipart Rectangles You can stretch the edges and/or corners of a master rectangle of a multipart rectangle in the same way you stretch regular rectangles, by clicking on an edge or vertex, then clicking in a new location. The system regenerates the arrays of subrectangles associated with the stretched master rectangle, changing the number of subrectangles in each array; the shape of the subrectangles does not change. You cannot stretch a master rectangle separately from its subrectangles, nor can you stretch subrectangles separately from their master rectangle. The way that subrectangles regenerate depends on how the multipart rectangle was defined with the rodCreateRect function. For information about defining multipart rectangles, see rodCreateRect on page 213. For more information about stretching multipart rectangles, see “Stretching Multipart Rectangles” in the Virtuoso Layout Editor User Guide. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 59 Product Version 5.0 Multipart Paths A multipart path (MPP) is a single ROD object consisting of one or more parts at level zero in the hierarchy on the same or on different layers. You can create one-part paths, simple multipart paths, or complex multipart paths such as guard rings, transistors, buses, and shielded paths. You can create MPPs in the three different ways listed below. This section provides an overview of multipart path concepts for all three methods of creating MPPs. I With the graphical user interface For information about using the graphical user interface, see “Creating and Editing Multipart Paths” in the Virtuoso Layout Editor User Guide. I With the function rodCreatePath on page 179 I By editing the ASCII version of your technology file For information about editing your technology file, see “lxMPPTemplates” in the Technology File and Display Resource File ASCII Syntax Reference Manual. You create a ROD path by specifying a point list for the master path or by specifying one or more named objects as a source for the points of the master path. A multipart path consists of a single master path and one or more subparts. The master path is an ordinary path; however, it is the defining part of a multipart path; all subparts are based on the master path. The subparts can be any combination of offset subpaths, enclosure subpaths, and sets of subrectangles. Types of Subparts I An offset subpath is a path that is coincident with an edge of the master path, overlapping the master path, or separated from the master path. I An enclosure subpath is a path with its centerline on the centerline of the master path and is usually narrower or wider than the master path. The system calculates its width using the width of the master path and a positive or negative enclosure value. I A set of subrectangles consists of one or more subrectangles that are coincident with an edge of the master path, overlapping the master path, or separated from the master path You can create any number of subparts. All subparts exist in relation to and depend on the master path. A subrectangle in a set of subrectangles is not an individual shape; it is part of that specific set of subrectangles. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 60 Product Version 5.0 For example, the multipart path shown below has one subpath and one set of subrectangles. Both the subpath and the set of subrectangles are offset from the master path. Master Paths You create the master path for a multipart path by specifying a list of points (point list). To control where the master path appears in relation to the point list, you can specify justification and an offset. I Offset specifies the distance between the master path and the points in the point list. I Justification specifies whether to offset the centerline, left edge, or right edge of the master path from the point list. ❑ left offsets the left edge of the master path from the point list. ❑ right offsets the right edge of the master path from the point list. ❑ center offsets the centerline of the master path from the point list. Both offset and justification are relative to the direction of the master path. The direction of the master path is determined by the sequence in which you specify its points. Master path One subpath One set of subrectangles Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 61 Product Version 5.0 Position of Master Path in Cellview The location of the master path in a layout cellviewwindowin relation to the points in the point list depends on whether the offset value is positive or negative and on the direction of each segment in the point list, as shown in Table 1-2 on page 61. Examples of Offsetting the Master Path The following examples show offset master paths. Master Path with Positive Offset, Left Justification When the offset is positive with left justification, the left edge of the master path is offset from the point list, creating a master path on the left side of the point list. Table 1-2 Position of Master Path in Relation to Point List Direction of Point List Segment Positive Offset Negative Offset Positive along X axis Above Below Negative along X axis Below Above Positive along Y axis Left Right Negative along Y axis Right Left X Y 0:0 point list (l_pts) Left edge of master path is offset from point list. Direction of master path Positive offset (n_offset) Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 62 Product Version 5.0 Master Path with Positive Offset, Right Justification When the offset is positive with right justification, the right edge of the master path is offset from the point list, creating a master path on the left side of the point list. Master Path with Positive Offset and Center Justification When the offset is positive with center justification, the centerline of the master path is offset to the left of the point list, in relation to the direction of the point list. X Y 0:0 point list (l_pts) Positive offset (n_offset) Direction of master path Right edge of master path is offset from point list. X Y 0:0 point list (l_pts) Direction of master path Positive offset (n_offset) Centerline of master path is offset from point list. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 63 Product Version 5.0 When you specify a negative value for offset, the system offsets the master path to the right of the point list, using the left edge, right edge, or centerline of the master path, as specified by the justification. Master Path with Negative Offset and Center Justification When the offset is negative with center justification, the centerline of the master path is offset to the right of the point list, in relation to the direction of the point list. Offset Subpaths You can create an offset subpath that is coincident with an edge of the master path, on the left or right side of the master path, or overlapping the master path. You can specify the width of an offset subpath or let it default to the minWidth rule for the subpath layer from the technology file. Offset subpaths inherit the same type of end as specified for the master path. You determine where to create an offset subpath in relation to the master path by specifying the separation and justification. Both separation and justification are relative to the direction of the master path. The direction of the master path is determined by the sequence in which you specify its points. I Separation specifies the distance between the offset subpath and the master path. X Y 0:0 point list (l_pts) Direction of master path Negative offset (n_offset) Centerline of master path is offset from point list. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 64 Product Version 5.0 I Justification specifies whether to separate edges or centerlines as follows: ❑ left separates the right edge of the subpath from the left edge of the master path. ❑ right separates the left edge of the subpath fromthe right edge of the master path. ❑ center separates the centerline of the subpath from the centerline of the master path. center justification for subpaths follows the same rules as center justification for offset master paths. Specifying Separation and Justification The location of an offset subpath in relation to the master path depends on the values of separation and justification, in relation to the direction of the master path. To create a subpath I With its centerline on the master path centerline, specify center justification with zero separation I Coincident with the left or right edge of the master path, specify left or right justification, respectively, and let separation default to zero I With its centerline separated from the master path centerline, specify center justification with a positive or negative separation I To the left or right of the master path, specify left or right justification, respectively, with a positive separation I Overlapping the left or right edge of the master path, specify left or right justification, respectively, with a small negative separation For a summary of how to specify separation and justification for offset subpaths, see Table 1-3 on page 64. Table 1-3 Position of Offset Subpath in Relation to Master Path Separation Center Justification Left Justification Right Justification Zero Subpath centerline on master path centerline Left edge of master path coincident with right edge of subpath Right edge of master path coincident with left edge of subpath Positive number Subpath centerline on left side of master path centerline Left edge of master path on right side of right edge of subpath Right edge of master path on left side of left edge of subpath Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 65 Product Version 5.0 Examples of Offset Subpaths The following examples show offset subpaths in relation to a master path. Negative number Subpath centerline on right side master path centerline Left edge of master path on left side of right edge of subpath Right edge of master path on right side of left edge of subpath Table 1-3 Position of Offset Subpath in Relation to Master Path, continued Separation Center Justification Left Justification Right Justification Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 66 Product Version 5.0 Zero Separation for Offset Subpaths When the separation value is zero (0), the offset subpath centerline is on the master path centerline, or the subpath is coincident with an edge of the master path, depending on the justification, as shown below: Positive Separation for Offset Subpaths When the separation value is positive, the offset subpath is on the left or right side of the master path, depending on the justification. For example, both Subpath A and Subpath B have positive separations. I Subpath A has left justification, so the left edge the master path is separated from the right edge of Subpath A. X Y 0:0 Subpath Master path Left justification Direction of master path X Y 0:0 Center justification Subpath Master path Direction of master path X Y 0:0 Subpath Master path Right justification Direction of master path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 67 Product Version 5.0 I Subpath B has right justification, so the right edge of the master path is separated from the left edge of Subpath B. Left justification Right justification Master path X Y 0:0 Direction of master path Subpath A Subpath B + + Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 68 Product Version 5.0 The following example shows a small, positive separation value with center justification, creating a subpath that overlaps the left edge of the master path. The subpath centerline is offset from the master path centerline. Negative Separation for Offset Subpaths When the separation value is negative, the offset subpath either overlaps the master path or is created on the side of the master path opposite the side specified by justification, relative to the direction of the master path. + Subpath Master path Subpath has a small positive separation with center justification. X Y 0:0 Direction of master path Positive separation from centerline to centerline. Center justification Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 69 Product Version 5.0 The examples below show both small and large negative separation values with left justification. The left edge of the master path is separated from the right edge of the offset subpath. Subpath Master path Direction of master paths X Y 0:0 Small negative separation from left edge of master path. Left justification Offset subpaths have a negative separation with left justification. Master path X Y 0:0 Subpath Large negative separation from left edge of master path. Left justification Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 70 Product Version 5.0 The examples below show both small and large negative separation values with right justification. The right edge of the master path is separated from the left edge of the offset subpath. Subpath Master path X Y 0:0 Small negative separation from right edge of master path. Right justification Direction of master paths Offset subpaths have a negative separation with right justification. Master path X Y 0:0 Large negative separation from right edge of master path. Right justification Subpath Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 71 Product Version 5.0 The following example shows a small, negative separation with center justification, creating an offset subpath overlapping the right side of the master path. The subpath centerline is offset from the master path centerline. Enclosure Subpaths You create an enclosure subpath with its centerline on the centerline of the master path and its width calculated using the width of the master path plus a positive or negative enclosure value. The enclosure determines by how much the subpath is enclosed by the master path or by how much the master path is enclosed by the subpath. You can specify the enclosure for the subpath or let it default to the minEnclosure rule from the technology file for the master path layer to the subpath layer. minEnclosure defines the minimum enclosure for the master path layer in relation to the subpath layer. Enclosure subpaths inherit the same type of ends as specified for the master path. To define enclosure for the ends of the subpath, you can specify offsets or let the system default to the value of the n_enclosure argument. Subpath Master path Subpath has a small negative separation with center justification. X Y 0:0 Direction of master path Negative separation from centerline to centerline. Center justification Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 72 Product Version 5.0 Examples of Enclosure Subpaths To calculate the width of an enclosure subpath, the system subtracts two times the enclosure value from the width of the master path: Width of Enclosure Subpath = Width of Master Path - (2 * Enclosure Value) Therefore, a positive enclosure value creates a subpath that is narrower than the master path, and a negative enclosure value creates a subpath that is wider than the master path. The centerlines are always coincident. The following examples show enclosure subpaths with positive and negative enclosure values. The following example shows a master path with a width of 1.0 and an enclosure subpath with the enclosure value of a positive 0.2. Both ends of the subpath are offset by a negative 0.4. Subpath width from negative enclosure value Master path Subpath X Y 0:0 Subpath Subpath width from positive enclosure value Master path X Y 0:0 Positive enclosure value Negative enclosure value Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 73 Product Version 5.0 Therefore, the master path encloses the subpath by 0.2 on each side, making the width of subpath 0.6. The end of the master path encloses the subpath by a negative 0.4. Sets of Subrectangles You can create a set of subrectangles in relation to the centerline of any master path. The set can contain one or more subrectangles. You can specify the width and length of the subrectangles or let themdefault to the minWidth rule for the subrectangle layer from the technology file. You can offset the centerline of the subrectangles from the master path centerline, and you can offset the edge of the first and last subrectangles from the ends of the master path. The system places subrectangles on grid. You can create connectivity for a set of subrectangles. When you specify that a set of subrectangles is a pin, each rectangle in the set becomes a pin. In the layout editor, a set of subrectangles is treated as a single shape. Although a set of subrectangles is treated as a single shape, you can get a list of the database IDs for the individual subrectangles in the set by using the ROD object ID for the multipart path with the database access operator (~>) and the attribute name subShapes. For more information, see “Accessing ROD Object Attributes” on page 118. Width of master path = 1.0 Width of subpath = 0.6 Enclosure = +0.2 Master path Enclosure subpath End offset = -0.4 0.2 0.2 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 74 Product Version 5.0 Note: The system creates subrectangles only for orthogonal path segments (segments parallel or perpendicular to an axis). The systemdoes not create or regenerate subrectangles in nonorthogonal segments. Specifying Separation and Justification The location of a set of subrectangles in relation to the master path depends on the values of separation and justification, in relation to the direction of the master path, just as it does for offset subpaths. The system places subrectangles on grid, as close to the specified separation as possible. To create a set of subrectangles I With the center of the width of the subrectangles on the master path centerline, specify center justification with zero separation I Coincident with the left or right edge of the master path, specify left or right justification, respectively, and let separation default to zero I With the center of the width of the subrectangles separated from the master path centerline, specify center justification with a positive or negative separation I To the left or right of the master path, specify left or right justification, respectively, with a positive separation I Overlapping the left or right edge of the master path, specify left or right justification, respectively, with a negative separation For a summary of how to specify separation and justification for sets of subrectangles, see Table 1-4 on page 74. Table 1-4 Position of Subrectangles in Relation to Master Path Separation Center Justification Left Justification Right Justification Zero Center of width of subrectangles on master path centerline Left edge of master path coincident with right edge of subrectangles Right edge of master path coincident with left edge of subrectangles Positive number Center of width of subrectangles on left side of master path centerline Left edge of master path on right side of right edge of subrectangles Right edge of master path on left side of left edge of subrectangles Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 75 Product Version 5.0 When you specify connectivity for a set of subrectangles, the connectivity applies to all rectangles in the set. Similarly, when you specify that a set of subrectangles is a pin, all rectangles in the set become pins. For a detailed description of how the system creates subrectangles, see “How the System Creates Subrectangles” on page 202. Examples of Sets of Subrectangles The following examples show sets of subrectangles in relation to a master path. Negative number Center of width of subrectangles on right side of master path centerline Left edge of master path on left side of right edge of subrectangles Right edge of master path on right side of left edge of subrectangles Table 1-4 Position of Subrectangles in Relation to Master Path Separation Center Justification Left Justification Right Justification Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 76 Product Version 5.0 Zero Separation for a Set of Subrectangles When the separation value is zero (0), the centerline of the subrectangles is on the master path centerline or the subrectangles are coincident with an edge of the master path, depending on the justification, as shown below: Positive Separation for a Set of Subrectangles When the separation value is positive, the subrectangles overlap the master path or are on the left or right side of the master path, depending on the size of the separation value and on the justification. For example, both Subrectangles A and Subrectangles B have positive separations. X Y 0:0 Sub- rectangles Left justification Master path X Y 0:0 Right justification Sub- rectangles Master path Master path X Y 0:0 Center justification Subrectangles Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 77 Product Version 5.0 I Subrectangles A has left justification, so the left edge of the master path is separated from the right edge of Subrectangles A. I Subrectangles B has right justification, so the right edge of the master path is separated from the left edge of Subrectangles B. Left justification Right justification X Y 0:0 Direction of master path Subrectangles A + Subrectangles B + Master path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 78 Product Version 5.0 The following example shows subrectangles that overlap the left edge of the master path, created with a small, positive separation value and center justification. The subpath centerline is on the left side of the master path centerline. Negative Separation for a Set of Subrectangles When the separation value is negative, the set of subrectangles either overlaps the master path or is created on the side of the master path opposite the side specified by justification, relative to the direction of the master path. Subrectangles Master path Subrectangles have a small positive separation with center justification. X Y 0:0 + Positive separation from centerline to centerline. Direction of master path Center justification Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 79 Product Version 5.0 The examples below show both small and large negative separation values with left justification. The left edge of the master path is separated from the right edge of the set of subrectangles. Sub- rectangles Master path Direction of paths Small negative separation from left edge of master path. X Y 0:0 Subrectangles have a negative separation with left justification. Master path Large negative separation from left edge of master path. X Y 0:0 Subrectangles Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 80 Product Version 5.0 The following example shows subrectangles that overlap the right edge of the master path, created with a small, negative separation and center justification. The master path centerline is separated from the subrectangle centerline. Ends of Paths and Subrectangles You can specify extensions for each end of a master path to make the end extend beyond the start and/or end point of the master path centerline. To specify end extensions for a master Subrectangles Master path Subrectangles have a small negative separation with center justification. X Y 0:0 Negative separation from centerline to centerline. Direction of master path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 81 Product Version 5.0 path, use the n_beginExt and n_endExt arguments, with the master path S_endType argument set to variable. All subparts inherit the end extensions of the master path. Offsetting the Ends of Subpaths and Subrectangles You can create a subpath or set of subrectangles that is longer or shorter than the master path. You do this by specifying the n_beginOffset and n_endOffset arguments to offset the ends of the subpath or subrectangle from the ends of the master path. With or without an offset, subpaths and subrectangles are generated starting at the first edge of the master path. If you do not specify offsets, the system creates the ends as follows: I For offset subpaths and sets of subrectangles, the end offsets default to zero, so their ends are coincident with the ends of the master path. I For enclosure subpaths ❑ If you specify only n_beginOffset, n_endOffset defaults to n_beginOffset; if you specify only n_endOffset, n_beginOffset defaults to n_endOffset. ❑ If you do not specify an offset but do specify an enclosure, the offsets default to the negative of the enclosure. ❑ If you specify neither an offset nor an enclosure, the system subtracts the value of the minEnclosure rule (from the technology file for master path layer to subpath layer) from the ends of the master path to calculate the offset for the ends of the Ending end extension n_endExt Starting end extension n_beginExt Direction of master path Start point of centerline X X End point of centerline Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 82 Product Version 5.0 enclosure subpath. If the minEnclosure rule is not defined in the technology file, the system reports an error. Examples of Ends of Subpaths and Subrectangles When offsets of the ends are positive, the subpath extends beyond the master path. When negative, the master path extends beyond the subpath. In the following examples of sets of subrectangles, the rectangles are 1 unit wide and 2 units long, spaced 1 unit apart. Subpath Subpath Negative offset values X Y 0:0 Ends of subpath extend beyond master path. Positive offset values Master path X Y 0:0 Ends of master path extend beyond ends of subpath. Master path n_width argument = 1 n_length argument = 2 n_space argument = 1, so rectangles are 1 unit apart. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 83 Product Version 5.0 Positive Offsets for Ends of Subrectangles This example shows small positive offsets for the ends of a set of subrectangles. This example shows larger positive offsets for the ends of a set of subrectangles. Positive offset values X Y 0:0 Set of subrectangles extends 1 unit past master path end. Master path Direction of master path n_beginOffset = +1 n_endOffset = +1 Positive offset values X Y 0:0 Set of subrectangles extends 4 units past master path end. Direction of master path Master path n_beginOffset = +4 n_endOffset = +4 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 84 Product Version 5.0 The following example shows positive offset values for the ends of a set of rectangles when the master path has extended ends. Negative Offsets for Ends of Subrectangles This example shows negative offsets for the ends of a set of subrectangles. Positive offset values X Y 0:0 n_endOffset = +4, so set of subrectangles extends 4 units past master path ends. Direction of master path Master path n_beginOffset = +4 X Y 0:0 Direction of master path There is not enough space for another rectangle with -1 end offset. Negative offset values n_beginOffset = -1 n_endOffset = -1 Master path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 85 Product Version 5.0 Making Paths Choppable You can define one or more parts of a multipart path as choppable. When you define the master path as choppable, then all of its subpaths and subrectangles must be choppable also. When you define the master path is not choppable, you can define each subpath or set of subrectangles as choppable or not choppable. When an object is choppable, you can use the Virtuoso layout editor Chop command or the rodAddMPPChopHole function to separate it into two or more paths; the results are the same with either method. For an overview of how chopping affects multipart paths, see “Chopping Multipart Paths” on page 86. Connectivity for Multipart Paths You can create connectivity for any or all parts in a multipart path by associating them with a specific terminal and net. You can also make one or more parts into pins. When you specify that a master path or a subpath is a pin, the whole path becomes a pin. When you specify that a set of subrectangles is a pin, each rectangle in that set of subrectangles becomes a pin. System-Defined Handles for Multipart Paths The system defines handles for multipart paths based on the points of the master path only. For more information, see “System-Defined Handles” on page 19. Multipart Paths as ROD Objects When you create a multipart path, the system creates both a path and a ROD object containing information associated with the path, including its name and database ID. The ROD object is identified by a ROD object ID. The database ID for a multipart path identifies the master path. For a detailed description of ROD objects and ROD object IDs, see “About ROD Objects and ROD Object IDs” on page 113. Creating a Path from Other Objects You can create a new path from one or more of the following: an instance or any ROD object without specifying the points for the path. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 86 Product Version 5.0 For a detailed overviewabout creating objects fromother objects, see “Creating Objects from Objects” on page 90. Editing Multipart Paths For a summary of how the Virtuoso ® layout editor commands work with ROD objects, see Appendix E, “How Virtuoso Layout Editor Works with ROD Objects”. Using commands that are not fully supported for ROD objects could cause the objects to lose the ROD information associated with them, changing the objects into ordinary, unnamed shapes. When you select any part of a multipart path in a layout cellview window, all shapes in the multipart path are selected and highlighted. When you modify a multipart path with the Virtuoso layout editor, changes to the master path also affect all of its subparts; you cannot edit or copy an individual subpart. For example: I Chopping a multipart path affects all choppable parts of the multipart path. I Stretching a segment of a multipart path stretches the segment subpaths and, for orthogonal segments, regenerates subrectangles. The number of subrectangles in a subpath changes; the shape of the subrectangles does not change. When you edit a multipart path that has subrectangles, the system regenerates all subrectangles that occur in orthogonal segments (segments parallel or perpendicular to an axis). The system does not generate or regenerate subrectangles in nonorthogonal segments. Chopping Multipart Paths You can define one or more parts of a multipart path as choppable. I When you define the master path as choppable, then all of its subpaths and subrectangles must be choppable also. I When you define the master path is not choppable, you can define each subpath or set of subrectangles as choppable or not choppable. I If the master path is choppable, you can chop the whole multipart path into two or more separate multipart paths by chopping all the way through the master path at 90 degrees. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 87 Product Version 5.0 I If the master path is not choppable, you can chop all subparts that are specified as choppable by chopping all the way through the master path at 90 degrees. All choppable subparts are chopped where you chop over the master path. When you chop a choppable master path, the system assigns the name of the original multipart path to the first new multipart path, where “first” is relative to the direction of the master path. The system assigns unique names to the other new multipart paths, starting with path0, path1, and so on, as shown below. Note: If you want to chop and rotate an MPP, rotate the MPP first, then chop it. Avoid rotating a chopped MPP as the chop holes might not rotate correctly. Master path is choppable; therefore all subparts are choppable. Master path is not choppable, but subparts are choppable. Chop hole points X X Chop hole points X X One master path Two master paths First multipart path pathA Before adding chop hole After adding chop hole pathA path0 Direction of master path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 88 Product Version 5.0 Chopping Multipart Paths That Have Alignments When you chop through the (choppable) master path of a multipart path, alignments to other objects are lost. The following example shows what happens to an aligned object after cutting away a section of a choppable master path named pathA. When you use the cutter to chop out part of the master path like this, Direction of master path X X Rectangle rect1 is aligned to choppable master path. rect1 Choppable master path, pathA Cutter X X rect1 Direction of master path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 89 Product Version 5.0 the result is two new, shorter multipart paths, neither of which are aligned to rect1. The system keeps the name pathA with the first new multipart path and assigns a unique name in the format of pathn to the second new multipart path. For more information about howthe layout editor Chop command affects multipart paths, see “How Chopping Affects Multipart Paths” in the Virtuoso Layout Editor User Guide. Stretching Multipart Paths You can stretch the ends, segments, and/or corners of a multipart path in the same way you stretch single-part paths; however, the master path and its subparts stretch together. You cannot stretch the master path separately from its subparts, nor can you stretch subparts separately from the master path. First new multipart path is named pathA. rect1 rect1 did not move. It is no longer aligned to a multipart path. Second new multipart path. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 90 Product Version 5.0 In the example below, when you stretch the bottom segment downward, all parts of the multipart path stretch together. The system regenerates subrectangles to fill the orthogonal segments affected by the stretch. You can select and stretch the chopped ends of subpaths. When the multipart path contains sets of subrectangles, the system regenerates subrectangles along orthogonal segments only. For more information about stretching multipart paths, see “Stretching Multipart Paths” in the Virtuoso Layout Editor User Guide. For a descriptoin of how some of the layout editor commands affect a multipart path, see the Virtuoso Layout Editor User Guide. Creating Objects from Objects Using the rodCreateRect, rodCreatePolygon, or rodCreatePath function, you can create a new rectangle, polygon, or path from an instance or ROD object or from multiple objects. The existing objects are referred to as source objects, and the newobject is referred to as the generated object. When the source is a single object, you specify the difference between the size of the source object and the size of the generated object. For example, froma source rectangle, the system Before stretching After stretching Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 91 Product Version 5.0 uses a positive size to generate an new, larger rectangle, and a negative size to generate a new, smaller rectangle. When the source is more than one object, you specify the difference between a bounding box around all of the objects and the size of the generated object. If you specify a negative size that is too small for generating a new object, the systemreports an error. For example, when the source object is a path and you specify a negative size, its absolute value cannot be equal to or greater than half of the width of the source path. If the source path has a width of 4, you cannot generate a new path by specifying a size of -2. Applying -2 to the perimeter of the source path would produce a path with a width that is less than or equal to zero. Note: In the current release, no relationship exists between a generated object and its source object(s) after the generated object is created. Creating a Rectangle from Another Object You can create a new rectangle from one or more ROD objects. The system computes the point list for the new rectangle by applying the size you specify to the bounding box around the source object(s). When the source object is also a rectangle, its bounding box is the same as its shape. The following sections show examples of creating rectangles from a variety of shapes. Source rectangle Generated rectangle Size is positive Source rectangle Size is negative Generated rectangle Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 92 Product Version 5.0 Creating a Rectangle from a Rectangle When the source object is a rectangle, and you specify the size as +3, the system generates a new, larger rectangle. When you specify the size as -3, the system generates a new, smaller rectangle. Source ROD rectangle X Y 0:0 Source Generated ROD rectangle X Y 0:0 Source Size is +3 Size = +3 X Y 0:0 Source Size is -3 Generated ROD rectangle Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 93 Product Version 5.0 Creating a Rectangle from a Polygon When the source object is a polygon, and you specify the size as +3, the systemcomputes a bounding box around the polygon and generates a new rectangle that is larger than the bounding box. When you specify the size as -3, the system generates a new rectangle that is smaller than the bounding box. Source ROD polygon X Y 0:0 Generated ROD rectangle Size is +3 X Y 0:0 X Y 0:0 Size is -3 Generated ROD rectangle Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 94 Product Version 5.0 Creating a Rectangle from a Path When the source object is a path, and you specify the size as +3, the system computes a bounding box for the path and generates a new rectangle that is larger than the bounding box. When the size is -3, the system generates a rectangle that is smaller than the bounding box. Source ROD path X Y 0:0 Generated ROD rectangle Size = +3 X Y 0:0 Generated ROD rectangle X Y 0:0 Size = -3 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 95 Product Version 5.0 Creating a Rectangle from Multiple Objects When there are several source objects, and you specify the size as +3, the systemcomputes a bounding box around all of the objects and generates a new rectangle that is larger than the bounding box. When you specify the size as -3, the system generates a rectangle that is smaller than the bounding box. Creating a Polygon from Another Object You can create a new polygon from one or more instances and/or ROD objects. The system computes the point list for the new polygon by applying the size you specify. If you specify a size that is too small for generating a new polygon, the system reports an error. The following sections show examples of creating polygons from a variety of shapes. Source named objects X Y 0:0 Generated ROD rectangle Size = +3 X Y 0:0 Generated ROD rectangle X Y 0:0 Size = -3 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 96 Product Version 5.0 Creating a Polygon from a Rectangle When the source object is a rectangle, and you specify the size as +3, the system generates a new polygon that is larger than the bounding box. When you specify the size as -3, the system generates a new polygon that is smaller than the bounding box. Source ROD rectangle X Y 0:0 Source Generated ROD polygon X Y 0:0 Source Size = +3 Size = +3 X Y 0:0 Source Size = -3 Generated ROD polygon Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 97 Product Version 5.0 Creating a Polygon from a Polygon When the source object is a polygon, and you specify the size as +2, the system generates a new, larger polygon. When you specify the size as -2, the system generates two new, smaller polygons that are not connected, because -2 is smaller than the narrowest part of the source polygon. Source ROD polygon X Y 0:0 Generated ROD polygon Size = +2 X Y 0:0 X Y 0:0 Size = -2 Generated ROD polygon Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 98 Product Version 5.0 Creating a Polygon from a Path When the source object is a path, and you specify the size as +3, the system generates a new polygon that is larger than the path. X Y 0:0 Source ROD path X Y 0:0 Size is +3. Generated ROD polygon Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 99 Product Version 5.0 When you specify the size as -2, the systemgenerates a new polygon that is smaller than the path. Creating a Polygon from Multiple Objects When there are several source objects, X Y 0:0 Size is -2. Generated ROD polygon Source named objects X Y 0:0 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 100 Product Version 5.0 and specify the size as +2, the systemcomputes a bounding box around all of the objects and generates a new polygon that is larger than the bounding box. When you specify the size as -2, the system generates a new polygon that is smaller than the bounding box. Creating a Path from Another Object You can create a new path from any ROD object or from multiple ROD objects. You can specify a size differential and also a starting and ending point or let the new path default to a self-abutting ring. When the source object is a path, the systemapplies the size differential to its perimeter. When generating a path, the system does the following: I Computes the point list for the newpath by applying the size as the distance between the centerline of the generated master path and ❑ For a single source object, the perimeter of the source object. ❑ For multiple source objects, the bounding box around all of the source objects. If you specify a negative size that is too small for generating a new path, the system reports an error. For example, when the source object is a path, the absolute value of a negative size cannot be greater than or equal to half of the width of the source path. I Starts the path at the point closest to the starting point of the source object. For rectangles, instances, and multiple source objects, the generated path always starts relative to the lower-left corner of the bounding box around the source object(s). I Creates the direction of the new path as follows: Generated ROD polygon Size is +2 X Y 0:0 Generated ROD polygon X Y 0:0 Size is -2 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 101 Product Version 5.0 ❑ When the source object is a single rectangle, instance, or path, in a clockwise direction. ❑ When there are multiple source objects, in a clockwise direction. ❑ When the source object is a polygon, in the direction in which the polygon was created. For example, when the source polygon was created in a counter-clockwise direction, the system creates the path in a counter-clockwise direction. Note: The system does not allow you to create self-intersecting master paths. If the master path you are creating would be self-intersecting, the path is not created, and a warning message is displayed in the CIW. The same is true for subpaths. The following sections show examples of creating paths from a variety of shapes. Creating a Path from a Rectangle When the source object is a rectangle, X Y 0:0 Source rectangle Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 102 Product Version 5.0 and you specify the size as +2, the system generates a new, larger path. When you specify the size as -2, the system generates a new, smaller path. Creating a Path from a Polygon When the source object is a polygon, Generated path Size is +2. X Y 0:0 Generated path X Y 0:0 Size is -2. Source rectangle Source ROD polygon X 0:0 Y Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 103 Product Version 5.0 and you specify the size as -1, the system generates a new path inside the perimeter of the polygon. Here is a close up of the bottom left side of the polygon and new path: X Y 0:0 For a close up of this section, see the next illustration. Generated path Size is -1. Source ROD polygon Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 104 Product Version 5.0 When you specify a small enough size, in this case -5, the systemgenerates a new path only inside the perimeter of the right side of this polygon. When you specify the size as +2, the system generates a new path outside the perimeter of the polygon. Source ROD polygon X Y 0:0 Generated path X 0:0 Y Generated path Source ROD polygon For a close up of this section, see the next illustration. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 105 Product Version 5.0 Here is a close up of the bottom right corner of the polygon and new path: Creating a Path from a Path When the source object is a path with a width of 3, Size is +2. Source ROD polygon Generated path Source ROD path X Y 0:0 Width = 3 Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 106 Product Version 5.0 and you specify the size as +4, the systemgenerates a newpath that is larger than the source path. Using the source path with a width of 3 from the previous example, the system would not create a path with a size of -1.5 because the absolute value of -1.5 is greater than or equal to half of the width of the source path. The system cannot create a path unless its width is greater than zero. Size is +4. X Y 0:0 Generated path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 107 Product Version 5.0 Here is an example of specifying a negative size to generate a newpath froman existing path. When the source path has a width of 6, and you specify the size as -2, the system generates a new path that is smaller than the source path. X Y 0:0 Source ROD path Width = 6 X Y 0:0 Size is -2. Generated path Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 108 Product Version 5.0 Creating a Path from Multiple Objects When you specify multiple source objects, the generated path forms a ring with the centerline of the master path offset from the bounding box by the size you specify. By default, the path has four segments. The new path is longer or shorter depending on whether you specify a positive or negative size. Connectivity When you use a RODfunction to create a shape, such as a rectangle or path, you can specify connectivity for the shape by associating it with a specific terminal and net. You can also make the shape into a pin. Source named objects X Y 0:0 Generated path Size is positive. X Y 0:0 Generated path X Y 0:0 Size is negative. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 109 Product Version 5.0 To specify connectivity for an object, you must use the ROD connectivity arguments. You can do this within a rodCreate function, such as rodCreateRect, by specifying values for the terminal name, terminal I/O type, and pin connectivity arguments. For a multipart path, you can create connectivity for any or all parts of the multipart path: the master path, subpaths and/or subrectangles. When you make the master path into a pin, the whole master path becomes a pin; when you make a subpath into a pin, the whole subpath becomes a pin; and when you make a set of subrectangles into a pin, each rectangle in the set becomes a pin. When you create a repeated object with connectivity, the connectivity applies to all objects in the repeat set. For a description of the connectivity arguments, see “ROD Connectivity Arguments for Rectangles” on page 224. To look at the connectivity for ROD objects, you can use the Edit Properties form. For information about this form, see “Editing and Defining Properties” in the Virtuoso Layout Editor User Guide. Note: To see terminal names for pins in a layout window, the display setting for pin names must be turned on. For information about how to change the display of pin names, see “Displaying Pin Names in a Layout Window” on page 305. Maintaining Connections for ROD Objects The Virtuoso layout editor Maintain Connections option works for unaligned ROD objects. However, for objects that are aligned, ROD alignments take precedence over maintaining connections. Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 110 Product Version 5.0 The following example shows the results of moving an object with the Maintain Connections option on, both when the object has an alignment and when it does not. In the example, there are two instances, each containing a pin, with a ROD (named) path connecting the pins. When objects do not have ROD alignments and the Maintain Connections option is on, moving instance IB causes the RODpath connecting the two pins to stretch, as shown below. When objects do have a ROD alignment, and the Maintain Connections option is on, moving instance IB causes the whole ROD path to move, as shown below. The aligned path Instance IB Instance IA X Y 0:0 ROD path Pins Instances IA and IB before the move. Instance IB Instance IA X Y 0:0 ROD path stretches No ROD alignments. Instance IB moved to the right Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 111 Product Version 5.0 does not stretch, so moving instance IB breaks the electrical connection between the two pins. Preserving Maintained Connections If you want the Maintain Connections option to take precedence over ROD alignments, you must either unalign the ROD objects or remove the name fromone of the aligned objects. For example, to preserve the connection between the two pins shown above while moving one of the instances, you can unalign the pin in instance IB fromthe ROD path or remove the name from either the IB pin or the ROD path. To unalign an object, see “rodUnAlign” on page 282. To remove the name froman object, see “rodUnNameShape” on page 284. For for more information, see “Maintain Connections” in the Virtuoso Layout Editor User Guide. Instance IB Instance IA X Y 0:0 Aligned ROD path moves Pin in instance IB is aligned to ROD path. Instance IB moved to the right Virtuoso Relative Object Design User Guide Relative Object Design Concepts July 2002 112 Product Version 5.0 Virtuoso Relative Object Design User Guide July 2002 113 Product Version 5.0 2 Accessing Information about ROD Objects This chapter describes Virtuoso®relative object design (ROD) objects, RODobject IDs, ROD object attributes, and how to access ROD object attributes. The topics covered are About ROD Objects and ROD Object IDs on page 113 Accessing ROD Object Attributes on page 118 About ROD Objects and ROD Object IDs Every named database object, such as an instance, layout cellview, or named shape, automatically has relative object design information associated with it. This information is stored in a ROD object. A ROD object is also a database object, but it exists in relation to its associated named database object. A ROD object is identified by a unique ROD object ID. A ROD object for a named shape, instance, or cellview contains the following information: hierarchical name cellview ID database ID transformation information (rotation, magnification, and offset) alignment information, if any number of segments (for shapes) names and values of user-defined handles, if any names of system-defined handles A ROD object ID is similar to a database ID. The database ID for an object is the temporary address in memory for the object. A ROD object ID is the temporary address for the ROD object associated with a specific database object. When you look at these two IDs in the Command Interpreter Window (CIW) for a database object, the database ID might be db:98342974 and the ROD object ID rodObj:23970843. Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 114 Product Version 5.0 You can create a new ROD database shape and its associated ROD object by using one of the rodCreate functions, such as rodCreateRectangle. You can also use the rodNameShape function to assign a name to an existing, unnamed database shape; the rodNameShape function creates a new associated ROD object for the shape. The value of the ROD object ID is returned when you execute the function rodGetObj, rodNameShape, or a rodCreate function, such as rodCreateRect. You might want to store the value returned in a variable so that you can refer to it later. You can also get the ROD object IDs for all of the named shapes in a cellview with a ROD function; see “rodGetNamedShapes” on page 263. Note: In the current release, ROD functionality is not implemented for mosaics. Getting the ROD Object ID You can get the ROD object ID for a named shape, instance, or cellview in the current open design window by performing one of the following steps. ➤ For a named shape, or instance, type the rodGetObj function using as input either the database ID of the object or both the hierarchical name of the object and the top-level layout cellview ID: rodId = rodGetObj( dbId ) or rodId = rodGetObj( "hierarchical_name" cellview_ID ) where dbId is the database ID, hierarchical_name is the hierarchical name of the object, and cellview_ID is the cellview ID. When you want the cellview ID (the database ID for the cellview) for the current open cellview, you can use the deGetCellView function without any arguments. For example, you can get the names of all attributes for the named shape polyRect, where polyRect is in instance ptr1 and ptr1 is in instance INV1, by typing the following statements in the CIW: cvId = deGetCellView() rodId = rodGetObj( "INV1/ptr1/polyRect" cvId ) where the statement cvId = deGetCellView() returns the cellview ID for the active cellview. ➤ To get the ROD object ID for a cellview, use an empty string ("") for the hierarchical name: rodId = rodGetObj( "" cvId ) Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 115 Product Version 5.0 Getting the ROD Object ID Interactively You can get the ROD object ID for one or more objects in an open layout cellview window by selecting the object(s) and typing commands in the Command Interpreter Window (CIW). Depending on whether you want to select a single object or multiple objects, do one of the following: Getting the ROD Object ID for a Single Object 1. Get the cellview ID for the active cellview window by typing in the CIW cvId = deGetCellView() 2. Select one object in the layout cellview window. 3. Get the database ID of the selected object and set it equal to the variable dbId by typing in the CIW dbId = car(geGetSelectedSet(cvId)) where the SKILL list operator car returns the first item in the list; in this case, the only item. 4. Get the ROD object ID of the selected object by typing in the CIW rodId = rodGetObj(dbId) Getting the ROD Object ID for Multiple Objects 1. Get the cellview ID for the active cellview window by typing in the CIW cvId = deGetCellView() 2. Select two or more objects in the layout cellview window. 3. Set a variable equal to a list of the database IDs of the selected objects by typing in the CIW dbIdList = geGetSelectedSet(cvId) To get the ROD object ID for a specific object in the list, use the SKILL list operators, such as car and cdr. Storing the ROD Object ID as a Variable (Avoid) There are circumstances under which a ROD object ID might change. For example, doing an Undo and Redo assigns new ROD object IDs to all ROD objects in the cellview. Therefore, rather than storing a ROD object ID in a variable, it is safer to retrieve it when you need it. For example, rather than stating: Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 116 Product Version 5.0 r = rodCreateRect( ?name "a" ?cvId cv ... ) ... ; More lines of code here rodAlign( ?alignObj r ... ) state the following: rodCreateRect( ?name "a" ?cvId cv ... ) ... ; More lines of code here rodAlign( rodGetObj( "a" cv) ... ) For more information about the effect of Undo and Redo on ROD object IDs, see Appendix G, “ROD object ID changes after Undo”. Checking Whether an Object Is a ROD Object The easiest way to find out if an object is a ROD object is with the Virtuoso ® layout editor Edit Properties command. You can also verify whether an object is a ROD object in the CIW or within a program. Checking with the Edit Properties Command To check whether an object is a ROD object, do the following: 1. In your layout cellview window, select the object. 2. Choose Edit – Properties or press q. The Edit Properties from appears. 3. Look at the bottom of the for a ROD Name field. If there is a ROD Name field, the object is a ROD object; otherwise, the object is not a ROD object. 4. To see the ROD properties for a ROD object, click on the ROD button at the top of the Edit Properties form. The form changes to show ROD properties for the selected object. For more information about this form, see “Editing and Defining Properties” in the Virtuoso Layout Editor User Guide. Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 117 Product Version 5.0 Checking in the CIW To check in the CIWwhether an object is a ROD object, you must first assign the object to a variable, then test the variable in either of the two ways shown below, where variable_name is a variable whose value might be a ROD object ID: I Use the rodIsObj function by typing rodIsObj( variable_name ) If rodIsObj returns t, the object is a ROD object. I Test for equivalency with the internal name of the ROD object data type (‘rodObj) by typing if( type( variable_name ) == ‘rodObj then ... ) ; end if where ‘rodObj is a symbol. Note: If you edit an object identified by variable_name and then undo the edit, the system no longer associates variable_name with the object. Therefore, further references to variable_name result in nil or rod:invalid. For more information see “ROD object ID changes after Undo” on page 338. Checking in a Program To verify whether an input parameter to a procedure you write contains a ROD object ID, you can test to see if the data type is R, the data type for ROD objects. The following sample procedure tests parameter_name to see if the data type is R: procedure(printObjType( parameter_name "R" ) printf("ROD object type is: %L" parameter_name~>dbId~>objType) ) ; end procedure When the data type for parameter_name is R, the procedure prints the type of RODobject, such as inst, rect, polygon, or path, as shown below: ROD object type is: "rect" When the data type for parameter_name is not R, the procedure returns an error message similar to the following: *Error* printObjType: argument #1 should be rodObj (type template = "R") - db:21218404 For information about basic Cadence ® SKILL language functions, including list operators, refer to the SKILL Language Reference Manual. Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 118 Product Version 5.0 Accessing ROD Object Attributes You can access predefined attributes for any of the following named objects: instances, cellviews, and named rectangles, polygons, paths, lines, dots, labels, and text-display objects. Use the ROD object ID and the database access operator (~>) with I The name of an attribute to get the value of that attribute I One question mark (?) to get a list of the names of all attributes I Two question marks (??) to get the names and values of all attributes The following table shows the information you can access with the ROD object ID and the database access operator (~>). Table 2-1 Using ~> to Access Information about ROD Objects Attribute, Handle, or ? Value Returned ~>? List of names for all ROD object attributes. ~>?? List of the names and values for all attributes. ~>align Alignment information for the ROD object. ~>chopHoles List of lists, where each list contains the coordinates of a chop hole in a MPP; nil where there are no chop holes in the MPP. ~>cvId ID of the top-level cellview containing the ROD object. ~>dbId Database ID of the ROD object at the lowest level. For multipart paths, dbId identifies the master path. ~>name Hierarchical name for the ROD object. ~>numSegments For shapes with segments (rectangles, polygons, and paths), the number of segments in the shape. ~>subShapes For multipart paths, the ROD object ID identifies the master path. Use ~>subShapes to list the database IDs for all subshapes (subpaths and subrectangles) associated with a multipart path. The list includes one database ID for each individual subrectangle. ~>systemHandleNames List of the names of all system-defined handles for the ROD object. Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 119 Product Version 5.0 For information about how to get the ROD object ID, see “Getting the ROD Object ID” on page 114. Note: When you use the ROD object ID to access a point handle for a named object, the system automatically transforms (converts) the coordinates of the point up through the hierarchy into the coordinate system of the top-most cellview containing the object. The values of system-defined handles are calculated on demand, when you reference them. Examples of Using ~> to Display Information The following examples show some of the ways to display information about ROD objects in the CIW. Example 1: Alignment Information You can query any named object to see what the object is aligned to. When you query a hierarchical object, the system displays all top-level alignments for the object. ~>transform Transforminformation for the ROD object, converted to the coordinate system of the top-most cellview. Transform information is a list of the rotation, magnification, and offset. ~>userHandleNames List of the names of all user-defined handles for the ROD object. ~>any_handle_name Value of the specified handle. Table 2-1 Using ~> to Access Information about ROD Objects, continued Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 120 Product Version 5.0 The figure belowshows instance I1 and rectangle rect0. Instance I1 contains instance I2. Instance I2 contains the polygon I1/I2/polyRect. The polygon I1/I2/polyRect is aligned to rect0 with a separation of -10.0. To query rect0 for alignments, type the following in the CIW: cvId = deGetCellView() rodGetObj( "rect0" cvId )~>align The system displays text similar to the following in the CIW: ((rodObj:2585108 "cR" rodObj:2585114 "cL" -10.0 0.0 ) ) The text above means the centerRight (cR) handle on I1/I2/polyRect (rodObj:2585108) is aligned to the centerLeft (cL) handle on rect0 (rodObj:2585114), with a separation of -10.0 along the X axis and no separation along the Y axis. Example 2: Attribute Names To display all attribute names for a ROD object, get its ROD object ID and type in the CIW: rodId~>? where the variable rodId contains the ROD object ID. The system displays a list of attribute names similar to the following list: Instance I1 Instance I2 polyRect rect0 X Y 0:0 X X Separation of -10.0 Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 121 Product Version 5.0 (name cvId dbId transform align numSegments userHandleNames systemHandleNames ) Note: The attribute numSegments appears in the list only for shapes with segments: rectangles, polygons, and paths. Example 3: Attribute Names and Values To display all attribute names and values for any ROD object (a named shape, instance, or cellview), get its ROD object ID and type in the CIW: rodId~>?? where the variable rodId contains the RODobject ID. If you do not want to use variables and the object is in the current open cellview, the following statement gets the same result: rodGetObj( "hierarchical_name" deGetCellView() )~>?? Example 4: Value of One Attribute To get the value for a particular attribute, use the attribute name instead of a question mark: rodId~>attribute_name For example, to display the value of the system-defined handle for the point in the center of the bounding box around a ROD object, type rodId~>centerCenter Example 5: Names of User-Defined Handles To display the names of all user-defined handles for an object, type in the CIW: rodGetObj( "hierarchical_name" cellview_ID )~>userHandleNames Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 122 Product Version 5.0 For example, assume the following four-segment, single-layer path named path2 is in the active cellview window, and that it has several user-defined handles. You can use the deGetCellView function (without any arguments) to get the database ID for the current open cellview. For this example, you would type: cvId = deGetCellView() userHandNames = rodGetObj( "path2" cvId )~>userHandleNames The system displays the following information in the CIW: ("stringHandle" "intHandle" "floatHandle" "trueHandle" "falseHandle" "ILExprHandle" "pointHandle" ) Example 6: Names of System-Defined Handles To display the names of all system-defined handles for an object, type in the CIW: rodGetObj( "hierarchical_name" cellview_ID )~>systemHandleNames For more information about using rodGetObj, see “rodGetObj” on page 264. segment 3 segment 1 Starting point X 0:0 Y X segment 0 segment 2 path2 Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 123 Product Version 5.0 For example, assume the following two-segment, single-layer path named path1 is in the active cellview window. You can use the deGetCellView function (without any arguments) to get the database ID for the current open cellview. For this example, you would type: cvId = deGetCellView() sysHandNames = rodGetObj( "path1" cvId )~>systemHandleNames The system displays the following information for path1 in the CIW: ("width" "length" "lowerLeft" "lowerCenter" "lowerRight" "centerLeft" "centerCenter" "centerRight" "upperLeft" "upperCenter" "upperRight" "length0" "start0" "startCenter0" "startLeft0" "startRight0" "mid0" "midLeft0" "midRight0" "end0" "endLeft0" "endRight0""length1" "start1" "startLeft1" startRight1" "mid1" "midLeft1""midRight1" "end1" "endLeft1" "endRight1" "lengthLast" "startLast""startLeftLast" "startRightLast" "midLast" "midLeftLast" "midRightLast" "endLast" "endCenterLast" "endLeftLast" "endRightLast" "mmpBBox" "chopHoles" ) Example 7: Names and Values of Attributes To display the names and values for all attributes of an object, type in the CIW: rodGetObj( "hierarchical_name" cellview_ID )~>?? segment 0 Starting point segment 1 X 0:0 Y X path1 Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 124 Product Version 5.0 Using the same example, assume the following four-segment, single-layer path named path2 is in the active cellview window. You can use the deGetCellView function (without any arguments) to get the database ID for the current open cellview. For this example, you would type: cvId = deGetCellView() rodGetObj( "path2" cvId )~>?? The system displays information in the CIW that looks like this: ("rodObj:17653796" name "path2" cvId db:16324652 dbId db:16325104 transform ((0.0 0.0) "R0" 1.0) align nil numSegments 4 userHandleNames ("stringHandle" "intHandle" "floatHandle" "trueHandle" "falseHandle" "ILExprHandle" "pointHandle" ) systemHandleNames ("width" "length" "lowerLeft" "lowerCenter" "lowerRight" "centerLeft" "centerCenter" "centerRight" "upperLeft" "upperCenter" "upperRight" "length0" "start0" "startCenter0" "startLeft0" "startRight0" "mid0" "midLeft0" "midRight0" "end0" "endLeft0" "endRight0" "length1" "start1" "startLeft1" "startRight1" "mid1" "midLeft1" "midRight1" "end1" "endLeft1" "endRight1" "length2" "start2" "startLeft2" "startRight2" "mid2" "midLeft2" "midRight2" "end2" "endLeft2" "endRight2" "length3" "start3" "startLeft3" "startRight3" "mid3" "midLeft3" "midRight3" "end3" segment 3 segment 1 Starting point X 0:0 Y X segment 0 segment 2 path2 Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 125 Product Version 5.0 "endLeft3" "endRight3" "lengthLast" "startLast" "startLeftLast" "startRightLast" "midLast" "midLeftLast" "midRightLast" "endLast" "endCenterLast" "endLeftLast" "endRightLast" "mppBBox" ) ) Getting System-Defined Handle Values with a Script You can display in the CIW the values for all system-defined handles for a selected ROD object in a cellview by using the SKILL procedure rodPrintSystemHandleValues. The procedure requires the ROD object ID as input. Problem 2-4 Getting Values of System-Defined Handles for a Path You want to knowthe values of the system-defined handles for a particular RODobject in your active cellview. Use the rodPrintSystemHandleValues procedure to display the names and values of all system-defined handles. You can load the procedure from the Cadence hierarchy or create a procedure file yourself and load your file. Instructions for accessing or creating the rodPrintSystemHandleValues procedure are presented in the following Solution section. To access the ROD object path1 using its name, you need the cellview ID. For example, there is a two-segment single-layer path named path1. Use the rodPrintSystemHandleValues procedure to display the names and values of all system- defined handles for path1. segment 0 Starting point segment 1 X 0:0 Y X path1 Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 126 Product Version 5.0 Solution 2-4 Getting Values of System-Defined Handles for a Path First, you need to load the rodPrintSystemHandleValues procedure into your system. You can access the rodPrintSystemHandleValues.il file from the samples/ROD/ skill directory in your Cadence hierarchy or create the procedure yourself and load your file. 1. Access the rodPrintSystemHandleValues procedure in one of the following ways: ❑ To create the procedure yourself, use a text editor to open a new file named rodPrintSystemHandleValues.il and type or copy the following statements: ; rodPrintSystemHandleValues.il procedure( rodPrintSystemHandleValues(rodObj) prog( handle handleValue handleList) handleList = rodObj~>systemHandleNames if(handleList then printf( "System handle names and values for %L (%L):\n" rodObj~>name rodObj ) ; end of printf foreach( handle handleList handleValue = rodGetHandle(rodObj handle) printf("%L %L\n" handle handleValue) ) ; end of foreach else printf("%L has no system-defined handles.\n" rodObj ) ; end of printf ) ; end of if ; end of prog t ; procedure always returns t ) ; end of procedure To load the rodPrintSystemHandleValues.il file you created, type the following in the CIW: load "your_path/rodPrintSystemHandleValues.il" where your_path is the path to your procedure file. ❑ To load the procedure from the Cadence hierarchy, type load prependInstallPath( "samples/ROD/skill rodPrintSystemHandleValues.il") The rodPrintSystemHandleValues procedure requires the ROD object ID as input, so next you get the ROD object ID. 2. Get the ROD object ID for a selected object in the active cellview window by typing the following statements in the CIW: cv = deGetCellView() rodId = rodGetObj( "hierarchical_object_name" cv ) Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 127 Product Version 5.0 where the first statement gets the cellview ID for the active cellview and hierarchical_object_name is the name of your selected ROD object. For example: rodId = rodGetObj( "path1" cv ) 3. Run your rodPrintSystemHandleValues procedure by typing the following statement in the CIW: rodPrintSystemHandleValues(rodId) In the CIW, the system displays a list of all handle names and their values. For example, for path1, the system displays the following information in the CIW: rodPrintSystemHandleValues(rodId) System handle names and values for "path1" (rodObj:29057048) "width" 21.0 "length" 11.0 "lowerLeft" (2.7 1.4) "lowerCenter" (13.2 1.4) "lowerRight" (23.7 1.4) "centerLeft" (2.7 6.9) "centerCenter" (13.2 6.9) "centerRight" (23.7 6.9) "upperLeft" (2.7 12.4) "upperCenter" (13.2 12.4) "upperRight" (23.7 12.4) "length0" (20.0) "start0" (2.7 2.4) "startCenter0" (2.7 2.4) "startLeft0" (2.7 3.4) "startRight0" (2.7 1.4) "mid0" (12.7 2.4) "midLeft0" (12.2 3.4) "midRight0" (13.2 1.4) "end0" (22.7 2.4) "endLeft0" (21.7 3.4) "endRight0" (23.7 1.4) "length1" 10.0 "start1" (22.7 2.4) "startLeft1" (21.7 3.4) "startRight1" (23.7 1.4) "mid1" (22.7 7.4) "midLeft1" (21.7 7.9) "midRight1" (23.7 6.9) "end1" (22.7 12.4) "endLeft1" (21.7 12.4) "endRight1" (23.7 12.4) "lengthLast" 10.0 "startLast" (22.7 2.4) "startLeftLast" (21.7 3.4) "startRightLast" (23.7 1.4) "midLast" (22.7 7.4) "midLeftLast" (21.7 7.9) "midRightLast" (23.7 6.9) "endLast" (22.7 12.4) "endCenterLast" (22.7 12.4) "endLeftLast" (21.7 12.4) "endRightLast" (23.7 12.4) Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 128 Product Version 5.0 "mppBBox" (((2.7 1.4) (23.7 12.4))) t Getting User-Defined Handle Names with a Script You can display in the CIWthe values for all user-defined handles for a selected ROD object in a cellview by using the SKILL procedure rodPrintUserHandleValues. The procedure requires the ROD object ID as input. Problem 2-5 Getting Values of User-Defined Handles for a Path You want to know the values of the user-defined handles for a particular ROD object in your active cellview. Use the rodPrintUserHandleValues procedure to display the values of all handles assigned to the four-segment, single-layer path named path2. Assign the results to the local variable userHandValues. You can load the rodPrintUserHandleValues.il file from the samples/ROD/skill directory in your Cadence hierarchy or create the procedure file yourself and load your file. Instructions for creating and loading the rodPrintUserHandleValues procedure are presented in the Solution section. To access the ROD object path2 using its name, you need the cellview ID. segment 3 segment 1 Starting point X 0:0 Y X segment 0 segment 2 path2 Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 129 Product Version 5.0 Solution 2-5 Getting Values of User-Defined Handles for a Path 1. Access and load the rodPrintUserHandleValues procedure in one of the following ways: ❑ To create the procedure yourself, use a text editor to open a new file named rodPrintUserHandleValues.il and type or copy the following statements: ; rodPrintUserHandleValues.il procedure( rodPrintUserHandleValues(rodObj) prog((handle handleValue handleList) handleList = rodObj~>userHandleNames if(handleList then printf( "User handle names and values for %L (%L):\n" rodObj~>name rodObj ) ; end printf foreach(handle handleList handleValue = rodGetHandle(rodObj handle) printf("%L %L\n" handle handleValue) ) ; end foreach else printf("%L has no user-defined handles.\n" rodObj) ) ; end if ) ; end of prog t ; procedure always returns t ) ; end of procedure To load the rodPrintUserHandleValues procedure you created, type the following statements in the CIW: load "your_path/rodPrintUserHandleValues.il" where your_path is the path to your procedure file. ❑ To load the procedure from the Cadence hierarchy, type load prependInstallPath("samples/ROD/skill/rodPrintUserHandleValues.il") The rodPrintUserHandleValues procedure requires the ROD object ID as input, so next you get the ROD object ID. 2. Get the ROD object ID for a selected object in the active cellview window by typing the following statements in the CIW: cv = deGetCellView() rodId = rodGetObj( "hierarchical_object_name" cv ) where the first statement gets the cellview ID for the active cellview and hierarchical_object_name is the name of your selected ROD object. For example: rodId = rodGetObj( "path2" cv ) Virtuoso Relative Object Design User Guide Accessing Information about ROD Objects July 2002 130 Product Version 5.0 3. Run your rodPrintUserHandleValues procedure by typing the following statements in the CIW: rodPrintUserHandleValues(rodId) In the CIW, the system displays a list of all user-defined handle names and their values. For example, for path2, the system displays the following information in the CIW: rodPrintUserHandleValues(rodId) User handle names and values for "path2" (rodObj:29057048) "stringHandle" "aaa" "intHandle" 311 "floatHandle" 3.3 "trueHandle" t "falseHandle" nil "ILExprHandle" 1.8 "pointHandle" (6.6 7.7) t Virtuoso Relative Object Design User Guide July 2002 131 Product Version 5.0 3 Using Relative Object Design Functions This chapter contains information you need to knowbefore using the Virtuoso ® relative object design (ROD) functions and describes the RODfunctions and howto use them. The functions are listed in alphabetical order. Editing ROD Objects with the Virtuoso Layout Editor on page 132 Data Types for SKILL Function Arguments on page 133 Using Variables in ROD Functions on page 134 Maximum String Length for ROD Function Arguments on page 135 Using Special Characters in Names on page 136 rodAddMPPChopHole on page 137 rodAddPoints on page 140 rodAddToX on page 141 rodAddToY on page 142 rodAlign on page 143 rodAssignHandleToParameter on page 154 rodCreateHandle on page 175 rodCreatePath on page 179 rodCreatePolygon on page 207 rodCreateRect on page 213 rodDeleteHandle on page 254 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 132 Product Version 5.0 rodFillBBoxWithRects on page 255 rodGetHandle on page 262 rodGetNamedShapes on page 263 rodGetObj on page 264 rodIsFigNameUnused on page 270 rodIsHandle on page 272 rodIsObj on page 273 rodNameShape on page 275 rodPointX on page 279 rodPointY on page 280 rodSubPoints on page 281 rodUnAlign on page 282 rodUnNameShape on page 284 Solutions to Problems on page 285 Editing ROD Objects with the Virtuoso Layout Editor For information about howthe Virtuoso ® layout editor commands work with Virtuoso ® relative object design (ROD) objects, see Appendix E, “How Virtuoso Layout Editor Works with ROD Objects”. Using commands that are not fully supported for ROD objects could cause the objects to lose the ROD information associated with them, changing the objects into ordinary shapes. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 133 Product Version 5.0 Data Types for SKILL Function Arguments The Cadence ® SKILL Language supports many data types, including integer and floating- point numbers, character strings, arrays, and a highly flexible linked list structure for representing aggregates of data. The table below lists by prefix all the data types supported by SKILL, including the data types for the arguments of ROD functions. Data Types by Type Prefix Internal Name Data Type a array array b ddUserType Boolean C opfcontext OPF context d dbobject Cadence database object (CDBA) e envobj environment f flonum floating-point number F opffile OPF file ID g general any data type G gdmSpecIlUserType gdm spec h hdbobject hierarchical database configuration object l list linked list m nmpIlUserType nmpIl user type M cdsEvalObject — n number integer or floating-point number o userType user-defined type (other) p port I/O port q gdmspecListIlUserType gdm spec list r defstruct defstruct R rodObj relative object design (ROD) object s symbol symbol Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 134 Product Version 5.0 Data Type g for General The data type for ROD function arguments that require a Boolean value is specified as g. However, the ROD function verifies that the value is t or nil; for Boolean ROD arguments, values other than t or nil are not valid. Data Type S and Symbols You can specify arguments with the data type S as either a character string or symbol. For a character string, enclose the characters in quotation marks (""). For a symbol, precede the characters by a single quotation mark ('). On the keyboard, the single quotation mark is usually located belowthe double quotation mark. RODconverts symbols to character strings. The S_name argument must contain at least one character. For example, to indicate that the characters poly1 are a string, you can type either of the following: "poly1" or 'poly1 For more information, see “Data Types” in the SKILL Language User Guide. Using Variables in ROD Functions The following variables are useful in ROD functions: S stringSymbol symbol or character string t string character string (text) u function function object, either the name of a function (symbol) or a lambda function body (list) U funobj function object v hdbpath — w wtype window type x integer integer number y binary binary function & pointer pointer type Data Types by Type Prefix Internal Name Data Type Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 135 Product Version 5.0 I pcCellView An internal variable automatically created by the pcDefinePCell function. pcCellView contains the database ID of the cellview you are creating. Within the body of your pcell code, use the pcCellView variable as the cellview identifier for which you create objects. For an example, see “Solution 3-4 Aligning Objects at Different Levels in the Hierarchy” on page 287. In SKILL expressions (ILExpr) for RODarguments, use the rodCellView variable rather than pcCellView. I tcCellView An internal variable automatically created by the tcCreateDeviceClass function. tcCellView contains the database ID of the cellview you are creating. Within the body of your pcell code, use the tcCellView variable as the cellview identifier for which you create objects. In SKILL expressions (ILExpr) for ROD arguments, use the rodCellView variable rather than pcCellView. I rodCellView When used in a SKILL expression (ILExpr) for a ROD argument, such as when specifying the n_xSep and n_ySep arguments for rodCreatePath, rodCellView contains the database ID of the current cellview. Using rodCellView allows you to reference rules in your technology file so that your code will work in different technologies. For example, you can create alignments at the zero-level in your hierarchy, and the system automatically updates the alignments when you make changes to technology file rules that affect them. You can use rodCellView inside or outside of pcells. Maximum String Length for ROD Function Arguments The maximum number of characters you can specify for a ROD function argument that accepts a string is 1,024. If you specify a string having more than 1,024 characters, you get a syntax error. When you assign a string value to any of the following name arguments, use less than 1,024 characters: I Paths, rectangles, or polygons when you create them I Objects using the rodNameShape function I User-defined handles If you specify a name using a symbol, use no more than 255 characters in the symbol name. Any symbol name longer than 255 characters results in an error. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 136 Product Version 5.0 Using Special Characters in Names When possible, avoid using special characters in the names of handles or ROD objects. Using a special character requires you to type a backslash as an escape character every time you type the name. If you must use a special character in a string, type a backslash followed by the code for the special character, as shown in the following table: Table 3-1 Using Special Characters in ROD Object Names Special Character Escape Sequence backspace \b form feed \f new line (line feed) \n carriage return \r horizontal tab \t vertical tab \v backslash \\ single quotation mark \' double quotation mark \" Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 137 Product Version 5.0 rodAddMPPChopHole rodAddMPPChopHole( R_rodObj l_pts ) ; end of rodAddMPPChopHole => t | nil Description Adds a chop hole to all choppable parts of a ROD multipart path. To define a chop hole, you specify a list of points on the centerline of the master path. The results depend on whether the master path is choppable or not. Master path is choppable; therefore all subparts are choppable. Master path is not choppable, but subparts are choppable. Chop hole points X X Chop hole points X X One master path Two master paths Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 138 Product Version 5.0 To add a chop hole to a segment of a multipart path, you must specify two points on the same segment. If you specify only one point on a segment, the system ignores the point. To add a chop hole that includes a vertex (the intersection of two segments), you must include the vertex point in your list. For more information about how chop holes affect multipart paths, see “Creating Paths with rodCreatePath” on page 205. X Y 0:0 X Y 0:0 X X Specify two points on a segment… To get this result: Chop hole points X Y 0:0 X Y 0:0 X X X Specify points including the vertex… To get this result: Chop hole points Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 139 Product Version 5.0 Arguments R_rodObj ROD object ID associated with the multipart path. Default: none l_pts List of two or more points on the centerline of the master path specifying where to create a chop hole. The chop hole affects choppable parts only. You are required to specify at least two points. The system discards duplicate and collinear points but does not consider them an error. Use one of the following formats: list( x:y x:y ... ) or list( list(x y) list(x y) ... ) Default: none Return Values t The multipart path was chopped successfully. nil An error occurred and the multipart path was not chopped. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 140 Product Version 5.0 rodAddPoints rodAddPoints( l_point1 l_point2 ) ;end rodAddPoints => l_point | nil Description Adds two points together and returns the resulting point as l_point. Arguments l_point1 A set of coordinates in one of the following formats: x:y or list(x y) Default: none l_point2 A set of points in one of the following formats: x:y or list(x y) Default: none Return Values l_point The point that results from adding l_point1 and l_point2. nil No points were added due to an error. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 141 Product Version 5.0 rodAddToX rodAddToX( l_point n_num ) ;end rodAddToX => l_point | nil Description Adds a number to the X coordinate of l_point and returns the resulting point as l_point. Arguments l_point A set of coordinates in one of the following formats: x:y or list(x y) Default: none n_num Signed integer or floating-point number. Default: none Return Values l_point The point resulting from adding n_num to the X coordinate of l_point. nil No number was added due to an error. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 142 Product Version 5.0 rodAddToY rodAddToY( l_point n_num ) ;end rodAddToY => l_point | nil Description Adds a number to the Y coordinate of l_point and returns the resulting point as l_point. Arguments l_point A set of coordinates in one of the following formats: x:y or list(x y) Default: none n_num Signed integer or floating-point number. Default: none Return Values l_point The point resulting from adding n_num to the Y coordinate of l_point. nil No number was added due to an error. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 143 Product Version 5.0 rodAlign rodAlign( ?alignObj R_alignObj [?alignHandle S_alignHandle] [?refObj R_refObj] [?refHandle S_refHandle] [?refPoint l_refPoint] [?maintain g_maintain] [?xSep txf_xSep] [?ySep txf_ySep] ) ; end rodAlign => R_rodObj | nil Description Aligns a named object by a point handle on that object to a specific point or to a point handle on a reference object. You can align objects that are at different levels of hierarchy as long as both objects are in the same top-level layout cellview. You can specify positive or negative separation between alignment points in the direction of both the X and Y axes, either as absolute distances or with Cadence SKILL language expressions. The system applies the offset from the reference point or reference object to the object to be aligned. When you align an object to a point, the system creates a user-defined handle for the point with the system-assigned name handlen, where n is a number that makes the handle name unique in the cellview. For information about user-defined handle, see “User-Defined Handles” on page 34. You can also use the rodAlign function to quickly arrange objects in relation to each other by temporarily aligning them. When the g_maintain argument is set to nil, alignments are no longer maintained after the function is executed. For an overview about aligning objects, see “Aligning Objects” on page 35. The following examples illustrate aligning ROD objects. Figure 3-1 on page 144 shows the object polyRect before and after it is aligned to the reference point 0:0. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 144 Product Version 5.0 Figure 3-1 Aligning a Rectangle to a Point Figure 3-2 on page 144 shows the objects polyRect and rect0 both before and after polyRect is aligned to rect0. After alignment, the centerLeft handle of polyRect is aligned to the centerRight handle of rect0, with a positive separation along the X axis. The object polyRect is on the right side of rect0 because the system applies the offset from the reference object rect0 to the aligned object polyRect. Figure 3-2 Aligning Two Rectangles with Positive Separation Figure 3-3 on page 145 shows instance I1 and the rectangle rect0. Instance I1 contains instance I2, which contains the object polyRect. Reference point is 0:0. X Y 0:0 X Y 0:0 polyRect Before alignment After alignment polyRect polyRect Reference object rect0 X Y 0:0 X Y 0:0 Reference object rect0 X X Before alignment After alignment Positive offset from reference object polyRect Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 145 Product Version 5.0 Figure 3-3 Aligning an Instance and Rectangle Across Hierarchy The hierarchical name for polyRect is I1/I2/polyRect. Figure 3-4 on page 146 shows instance I1 and rect0 after alignment across hierarchy. rect0 is the reference object. The centerRight handle of I1/I2/polyRect is aligned to the centerLeft handle of rect0, with a -10 separation in the direction of the X axis. Because the offset is negative along the X axis, the aligned object I1/I2/polyRect is on the left side of the reference object rect0. Subsequently, if you move rect0, instance I1 and everything in it moves with rect0, maintaining the correct alignment; also, if you move instance I1, rect0 moves with it. Instance I1 Instance I2 X Y 0:0 Before alignment Reference object rect0 polyRect Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 146 Product Version 5.0 Figure 3-4 Instance and Rectangle After Alignment Note: For information about how the Virtuoso ® layout editor Maintain Connections option works for aligned objects, see “Maintaining Connections for ROD Objects” on page 109. Querying an Object for Alignments You can query any named object to see what the object is aligned to. When you query a hierarchical object, the system displays all top-level alignments for the object. To see the alignments for an object, you can use the Virtuoso ® layout editor Edit Properties command (the ROD section) or type commands in the CIW, as shown in the examples below. As shown in the example, I1/I2/polyRect is aligned to rect0. To query rect0 in Figure 3-4 on page 146 for alignments, type the following in the CIW: cvId = deGetCellView() rodGetObj( "rect0" cvId )~>align The system displays text similar to the following in the CIW: ((rodObj:2585108 "cR" rodObj:2585114 "cL" -10.0 0.0 ) ) Instance I1 Instance I2 polyRect Reference object rect0 X Y 0:0 Negative offset from reference object. X X Separation of -10.0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 147 Product Version 5.0 The text above states that the centerRight (cR) handle on I1/I2/polyRect (rodObj:2585108) is aligned to the centerLeft (cL) handle on rect0 (rodObj:2585114), with a separation of -10.0 along the X axis and no separation along the Y axis. Moving Aligned Objects When you move a RODobject that is aligned to one or more RODobjects, the aligned objects move also. When you move a ROD object that is aligned to a reference point, the system changes the value of the reference point handle to keep the point in the same relationship with the object. Arguments R_alignObj ROD object ID associated with the object you want to align. Use with S_alignHandle to specify a point on R_alignObj to use for alignment. The object you want to align must exist in the same top-level cellview as the reference object or reference point. Default: none S_alignHandle Character string or symbol specifying the name of the handle to use as the alignment point on R_alignObj. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. Default: centerCenter R_refObj ROD object ID associated with the object to be used as a reference for the alignment. The reference object must exist in the same top-level cellview as the object specified by R_alignObj. If you do not specify l_refPoint, this argument is required. If you also specify l_refPoint, the value of l_refPoint overrides the values of R_refObj and S_refHandle. Default: none S_refHandle Character string or symbol specifying the name of the handle on the reference object to which you want to align R_alignObj. If you also specify l_refPoint, it overrides the value of R_refObj and S_refHandle. Default: centerCenter Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 148 Product Version 5.0 l_refPoint A list of two coordinates specifying the point to which you want to align R_alignObj. Use one of the following formats: x:y or list( x y ) If you do not specify S_refHandle, R_refObj, or l_refPoint, then l_refPoint defaults to 0:0. If you specify l_refPoint and also specify R_refObj (with or without specifying S_refHandle), the value of l_refPoint overrides the values of R_refObj and S_refHandle. Default: 0:0 g_maintain A Boolean value specifying whether or not to maintain an alignment after it is created. The value must be t or nil. When set to t, moving one of two aligned objects moves the other with it. When set to nil, moving one of two aligned objects does not move the other object. You can use the nil setting to create temporary alignments for the purpose of arranging objects in relation to each other. These alignments are no longer in effect after the rodAlign function completes execution. Default: t txf_xSep An integer, floating-point number, or Cadence SKILL language expression specifying the vector distance in the direction of the X axis fromeither the reference point handle S_refHandle on R_refObj or the reference point l_refPoint to the alignment point handle S_alignHandle on R_alignObj. The value can be positive or negative or a SKILL expression that evaluates to a positive or negative number. SKILL expressions are reevaluated whenever the design is opened, the technology file is updated, or one of the aligned objects is moved or modified. Default: 0 txf_ySep An integer, floating-point number, or Cadence SKILL language expression specifying the distance along the Y axis from either the reference point handle S_refHandle on R_refObj or the reference point l_refPoint to the alignment point handle S_alignHandle on R_alignObj. The value can be positive or negative or a Cadence SKILL language expression that Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 149 Product Version 5.0 evaluates to a positive or negative number. SKILL expressions are reevaluated whenever the design is opened, the technology file is updated, or one of the aligned objects is moved or modified. Default: 0 Return Values R_rodObj ROD object ID for the ROD object information associated with R_alignObj. nil An error occurred and no objects were aligned. Aligning ROD Objects Using rodAlign This section presents a few problems to solve using the rodAlign function. To encourage you to think about or solve themyourself, the solutions are not presented until the end of this chapter. You can use one of the following variables to access the current cellview ID: pcCellView, tcCellView, or rodCellView. For a brief description of these variable, see “Using Variables in ROD Functions” on page 134. I Problem 3-1 Aligning an Object to a Point on page 150 I Problem 3-2 Aligning Two Rectangles at the Same Level of Hierarchy on page 151 I Problem 3-3 Moving an Object with rodAlign on page 151 I Problem 3-4 Aligning Objects at Different Levels in the Hierarchy on page 152 For an example showing a guard ring created using rodAlign, see “Code Examples” on page 315. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 150 Product Version 5.0 Problem 3-1 Aligning an Object to a Point Inside of a pcell, align the lower left corner of the object named Boundary to the reference point 15:10. Solution 3-1 Aligning an Object to a Point on page 285. Boundary 15:10 X Y 0:0 X Y 0:0 Before alignment After alignment X X Boundary 15:10 X Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 151 Product Version 5.0 Problem 3-2 Aligning Two Rectangles at the Same Level of Hierarchy Align the center of the rectangle named polyRect to the center of the rectangle named activeRect so that their centers are coincident. The two rectangles are at the same level in the design hierarchy. Solution 3-2 Aligning Two Rectangles at the Same Level of Hierarchy on page 286. Problem 3-3 Moving an Object with rodAlign Use the rodAlign function to move the object named boundary so that its lowerCenter handle has a positive offset along the Y axis from the upperLeft handle of the reference X polyRect activeRect polyRect activeRect X Y 0:0 X Y 0:0 Before alignment After alignment X X Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 152 Product Version 5.0 object activeRect. Specify the arguments so that no alignment persists after the rodAlign function completes. Solution 3-3 Moving an Object with rodAlign on page 286. Problem 3-4 Aligning Objects at Different Levels in the Hierarchy In a pcell, there are two objects named rect0 on the metal1 layer in different instances. Align the centerRight point handle on rect0 in the instance nTran1 to the centerLeft point handle of the reference object rect0 in the instance nTran2. Specify a negative separation along the X axis between the point handles as the minimumspacing rule fromthe technology file for the metal1 layer. Because this rodAlign statement occurs within a pcell, you can use the pcell variable pcCellView for the cellview ID. X boundary activeRect boundary activeRect X Y 0:0 X Y 0:0 Before alignment After alignment X Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 153 Product Version 5.0 To access the technology file, use the techGetTechFile function to get the technology file ID and set it equal to the variable tfId. The techGetTechFile function requires the cellview ID or library ID as input. Solution 3-4 Aligning Objects at Different Levels in the Hierarchy on page 287. rect0 Pcell before alignment X Instance nTran1 Instance nTran2 X 0:0 Y X rect0 rect0 rect0 Pcell after alignment X Instance nTran1 Instance nTran2 X 0:0 Y X Rectangles are minSpacing distance apart. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 154 Product Version 5.0 rodAssignHandleToParameter rodAssignHandleToParameter( ?parameter S_parameter ?rodObj R_rodObj ?handleName Sl_handleName [?displayName S_displayName] [?displayExpression S_displayExpression] [?stretchDir S_stretchDir] [?stretchType S_stretchType] [?moveOrigin g_moveOrigin] [?updateIncrement f_updateIncrement] [?userData g_userData] [?userFunction Sl_userFunction] ) ; end rodAssignHandleToParameter => t | nil Description Assigns one or more user- or system-defined point handles on a ROD object within a SKILL- based parameterized cell (pcell) to a single pcell parameter, so you can change the value of the parameter by graphically stretching the handle(s). Stretching a handle has the same effect as changing the value of the associated parameter for the pcell instance using the Edit Properties form. You cannot stretch handles on the pcell master. All rodAssignHandleToParameter statements must occur within the body-of-code section of a SKILL-based pcell. For an overview of stretchable pcells, see “Stretchable Parameterized Cells” on page 38. For a description of howthe Virtuoso layout editor Stretch command works for stretchable pcells, see “Stretching Parameterized Cells” in the Virtuoso Layout Editor User Guide. Arguments S_parameter Character string or symbol specifying the name of the pcell parameter to which you want to assign one or more point handles. The data type of the pcell parameter must be an integer or floating-point number, unless you also specify the Sl_userFunction argument. This argument is required. If you do not specify this argument or the parameter does not exist in the parameter declaration section of the pcell code, the function reports an error. Valid Values: any parameter associated with the pcell Default: none Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 155 Product Version 5.0 R_rodObj ROD object ID identifying the object in a pcell that has the point handles you want to assign to a parameter. This argument is required. If you do not specify this argument or the specified ROD object ID is not valid, the function reports an error. Default: none Sl_handleName Character string or symbol specifying the name of a single user- or system-defined point handle or a list of character strings or symbols specifying the names of one or more point handles. You can specify any point handles that are associated with the object specified by R_rodObj. This argument is required. If you do not specify this argument or a specified handle is not a point handle for the specified object, the function reports an error. Default: none S_displayName Character string or symbol specifying any text that you want the system to display next to the pcell while you stretch it, such as the name of a parameter or an expression. For example, the following are valid values: "length", ‘length, "length + 2", and "My Handle". If you also specify S_displayExpression, the system displays both its value “as is”, without evaluating it, and the result of evaluating the S_displayExpression argument, separated by the string " = ", in the following format: displayName = displayExpression_evaluation_result The following examples show what the system displays when you specify both display arguments: If you do not specify S_displayExpression, the system treats S_displayName as an expression and evaluates it S_display Name S_display Expr displayExpr Evals To What You See "length" "length * 2" 10 length = 10 "length" "width + 3" 16 length = 16 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 156 Product Version 5.0 dynamically as you stretch the pcell. The system displays both the string or symbol and the result of the evaluation, separated by the string " = ", in the following format: displayName = displayName_evaluation_result If S_displayName does not evaluate successfully, the system displays Eval not successful in the layout cellview instead of a value. If no value is specified for S_displayName, nothing is displayed for it. For more information about specifying this argument, see “Displaying Parameter Information” on page 161. Default: none S_displayExpression Character string or symbol specifying an expression, such as a parameter name or equation. For example, the following are valid values: "width", ‘width, and "width + 2". The systemevaluates the value of this argument dynamically as you stretch the pcell and displays the result next to the pcell. When you specify this argument but do not specify the S_displayName argument, the system displays the result of the evaluation in the following format: result_of_evaluation For example, for the expression "width", where width equals 12, the systemdisplays 12.0; for the expression "width + 2", the system displays 14.0. If you also specify the S_displayName argument, the system displays both the value of S_displayName, without evaluating it, and the result of evaluating the S_displayExpression argument, separated by thestring " = ", in the format: Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 157 Product Version 5.0 string_or_symbol = displayExpression_evaluation_result For more information about specifying this argument, see “Displaying Parameter Information” on page 161. Default: none S_stretchDir Character string or symbol specifying the axis along which you want the pcell to stretch. Although you can stretch the pcell in any direction, the system computes the change to S_parameter only in the direction of the axis specified by this argument; the systemupdates the associated pcell parameter with a change in the direction of either the X or Y axis. Valid Values: x, X, y, or Y Default: x S_stretchType Character string or symbol specifying whether the stretch is relative to the position of the handle or to the center of the pcell. When the value is absolute, the stretch is relative to the handle; when the value is relative, the stretch is relative to the center of the pcell. For an absolute stretch, an upward stretch away from the position of the handle (in a positive direction along the axis) is an increment; a downward stretch away from the position of the handle (in a negative direction along the axis) is a decrement. For a relative stretch, a stretch is away fromthe center of the pcell is an increment; a stretch towards the center of the pcell is a decrement. For examples showing relative vs. absolute, see “Results of Stretching a Handle” on page 45. Valid Values: relative or absolute Default: relative g_moveOrigin Boolean value specifying whether the system can move the origin point of an instance during the stretch of a handle on the instance or on an object in the instance. When the value is t, the origin point can move during a stretch; when the value is nil, the origin point cannot move during a stretch. Specifying t is most useful when S_stretchType is set to relative and the location of the stretch handle coincides with and affects the bounding box of the pcell instance. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 158 Product Version 5.0 When the origin point can move, the edges of the instance adjacent to the origin point can move also, which allows handles on those edges to move in the direction of the stretch. When the origin cannot move, the edges of the instance adjacent to the origin point cannot move either, which prevents handles on those edges from moving in the direction of the stretch. For more examples, see “Results of Stretching a Handle” on page 45. Valid Values: t, nil Default: nil f_updateIncrement Floating-point number specifying how often the system updates the pcell parameter (S_parameter) and regenerates the pcell during a stretch operation. If you specify a negative number, the system uses the default. The default is the value of the layout Relative stretch towards center, origin point can move pcell X Y 0:0 pcell Absolute positive stretch, origin point can move X Y 0:0 length pcell Absolute positive stretch, origin point cannot move X Y 0:0 length Relative stretch towards center, origin point cannot move pcell X Y 0:0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 159 Product Version 5.0 editor environment variable udpatePcellIncrement. If you specify f_updateIncrement, its value overrides the value of updatePCellIncrement. Default: value of the layout editor environment variable udpatePcellIncrement g_userData User data of any data type. The system evaluates the data and includes the result as part of the r_defstruct structure that is passed to Sl_userFunction as input. This argument lets you pass the values of variables and constants defined in your pcell code to a user-defined function. For example, you can pass the values of design rules, such as minSpacing and minWidth. Sl_userFunction String, symbol, or lambda function specifying a user-defined function. A lambda function lets you define a function without using a function name. The purpose of user-defined functions is to calculate new values for pcell parameters. Do not use user- defined functions for other purposes, such as to create shapes. User-defined functions are executed interactively while the pcell is stretched; therefore, a user-defined function cannot depend on pcell arguments. As input to the user-defined function, the system passes a defstruct that is predefined by the ROD software. A defstruct is a named SKILL structure containing a collection of one or more slots for variables. For more information about defstructs, see the defstruct function in the SKILL Language Reference. In this syntax, the defstruct is referred to as r_defstruct. Replace defstruct with your own name, for example, myDefstruct. This destruct contains the following predefined variable slots: t_handleName Text specifying the name of the handle currently being stretched. n_increment An integer or floating-point number specifying the increment or decrement as a result of stretching t_handleName. d_origInstId Database ID of the original instance being stretched. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 160 Product Version 5.0 g_parameters Lets you set the value of a pcell parameter, using the following construct: myDefstruct->parameters->parameter_name = parameter_value where parameter_value must evaluate to the same data type as parameter_name. The g_parameters variable is write-only; it is not preloaded with parameter names and values. After the user-defined function completes, the system looks at g_parameters within the predefined defstruct, and if any parameters were set, the system uses those values as the new parameter values. g_paramVal Current value of the pcell parameter named S_parameter; the value can have any data type. R_rodObj ROD object ID identifying the original object whose handle is being stretched. S_stretchDir String or symbol specifying the stretch direction for the current handle being stretched (t_handleName). d_stretchMaster Interimdatabase ID of the most recent pcell submaster in virtual memory. g_userData Result of the evaluation of the g_userData argument by the system, when user data is specified. The system replaces the value of Sl_parameter with the value returned. If the value for Sl_parameter is also set using the myDefstruct->parameters-> construct, the construct value overrides the value returned by the user-defined function. User-defined functions must return a value with the same data type as S_parameter, and the value assigned by an myDefstruct->parameters-> construct must have the same data type as the parameter. If a value does not have the same data type as its parameter, the system issues a warning Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 161 Product Version 5.0 and assigns zero or a null value to the parameter; the evaluation of the pcell could fail. For more information about the ROD predefined destruct, see “The r_defstruct Structure” on page 168. For more information about user-defined functions, see “User-Defined Functions” on page 165. Default: none Return Values t Handles were successfully assigned to the pcell parameter. nil An error occurred and no handle was assigned. Displaying Parameter Information You can define information to be displayed for a pcell parameter by specifying the S_displayName and S_displayExpression arguments. For S_displayExpression, you can include any pcell parameter in the expression. The systemdisplays the information next to the upper-right corner of the pcell when you select the assigned stretch handle and updates the information as you drag the handle. For example, for a pcell that contains only a rectangle and has one parameter, width, you might want to display the name of the parameter and its new value as you stretch the pcell. Depending on the information you want to display, specify the arguments as follows: I To display displayName = displayName_evaluation_result X Y 0:0 pcell width = 12.5 width Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 162 Product Version 5.0 specify only the S_displayName argument. The system displays its contents as an unevaluated text string on the left and the result of evaluating the S_displayName argument on the right, separated by the string " = ". The following examples show what the system displays when you specify only the S_displayName argument: If no value is specified for S_displayName, nothing is displayed for it. I To display displayExpression_evaluation_result specify only the S_displayExpression argument. You can use any pcell parameter in the expression. The system evaluates the expression and displays the result. For example, if S_displayExpression contains the expression width + 3, and the variable width is currently equal to 5.0, the system displays the following: 8.0 I To display displayName = displayExpression_evaluation_result specify both the S_displayName and S_displayExpression arguments. The systemdisplays the contents of S_displayName as an unevaluated text string on the left and the result of evaluating S_displayExpression on the right, separated by the string " = ". The following examples showwhat the systemdisplays when you specify both display arguments: S_displayName Name Evals To What You See ‘length 10 length = 10 "length * 2" 20 length * 2 = 20 "onOffSwitch" t onOffSwitch = t "M" evaluation fails M = Eval not successful S_display Name S_display Expr displayExpr Evals To What You See "length" "length * 2" 10 length = 10 "length" "width + 3" 16 length = 16 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 163 Product Version 5.0 Examples of Display Information In the following example, the pcell contains only a rectangle, with handles assigned to the three pcell parameters: capacitance, width, and length. The pcell code contains three rodAssignHandleToParameter statements: I One rodAssignHandleToParameter statement assigns the upperRight handle to the capacitance parameter. I A second rodAssignHandleToParameter statement assigns the lowerRight handle to the width parameter. I A third rodAssignHandleToParameter statement assigns the lowerRight handle to the length parameter. In each statement, the information to be displayed is specified as follows: I For the capacitance parameter, S_displayName is cap and S_displayExpression is the expression width*length/capCoeff I For the width parameter, S_displayName is width and S_displayExpression is not specified. I For the length parameter, S_displayName is length and S_displayExpression is not specified. upperRight handle is assigned to capacitance. pcell lowerRight handle is assigned to width and length. width length Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 164 Product Version 5.0 When you select the upperRight handle, you see the following information displayed: When you select the lowerRight handle, you see the following information displayed: For a table showing examples of how to specify the display arguments, see Table 3-2 on page 164. The following table shows the results of specifying one or both of the S_display arguments. Table 3-2 Examples of Specifying the Display Arguments S_displayName S_display Expression Evaluates To What You See ‘length 10 length = 10 "length * 2" 20 length * 2 = 20 "onOffSwitch" t onOffSwitch = t "My Handle" evaluation fails My Handle = Eval not successful "length" 10 10 cap = 15 pcell Area selection box length = 4.0 pcell width = 6.5 Area selection box Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 165 Product Version 5.0 User-Defined Functions When you assign a handle to a parameter, you can define your own function (Sl_userFunction) to calculate the value of the pcell parameter (S_parameter) to which you are assigning the handle. These functions are executed when the pcell is stretched; they cannot depend on pcell parameters. Note: A user-defined function should be used only to calculate a new value for a pcell parameter. Do not use user-defined functions for other purposes, such as creating objects. Information Passed to a User-Defined Function As input to user-defined functions, the ROD software passes a predefined, user-named defstruct (r_defstruct). For a description of the contents of the defstruct, see the Sl_userFunction argument description. Specifying Values for Parameters Using the -> Operator Within a user-defined function, you can use the following construct to set the value for any pcell parameter: myDefstruct->parameters->parameter_name = parameter_value where myDefstruct is your name for the defstruct and parameter_value must be the same data type or evaluate to the same data type as parameter_name. For example, "length * 2" 20 20 "onOffSwitch" t t "myHandle" evaluation fails Eval not successful "length" "length * 2" 20 length = 20 "length" "width + 3" 16 length = 16 "On-Off Switch" "onOffSwitch" t On-Off Switch = t "My Handle" "myHandle" evaluation fails My Handle = Eval not successful Table 3-2 Examples of Specifying the Display Arguments S_displayName S_display Expression Evaluates To What You See Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 166 Product Version 5.0 myDefstruct->parameters->width = 6.0 The system stores all such constructs in the place-holder variable g_parameters within the r_defstruct structure. Note: The g_parameters variable is not preloaded with parameters and their values. What the System Does The systemexecutes the user-defined function, which calculates and returns a new value for S_parameter. After the user-defined function completes, the system looks at the variable g_parameters within the r_defstruct structure and, if values were set for any parameters, uses those values as the new values for the parameters. Note: If you set the value for S_parameter using the myDefstruct->parameters-> construct, the system uses the value assigned by the construct rather than the value returned by the user-defined function. Loading User-Defined Functions When there are user-defined functions specified, the system calls them at each drag increment during the stretch and when you complete the stretch operation. You need to make sure that user-defined functions are loaded into the system before the system needs them. User-defined functions must be loaded prior to dragging a stretch handle belonging to a pcell. The safest way to make sure that user-defined functions are always available when needed is to attach them to your library. Then the system automatically loads them when the library is opened. Follow the steps below to attach a source file for a user-defined function to a library: 1. Place the source file within the library directory. 2. Create a file named libInit.il in the library directory. The system automatically loads the libInit.il file when the library is opened. 3. Within the libInit.il file, write a load statement like this: load( strcat( ddGetObjReadPath( ddGetObj( "libName" )) "/filename.il" ) ; end strcat ) ; end load Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 167 Product Version 5.0 Note: Avoid using graphical SKILL functions such as hiSetBindKey in your libInit.il file; doing so will result in an error. For more information see “What to Avoid in the libInit.il File” in the Virtuoso Parameterized Cell Reference. Lambda Functions Using a lambda function lets you define a function without a name, in the formof a list. This is useful for writing temporary or local functions. The syntax for a lambda function is lambda( (l_formalArguments) g_expr1 ...) => U_result) ) ; end lambda Arguments lambda The first element in the list is the word lambda. It identifies the following arguments as belonging to an unnamed function. l_formalArguments The second element in the list is a list of one or more variable names. g_expr1... The remaining elements in the list are SKILL expressions that are evaluated when the lambda function is called. For example, the following lambda function defines an unnamed function capable of computing the length of the diagonal side of a right-angled triangle: lambda( (x y) (sqrt (x*x + y*y)) When x = 3 and y = 4, the value returned is 5.0. You do not need to precede a lambda function with a single quotation mark. For more information about lambda functions, see “Basic Concepts” in Chapter 3 of the SKILL Language User Guide and “lambda” in Chapter 1 of the SKILL Language Reference. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 168 Product Version 5.0 The r_defstruct Structure r_defstruct is a user-named structure that is predefined by the ROD software to contain a series of slots for specific variables. A defstruct behaves just like a disembodied property list. The system passes the defstruct as input to user-defined functions defined within the rodAssignHandleToParameter function. For more information about defstructs, see defstruct in the SKILL Language Reference. You can access the value of the variables in the r_defstruct structure by using the name you assigned to the defstruct, the structure access operator ( ->) and the name of the variable. For example, to access the value of the variable R_rodObj, type the following: myDefstruct->rodObj Examples The following examples use user-defined functions. Example 1 The following user-defined function adds the value of n_increment to g_paramVal, prints the current values of the myDefstruct variable slots, verifies that the return value is not less than zero, and returns the new value of g_paramVal. procedure( exampleUserFunction(myDefstruct) let(((returnVal myDefstruct->paramVal + myDefstruct->increment)) ;; print all parameter values: printf("myDefstruct->handleName = %s\n", myDefstruct->handleName) printf("myDefstruct->increment = %f\n", myDefstruct->increment) printf("myDefstruct->origInstId = %L\n", myDefstruct->origInstId) printf("myDefstruct->parameter = %s\n", myDefstruct->parameter) printf("myDefstruct->paramVal = %L\n", myDefstruct->paramVal) printf("myDefstruct->rodObj = %L\n", myDefstruct->rodObj) printf("myDefstruct->stretchDir = %s\n", myDefstruct->stretchDir) printf("myDefstruct->stretchMaster = %L\n\n", myDefstruct->stretchMaster) if( (returnVal <= 0.000001) progn(warn("returnVal for parameter %s must be > 0\n" myDefstruct->parameter) returnVal = .1 ) ; end of progn ) ; end if returnVal ) ; end of let ) ; end or procedure The user-defined function produces the following output: myDefstruct->handleName = upperRight myDefstruct->increment = 0.300000 myDefstruct->origInstId = db:67200100 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 169 Product Version 5.0 myDefstruct->parameter = length myDefstruct->paramVal = 1.0 myDefstruct->rodObj = rodObj:66969624 myDefstruct->stretchDir = y myDefstruct->stretchMaster = db:67195948 Example 2 The following example shows how to specify the g_userData argument and the g_parameters element of the r_defstruct structure for user-defined functions. In the example, a capacitor has a fixed capacitance parameter (cap) and variable width and length parameters. As length is stretched, the system automatically adjusts width to maintain the fixed capacitance value; the converse is also true. The figure below shows what the capacitor looks like before and after stretching the leftCenter handle to increase width. The system decreases length to keep the capacitance constant. To make the pcell process independent, design rules such as minSpacing were retrieved from the technology file and passed to the user-defined function with the optional g_userData argument. In the code below, each section does the following: Before stretching After stretching leftCenter handle was stretched. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 170 Product Version 5.0 I Section 1 is the part of the pcell code that gets the technology file ID and uses it to retrieve the technology rules used in the input to the user-defined function in Section 3. I Section 2 is the part of the pcell code that assigns the leftCenter and rightCenter handles to the width parameter. I Section 3 is a user-defined function that is called from within the pcell, but which is not part of the pcell code. The procedure updates length when width is stretched. The g_userData argument passes technology rule values to the user-defined function. As a SKILL pcell author, you can write a process-independent pcell by using design rules from your technology file, such as minSpacing and minEnclosure. The g_userData parameter lets you pass values for constants and variables, such as the values of technology rules, directly to your user-defined function. ;; SECTION 1: Pcell code that gets minimum values from technology file tfId = techGetTechFile( pcCellView ) capCoeff = techGetParam( tfId "capCoeff" ) ;layer1 and layer2 are top and bottom layers for capacitor lay1Ovia = techGetOrderedSpacingRule( tfId "minEnclosure" layer1 "cont") lay2Ovia = techGetOrderedSpacingRule( tfId "minEnclosure" layer2 "cont" ) viaW = techGetSpacingRule( tfId "minWidth""cont" ) grid = techGetMfgGridResolution( tfId ) minCap = techGetParam( tfId "minCap" ) ;; SECTION 2: Pcell code that assigns handles to parameters rodAssignHandleToParameter( ?parameter "width" ?rodObj cnt ?displayName "width" ?handleName list("leftCenter" "rightCenter") ?stretchType "absolute" ?stretchDir "x" ?userData list(list(capCoeff lay1Ovia lay2Ovia viaW grid minCap )) ?userFunction "myfunc" ) ; end rodAssignHandleToParameter ;; SECTION 3:User-defined function called from within pcell. ;; The procedure updates the length when width is changed by ;; the stretch operation. procedure(myfunc(myDefstruct)) let((returnVal mylist capCoeff lay1Ovia lay2Ovia viaW grid minCap) returnVal = myDefstruct->paramVal + myDefstruct->increment mylist = car(myDefstruct->userData) capCoeff = nth(0 mylist) lay1Ovia = nth(1 mylist) lay2Ovia = nth(2 mylist) viaW = nth(3 mylist) grid = nth(4 mylist) minCap = nth(5 mylist) cap = (myDefstruct->stretchMaster)~>parameters~>cap if(lay1Ovia > lay2Ovia then minCapWidth = (2 * lay1Ovia + viaW) else Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 171 Product Version 5.0 minCapWidth = (2 * lay2Ovia + viaW) ) ; end if ;; Calculate the current length length = spcRound((cap/capCoeff/returnVal) grid) when(length < minCapWidth progn(warn("returnVal for parameter %s must be > minCapWidth %L\n" "length" minCapWidth)) length = minCapWidth returnVal = spcRound((cap/capCoeff/length) grid) ) ; end when ;; Reset the length so the capacitance value remains fixed. myDefstruct->parameters->length = length returnVal ) ; end let ) ; end procedure For more information about structures, see “Defstructs” in Chapter 4 of the SKILL Language User Guide and the defstruct function in Chapter 1 of the SKILL Language Reference. Example 3 The following example shows a MOS transistor pcell with stretch handles on the source and drain contact arrays. The MOS transistor pcell calls two user-defined functions. The MOS transistor pcell parameters are specified as follows: Parameter Name Default Value Parameter Description w 1.3 Width of gate l 0.25 Length of gate leftcov 1.0 Left contact coverage Source contact array Drain contact array Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 172 Product Version 5.0 The contact arrays are aligned to the gate. For example, when leftPos equals top, the upperLeft point handle of the gate is aligned to the upperRight point handle of the left contact array, with an offset along both the X and Y axes. The stretch handles are assigned as follows: I To make the source contacts stretchable, the upperCenter and lowerCenter point handles on the source contact array are assigned to the pcell parameter leftcov with the stretch type relative and the stretch direction Y. I To make the drain contacts stretchable, the upperCenter and lowerCenter point handles on the drain contact array are assigned to the pcell parameter rightcov with the stretch type relative and the stretch direction Y. Two user-defined functions control the number of contacts generated and whether they are aligned to the top or bottom of the diffusion: I The user-defined function contcov sets a range for the contacts froma 100%coverage to the minimum contact width for the layer from the technology file. I The user-defined function myStretch identifies the handle currently being stretched. It determines whether the contacts are aligned to the top or bottom of the diffusion. rightcov 1.0 Right contact coverage leftPos "top" Position of left contacts rightPos "top" Position of right contacts Parameter Name Default Value Parameter Description upperCenter point handle for source contacts lowerCenter point handle for source contacts upperCenter point handle for drain contacts lowerCenter point handle for drain contacts Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 173 Product Version 5.0 To look at the code for the pcell and the user-defined functions, see “Stretchable MOS Transistor” on page 329. Example 4: Stretching the Sample MOS Transistor You can stretch the MOS transistor shown in “Example 3” on page 171 in a negative direction towards the Y axis to reduce the number of contacts in the array to one, using the Virtuoso layout editor Stretch command. 1. Choose Edit — Stretch. 2. Select the upperCenter stretch handle on the left contact array using an area-selection box. 3. To specify the reference point, click on the upperCenter stretch handle on the left contact array. Notice that the following information appears to the right of the pcell: leftcov = 1 4. To specify the new location, click above the bottom transistor. Note: If you have trouble selecting the stretch handle, try turning off the Gravity On option on the Layout Editor Options form. Click here. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 174 Product Version 5.0 The MOS transistor pcell instance now looks like this: For a more detailed description of how to stretch pcells, see “Stretching Parameterized Cells” in the Virtuoso Layout Editor User Guide. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 175 Product Version 5.0 rodCreateHandle rodCreateHandle( [?name S_name] ?type S_type ?value g_value ?rodObj R_rodObj ) ; end rodCreateHandle => t | nil Description Creates a user-defined handle for any ROD object (named shape, instance, or cellview); the object must be at level zero in the hierarchy. For example, you can create a handle for polyRect or for instance I1, but not for I1/polyRect. To create a handle for a cellview, you must first get the ROD object ID for the cellview with the rodGetObj function. After you create a handle, you can access it through hierarchy using the rodGetHandle function and the database access operator (~>). The rodGetHandle function automatically transforms (converts) the coordinates of the ROD object into the coordinate system of the top-most cellview. Arguments S_name Character string or symbol specifying a unique name for the new handle. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. Do not use existing user- or system-defined handle names. For example, you can assign the name myPoint, but not centerCenter. If you do not assign a name, then the system assigns a name unique within the cellview, as follows: handle0, handle1, handle2, etc. Valid Values: any character string or symbol except existing user- or system-defined handle names Default: unique name assigned by the system S_type Character string or symbol specifying the type of data stored at the handle. The type can be Boolean, floating point, integer, point, string, or a Cadence SKILL language expression. This Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 176 Product Version 5.0 argument is required. Valid Values: boolean, float, int, point, string, ILExpr Default: none g_value Value assigned to the handle. The value must evaluate to match the data type defined by S_type. When S_type is Boolean, the value must be t or nil. When S_type is string, the value must be either a character string or a symbol. This argument is required. Valid Values: a value that matches the data type specified by S_type; when S_type is Boolean, t or nil. Default: none R_rodObj ROD object ID associated with the object for which you want to create a user-defined handle. This argument is required. Default: none Return Values t Handle created successfully. nil An error occurred and no handle was created. Creating Handles Using rodCreateHandle This section presents you with a series of problems to solve, to help you become familiar with using the rodCreateHandle function. To encourage you to think about or solve the problems yourself, the solutions are not presented until the end of this chapter. I Problem 3-5a Creating a Point Handle for a Cellview on page 177 I Problem 3-5b Querying a Point Handle for a Cellview on page 178 I Problem 3-6 Querying a System-Assigned Handle Name on page 178 You identify the object for which you want to create a handle by using its hierarchical name. To create a handle for a cellview, you must supply the ROD object ID for the cellview. You might want to use information fromyour technology file for the values of some arguments. For example, for the n_width argument, you can use the value of the design rule for minimum width. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 177 Product Version 5.0 You can access design rules in several ways. The problems in this section access design rules by using defaults, and by including techGetTechFile and techGetSpacingRule statements, when needed. For more detailed information about accessing design rules, see “Using Design Rules in ROD Functions” on page 303. For a code example showing how to use rodCreateHandle to compute the resistance of a ROD path, see “Getting the Resistance for a ROD Path” on page 326. Problem 3-5a Creating a Point Handle for a Cellview Create a point handle named originAAA for the origin of layout cellview AAA in the library cellLib. Solution 3-5a Creating a Point Handle for a Cellview on page 287. polyRect 2:2 X Y X 0:0 X Lower left corner of polyRect is at 2:2. cellview AAA Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 178 Product Version 5.0 Problem 3-5b Querying a Point Handle for a Cellview Find the value of the point handle named originAAA, which is the origin of layout cellview AAA. Instance IA1 of cellview AAA is within cellview BBB, offset from the origin of cellview BBB by 3 units in the direction of the X and Y axes. Solution 3-5b Querying a Point Handle for a Cellview on page 288. Problem 3-6 Querying a System-Assigned Handle Name When you create a handle without specifying a name, the system assigns a name. For the layout cellview myCell in the library cellLib, find the system-assigned name for the last handle you created without a name. Solution 3-6 Querying a System-Assigned Handle Name on page 288. polyRect cellview BBB IA1 of AAA 5:5 X 0:0 Y X 3:3 X Lower left corner of IA1 is at 3:3, and lower left corner of polyRect is at 5:5. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 179 Product Version 5.0 rodCreatePath rodCreatePath( [?name S_name] ?layer txl_layer [?width n_width] [?pts l_pts] [?justification S_justification] [?offset n_offset] [?endType S_endType] [?beginExt n_beginExt] [?endExt n_endExt] [?choppable g_choppable] [?cvId d_cvId] [?fromObj Rl_fromObj] [?size txf_size] [?startHandle l_startHandle] [?endHandle l_endHandle] [?prop l_prop] [ROD Connectivity Arguments] [?offsetSubPath l_offsetSubpathArgs...] [?encSubPath l_encSubpathArgs...] [?subRect l_subrectArgs...] ) ; end rodCreatePath => R_rodObj | nil ; ROD Connectivity Arguments [?netName S_netName] [?termName S_termName] [?termIOType S_termIOType] [?pin g_pin] [?pinAccessDir tl_pinAccessDir] [?pinLabel g_pinLabel] [?pinLabelHeight n_pinLabelHeight] [?pinLabelLayer txl_pinLabelLayer] [?pinLabelFont S_pinLabelFont] [?pinLabelDrafting g_pinLabelDrafting] [?pinLabelOrient S_pinLabelOrient] [?pinLabelOffsetPoint l_pinLabelOffsetPoint] [?pinLabelJust S_pinLabelJust] [?pinLabelRefHandle S_pinLabelRefHandle] ; end of ROD Connectivity Arguments ;l_offsetSubpathArgs Offset Subpath Arguments list( list( ?layer txl_layer [?width n_width] [?sep n_sep] [?justification S_justification] [?beginOffset n_beginOffset] [?endOffset n_endOffset] [?choppable g_choppable] [?prop l_prop] ;Repeat ROD Connectivity Arguments here ) ;End of first offset subpath list ... ) ;End of offset subpath lists Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 180 Product Version 5.0 ;End of l_offsetSubpathArgs ;l_encSubpathArgs Enclosure Subpath Arguments list( list( ?layer txl_layer [?enclosure n_enclosure] [?beginOffset n_beginOffset] [?endOffset n_endOffset] [?choppable g_choppable] [?prop l_prop] ;Repeat ROD Connectivity Arguments here ) ;End of first enclosure subpath list ... ) ;End of enclosure subpath lists ;End of l_encSubpathArgs ;l_subrectArgs Subrectangle Arguments list( list( ?layer txl_layer [?width n_width] [?length n_length] [?gap S_gap] [?sep n_sep] [?justification S_justification] [?beginOffset n_beginOffset] [?endOffset n_endOffset] [?space n_space] [?choppable g_choppable] [?prop l_prop] ;Repeat ROD Connectivity Arguments here ) ;End of first subrectangle list ... ) ;End of subrectangle lists ;End of l_subrectArgs Description Creates a path consisting of one or more parts at level zero in the hierarchy on the same or on different layers froma list of points or fromone or more existing objects. A path consisting of multiple parts is called a multipart path. You can use the rodCreatePath function to create one-part paths, simple multipart paths, or complex multipart paths such as guard rings, transistors, buses, and shielded paths. You can assign one or more property names and values to a multipart path. A multipart path consists of a single master path and one or more subparts. The master path is an ordinary path; however, it is the defining part of a multipart path; all subparts are based on the master path. You can assign a property name and value, or a list of property names and values, to the master path and/or to each subpart. The subparts can be any or all of the following: offset subpaths, enclosure subpaths, and sets of subrectangles. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 181 Product Version 5.0 You can create any number of subparts. All subparts exist in relation to and depend on the master path. A subrectangle in a set of subrectangles is not an individual shape; it is part of that specific set of subrectangles. Subrectangles are created on grid. For a detailed overview of multipart paths, see “Multipart Paths” on page 59. You can also create MPPs and save them as templates in your technology file by using the graphical user interface or by editing the ASCII version of your technology file. For information about using the graphical user interface, see “Creating and Editing Multipart Paths” in the Virtuoso Layout Editor User Guide. For information about editing your technology file, see “xlMPPTemplates” in the Technology File and Display Resource File ASCII Syntax Reference Manual. The following topics are discussed in this section, following the argument descriptions: I Creating Self-Intersecting Paths on page 200 I Specifying Arguments as nil on page 200 I Formatting List-of-Lists Arguments for Subparts on page 201 I How the System Creates Subrectangles on page 202 I Disconnecting Shapes in a Multipart Path on page 204 Arguments Master Path Arguments S_name Character string or symbol specifying the name for the master path. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. The name must be unique for the cellview. If you do not specify a name, the system assigns a unique name, consisting of the prefix path, followed by a number. For example, for the first master path in a cellview for which you do not specify a name, the system assigns the name path0, if unique; for the second, path1, and so on. Default: pathn txl_layer Text string, integer, or list specifying the layer or layer-purpose pair for the master path, such as Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 182 Product Version 5.0 ?layer "metal1" ?layer 45 ?layer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. For lists, use the following format: list( layer purpose ) Examples of layer-purpose pairs: ?layer list("metal1" "drawing") ?layer list(45 252) ?layer list(45 "drawing") ?layer list("metal1" 252) You are required to specify a layer. Default Purpose: drawing n_width Positive integer or floating-point number specifying the width of the master path. If you do not specify the width, the systemuses the minWidth rule for the master path layer fromthe technology file. If the minWidth rule is not defined in the technology file, the rodCreatePath function reports an error. Default: the minWidth rule for the master path layer from the technology file l_pts List of points defining the centerline of the master path. Specify a point for the start and end of the first segment, and specify a point for the end of subsequent segments. You must specify at least two noncoincident points. You cannot create self- intersecting master paths. You are required to specify a list of points. The systemdiscards duplicate and collinear points before creating the path but does not consider them an error. Use one of the following formats: list( x:y x:y ... ) or list( list(x y) list(x y) ... ) You must specify either l_pts or Rl_fromObj. If you specify both, the system ignores the l_pts argument. Default: none Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 183 Product Version 5.0 S_justification Character string or symbol specifying the part of the master path to offset from the point list: centerline, left edge, or right edge. Justification is relative to the direction of the path. Valid Values: center, left, right Default: center n_offset Signed integer or floating-point number specifying the distance by which the master path edge or centerline, depending on S_justification, is offset from the point list specified by the l_pts argument. A positive value creates the master path to the left of the point list; a negative value creates the master path to the right of the point list. For a detailed description about offsetting the master path, see “Master Paths” on page 60. Default: 0 S_endType Character string or symbol specifying the type of ends of the master path. Valid Values: flush, offset, octagon, variable Default: flush n_beginExt Zero or positive integer or floating-point number specifying the distance by which the starting end of the master path extends beyond or retracts from its first point. This argument is ignored unless S_endType is set to variable. Default: 0 n_endExt Zero or positive integer or floating-point number specifying the distance by which the ending end of the master path extends beyond or retracts from its last point. This argument is ignored unless S_endType is set to variable. Default: 0 g_choppable Boolean value indicating whether or not a ROD path can be chopped. The value must be t or nil. When a path has subparts and the master path is choppable, all subpaths and sets of subrectangles must be choppable also. When a path has subparts and the master path is not choppable, each subpath and/or set of subrectangles can be choppable or not. Default: t d_cvId Database ID for the cellview in which you are creating a ROD path. If rodCreatePath occurs in the body of a pcDefinePCell function or tcCreateDeviceClass Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 184 Product Version 5.0 function call, the default value is pcCellView or tcCellView, respectively; otherwise, this argument is required. Default: none Rl_fromObj ROD object ID or list of ROD object IDs identifying a named object or list of named objects that you want to use as a source for creating a new ROD path. The source objects can be instances, rectangles, polygons, paths, lines, dots, labels, and/or text-display objects. You must specify either the Rl_fromObj argument or the l_pts argument. If you specify both, the system ignores the l_pts argument. Default: none txf_size A signed integer, floating-point number, or Cadence SKILL language expression specifying the distance between a bounding box around the source object (Rl_fromObj) and the centerline of the generated master path. When the source is more than one object, txf_size specifies the distance between a bounding box around all of the objects and the centerline of the master path. By default, the generated path has four segments and forms a ring. A positive number creates a path that is longer than the circumference of the bounding box; a negative number creates a path that is shorter than the circumference of the bounding box. When you specify a SKILL expression, it must evaluate to a positive or negative integer or floating-point number. SKILL expressions are evaluated only when the new path is created. If you specify a source object (Rl_fromObj) but do not specify txf_size, then txf_size defaults to 0.0. If you specify txf_size, you must also specify Rl_fromObj, or the system reports an error. Default: 0.0 l_origin Single point or list of coordinates specifying the starting point for the generated path, in one of the following formats: x:y or list(x y) Default: 0:0 S_startHandle Character string or symbol specifying the starting point for the Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 185 Product Version 5.0 generated path, such as startn, where n is the segment number. Valid Values: startn, midn, endn, startLast, midLast, endLast Default: start0 S_endHandle Character string or symbol specifying the ending point for the generated path, such as startn, where n is the segment number. Valid Values: startn, midn, endn, startLast, midLast, endLast Default: start0 l_prop A list or lists of lists, where each list contains the name of a property and its value. When the property name is a string, enclose it in quotes. For a description of the valid data types, see the “About the Add Property Form” in the Virtuoso Layout Editor User Guide. For Boolean properties, the value must be t or nil. For example, you would specify a single Boolean property as follows: ?prop list("myProp" t) and a list of properties as follows: ?prop list( list("myProp1" propValue1) list("myProp2" propValue2) ... list("myPropN" propValueN) ) For a more detailed description about specifying lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Default: nil l_offsetSubpath A list containing one or more lists, each of which specifies the arguments for one offset subpath. The subpath is created in relationship to the master path. For information about how to specify lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 186 Product Version 5.0 l_encSubPath A list containing one or more lists, each of which specifies the arguments for one enclosure subpath. The enclosure subpath is created in relationship to the centerline of the master path. For information about how to specify lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. l_subRect A list containing one or more lists, each of which specifies the arguments for one set of unnamed subrectangles. The set of subrectangles is created in relationship to the centerline of the master path. For information about how to specify lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Return Values R_rodObj The RODobject IDfor the single layer or multipart RODpath that was created. nil No path was created due to an error. ROD Connectivity Arguments S_netName Character string or symbol specifying the name of the net with which you want to associate the shape. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. If the net does not exist, the system creates it, using the name specified by S_netName. To associate the shape with a net, this argument is required. If you do not want to specify this argument, omit it or specify its value as nil. Default: nil S_termName Character string or symbol specifying the name of the terminal and net with which you want to associate the shape. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. If the terminal and/or net does not exist, the system creates it, using the name specified by S_termName. If you specify both S_termName and S_netName, their values must be the same. If a terminal with the specified name already Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 187 Product Version 5.0 exists, the net it belongs to must have the same name. If the net name does not match the terminal name, the function reports an error. To associate the shape with a terminal and net, this argument is required. If you do not want to specify this argument, omit it or specify its value as nil. Default: nil S_termIOType Character string or symbol specifying the direction type (I/O type) for the terminal. If S_termName is not specified, the S_termIOType argument is ignored. If a terminal with the name specified by S_termName already exists, it must have the same direction type as specified by S_termIOType; if the direction type is not the same, the function reports an error. Valid Values: input, output, inputOutput, switch, jumper Default: inputOutput g_pin Boolean value indicating whether or not to make the shape into a pin. The value must be t or nil. When you specify g_pin, you must also specify a value other than nil for S_netName and/or S_termName; if you do not, all connectivity arguments are ignored but no error is reported. If you do not want to specify this argument, omit it or specify its value as nil. When the value is nil, the shape created is not a pin and all other arguments containing the word pin are ignored. Valid Values: t, nil Default: nil tl_pinAccessDir Text string or list specifying the access direction(s) for the pin. Enclose string values in quotation marks. Do not use a symbol. An example of a list is list( "top" "bottom" ) Valid Values: top, bottom, left, right, any, none, or a list containing any of these values Default: any g_pinLabel Boolean value indicating whether or not to add a text display object for the pin, where the text is the contents of the S_termName argument. The value must be t or nil. When the value is t, the system creates a text display object as a ROD object and aligns it to the pin using the values you specify for the other pin label arguments. When the value is nil, no label is created and all other arguments containing the characters Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 188 Product Version 5.0 pinLabel are ignored. Valid Values: t, nil Default: nil n_pinLabelHeight Positive integer or floating-point number specifying the vertical height of the pin text-display label in user units. Default: 1 txl_pinLabelLayer Text string, integer, or list specifying the layer or layer-purpose pair for the pin text-display label, such as ?pinLabelLayer "metal1" ?pinLabelLayer 45 ?pinLabelLayer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. For lists, use the following format: list(layer purpose) Examples of layer-purpose pairs: ?pinLabelLayer list("metal1" "drawing") ?pinLabelLayer list(45 252) ?pinLabelLayer list(45 "drawing") ?pinLabelLayer list("metal1" 252) When you specify only the layer, the purpose defaults to the purpose defined by l_layer. When you specify neither layer nor purpose, both layer and purpose default to the values defined by l_layer. Default: layer specified by l_layer; purpose specified by l_layer S_pinLabelFont Character string or symbol specifying the name of the font for the pin text-display label. Valid Values: euroStyle, gothic, math, roman, script, stick, swedish Default: stick g_pinLabelDrafting Boolean value indicating whether or not to allow rotation of the pin text-display label by more than 90 degrees. The value must be t or nil. You can set or change label rotation with the S_pinLabelOrient argument or in the layout editor. When the value is t, the label can rotate less than or equal to 90 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 189 Product Version 5.0 degrees. When the value is nil, the label can rotate more than 90 degrees. Valid Values: t, nil Default: t S_pinLabelOrient Character string or symbol specifying the orientation of the pin text-display label. Valid Values: Default: R0 l_pinLabelOffsetPoint Lists one set of coordinates specifying the X and Y offset of the origin of the pin text-display label from a point handle on the shape. The label origin is specified by S_pinLabelJust, and the shape point handle is specified by S_pinLabelRefHandle. For example, to create a label for the path path1, offset fromthe endLeftLast point handle by 2 units in the direction of the X 0 R0 90 R90 180 R180 270 R270 MY sideways MYR90 sideways & 90 MX upsideDown MXR90 sideways & 270 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 190 Product Version 5.0 axis and 0 units in the direction of the Y axis, specify 2:0. Use one of the following formats: x:y or list(x y) or any expression that evaluates to a list of two numbers. Default: 0:0 S_pinLabelJust Character string or symbol specifying the origin point for the text- display label. Valid Values: upperLeft or uL lowerLeft or lL upperCenter or uC lowerCenter or lC upperRight or uR lowerRight or lR centerLeft or cL centerCenter or cC centerRight or cR Default: centerCenter S_pinLabelRefHandle Character string or symbol specifying the point handle on the shape from which you want to offset the origin point of the text- display label. You can specify the name of any bounding box or segment point handle. For a detailed description of system- X S_pinLabelRefHandle equals endLeftLast Direction of path InOut0 l_pinLabelOffsetPoint equals 2:0 X S_pinLabelJust equals centerLeft Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 191 Product Version 5.0 defined point handles, see “System-Defined Handles” on page 19. Valid Values for bounding box point handles: upperLeft or uL lowerLeft or lL upperCenter or uC lowerCenter or lC upperRight or uR lowerRight or lR centerLeft or cL centerCenter or cC centerRight or cR Valid Values for segment point handles for all ROD shapes: start0 mid0 end0 startLast midLast endLast startn midn endn Valid Values for segment point handles for ROD paths: start0 mid0 end0 startLast midLast endLast startn midn endn startLeft0 midLeft0 endLeft0 startLeftLast midLeftLast endLeftLast startLeftn midLeftn endLeftn startRight0 midRight0 endRight0 startRightLast midRightLast endRightLast startRightn midRightn endRightn Default: the bounding box point handle centerCenter Offset Subpath Arguments (l_offsetSubpathArgs) For a detailed description of offset subpaths, see “Offset Subpaths” on page 63. txl_layer Text string, integer, or list specifying the layer or layer-purpose pair for the subpath, such as ?layer "metal1" ?layer 45 ?layer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. Use the one of the formats defined for the master path argument txl_layer. You are required to specify a layer. Default Purpose: drawing Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 192 Product Version 5.0 n_width Positive integer or floating-point number specifying the width of the offset subpath. If you do not specify the width, the system uses the minWidth rule for the offset subpath layer from the technology file. If the minWidth rule is not defined in the technology file, rodCreatePath reports an error. Default: minWidth for the offset subpath layer from the technology file n_sep Signed integer or floating-point number specifying the separation between the centerline or an edge of the subpath and the centerline or an edge of the master path, depending on the value of S_justification. Default: 0 S_justification Character string or symbol specifying from which part of the master path to separate the subpath, in relation to the direction of the master path. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. When left, the right edge of the subpath is separated fromthe left edge of the master path. When right, the left edge of the subpath is separated from the right edge of the master path. When center, the centerline of the subpath is separated from the centerline of the master path. Valid Values: center, left, right Default: center n_beginOffset Signed integer or floating-point number specifying the starting edge of the subpath in relation to the starting edge of the master path. A positive number extends the end of the subpath beyond the end of the master path; a negative number retracts the end of the subpath from the end of the master path. Default: n_endOffset if specified; otherwise 0 n_endOffset Signed integer or floating-point number specifying the ending edge of the subpath in relation to the ending edge of the master path. A positive number extends the end of the subpath beyond the end of the master path; a negative number retracts the end of the subpath from the end of the master path. Default: n_beginOffset if specified; otherwise 0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 193 Product Version 5.0 g_choppable Boolean value indicating whether or not the subpath can be chopped. The value must be t or nil. When the master path is choppable, all subpaths must be choppable. When the master path is not choppable, each subpath can be choppable or not. Default: t l_prop A list or lists of lists, where each list contains the name of a property and its value. When the property name is a string, enclose it in quotes. For a description of the valid data types, see the “About the Add Property Form” in the Virtuoso Layout Editor User Guide. For Boolean properties, the value must be t or nil. For example, you would specify a single Boolean property as follows: ?prop list("myProp" t) and a list of properties as follows: ?prop list( list("myProp1" propValue1) list("myProp2" propValue2) ... list("myPropN" propValueN) ) For a more detailed description about specifying lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Default: nil Enclosure Subpath Arguments (l_encSubpathArgs) For a detailed description of enclosure subpaths, see “Enclosure Subpaths” on page 71. txl_layer Text string, integer, or list specifying the layer or layer-purpose pair for the subpath, such as ?layer "metal1" ?layer 45 ?layer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. Use the one of the formats defined for the master path argument Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 194 Product Version 5.0 txl_layer. You are required to specify a layer. Default Purpose: drawing n_enclosure Signed integer or floating-point number specifying the enclosure of the subpath in relation to the master path. The system computes the width of an enclosure subpath as follows: width = (n_width of master path) - (2 * n_enclosure) If you do not specify this argument, the system uses the minEnclosure rule from the technology file for master path layer to subpath layer; if the minEnclosure rule is not defined in the technology file, rodCreatePath reports an error. Default: minEnclosure rule fromthe technology file for master path layer to subpath layer n_beginOffset Signed integer or floating-point number specifying the starting edge of the subpath in relation to the starting edge of the master path. A positive number extends the end of the subpath beyond the end of the master path; a negative number retracts the end of the subpath from the end of the master path. Default: n_endOffset if specified; otherwise the negative of n_enclosure n_endOffset Signed integer or floating-point number specifying the ending edge of the subpath in relation to the ending edge of the master path. A positive number extends the end of the subpath beyond the end of the master path; a negative number retracts the end of the subpath from the end of the master path. Default: n_beginOffset if specified; otherwise the negative of n_enclosure g_choppable Boolean value indicating whether or not the subpath can be chopped. The value must be t or nil. When the master path is choppable, all subpaths must be choppable. When the master path is not choppable, each subpath can be choppable or not. Default: t l_prop A list or lists of lists, where each list contains the name of a property and its value. When the property name is a string, enclose it in quotes. For a description of the valid data types, see Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 195 Product Version 5.0 the “About the Add Property Form” in the Virtuoso Layout Editor User Guide. For Boolean properties, the value must be t or nil. For example, you would specify a single Boolean property as follows: ?prop list("myProp" t) and a list of properties as follows: ?prop list( list("myProp1" propValue1) list("myProp2" propValue2) ... list("myPropN" propValueN) ) For a more detailed description about specifying lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Default: nil Subrectangle Arguments (l_subrectArgs) For a detailed description of sets of subrectangles for rodCreatePath, see “Sets of Subrectangles” on page 73. txl_layer Text string, integer, or list specifying the layer or layer-purpose pair for the subrectangle(s), such as ?layer "metal1" ?layer 45 ?layer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. Use the one of the formats defined for the master path argument txl_layer. You are required to specify a layer. Default Purpose: drawing Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 196 Product Version 5.0 n_width Positive integer or floating-point number specifying the width of the rectangle(s), where the width is parallel to the width of the master path. If not specified, the system uses n_length; if neither is specified, the system uses the minWidth rule for the subrectangle layer fromthe technology file. If the minWidth rule is not defined in the technology file, rodCreatePath returns nil to indicate an error. Default: n_length if specified; otherwise minWidth for the subrectangle layer from the technology file n_length Positive integer or floating-point number specifying the length of the subrectangle(s), where the length is parallel to the master path centerline. If not specified, the system uses n_width; if neither is specified, the system uses the minWidth rule for the Width of master path Width of subrectangles Length of subrectangles Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 197 Product Version 5.0 subrectangle layer fromthe technology file. If the minWidth rule is not defined in the technology file, rodCreatePath returns nil to indicate an error. Default: n_width if specified; otherwise, minWidth for the subrectangle layer from the technology file S_gap Character string or symbol specifying the method the system uses to place subrectangles within each segment. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. The system always uses the value of n_space for minimum space between subrectangles and calculates the maximum number of rectangles that fit in the segment, allowing for the space needed by n_beginOffset and n_endOffset. When the value of S_gap is distribute, the system distributes the space around subrectangles as evenly as possible, in multiples of the grid space specified by mfgGridResolution. Any remaining space is left after the last subrectangle in the segment. Note: When the value of S_gap is distribute and there is only one subrectangle, the system centers the subrectangle in the segment. When the value of S_gap is minimum, the system places subrectangles n_space apart until there is no space for another Excess space is distributed evenly around subrectangles. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 198 Product Version 5.0 rectangle, then leaves the excess space after the last subrectangle in the segment. Valid Values: distribute, minimum Default: distribute n_sep Signed integer or floating-point number specifying the separation between the centerline or an edge of the subrectangles and the centerline or an edge of the master path, depending on the value of S_justification. The system places subrectangles on grid, as close to the specified separation as possible. Default: 0 S_justification Character string or symbol specifying from which part of the master path to separate the subrectangles, in relation to the direction of the master path. When left, the right edge of the subrectangles is separated fromthe left edge of the master path. When right, the left edge of the subrectangles is separated from the right edge of the master path. When center, the centerline of the subrectangles is separated from the centerline of the master path. Valid Values: center, left, right Default: center n_beginOffset Signed integer or floating-point number specifying the offset of the edge of the first subrectangle from the starting edge of the master path. A positive number extends the beginning of the subrectangles beyond the beginning of the master path; a negative number retracts the beginning of the subrectangles Excess space is left at end of segment. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 199 Product Version 5.0 from the beginning of the master path. Default: n_endOffset if specified; otherwise 0 n_endOffset Signed integer or floating-point number specifying the offset of the edge of the last subrectangle from the ending edge of the master path. A positive number extends the end of the subrectangles beyond the end of the master path; a negative number retracts the end of the subrectangles fromthe end of the master path. Default: n_beginOffset if specified; otherwise 0 n_space Positive integer or floating-point number specifying the distance between the edges of adjoining rectangles. If not specified, the system uses the minSpacing rule for the subrectangle layer fromthe technology file. If the minSpacing rule is not defined in the technology file, rodCreatePath returns nil to indicate an error. Default: minSpacing for the subrectangle layer from the technology file g_choppable Boolean value indicating whether or not the subrectangle(s) can be chopped. The value must be t or nil. When the master path is choppable, all subrectangles must be choppable. When the master path is not choppable, each set of subrectangles can be choppable or not. Default: t l_prop A list or lists of lists, where each list contains the name of a property and its value. When the property name is a string, enclose it in quotes. For a description of the valid data types, see the “About the Add Property Form” in the Virtuoso Layout Editor User Guide. For Boolean properties, the value must be t or nil. For example, you would specify a single Boolean property as follows: ?prop list("myProp" t) and a list of properties as follows: ?prop list( list("myProp1" propValue1) list("myProp2" propValue2) ... Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 200 Product Version 5.0 list("myPropN" propValueN) ) For a more detailed description about specifying lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Default: nil Creating Self-Intersecting Paths You cannot create self-intersecting paths using rodCreatePath. If you specify the function arguments so that the master path and/or one or more subpaths would self-intersect, the system will not create the path. For example, if you create a guard ring with abutted ends, and the ends of a subpath have a positive offset, the subpath will extend beyond the master path, which could cause intersection. If your code tries to create a self-intersecting path, the path is not created, and the system displays a warning in the CIW. Specifying Arguments as nil For the rodCreatePath function, a value of nil means the following, depending on the type of argument: I For Boolean arguments, nil is a valid value, and the system uses it as such. The rodCreatePath Boolean arguments are: g_choppable g_pin g_pinLabel g_pinLabelDrafting I For non-Boolean arguments, specifying nil causes the system to use the default as it is defined in this document for that argument. Specifying nil is equivalent to not specifying a value for the argument. I For the following Connectivity arguments, the default value is nil: S_netName S_termName g_pin When you specify any of the arguments listed above as nil, it is equivalent to not specifying a value for the argument. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 201 Product Version 5.0 Specifying Pins When you specify the g_pin argument, you must also specify the S_netName and/or S_termName argument with a value other than nil. If you specify g_pin but do not specify S_netName and/or S_termName with a value other than nil, the system ignores all connectivity arguments but does not report an error. Formatting List-of-Lists Arguments for Subparts You must use a list of lists to specify arguments for an offset subpath, enclosure subpath, or set of subrectangles. The top-level list contains one or more sublists. Each sublist defines a unique subpath or set of subrectangles. Each sublist consists of one or more keyword-value pairs, where the keyword identifies the argument. To specify the value as a character string, enclose it in quotation marks (""); to specify the value as a symbol, precede it with a single quotation mark ('). For any keyword that returns either a string or symbol, you can specify a Cadence ® SKILL language expression (constant, variable, or function call) as the value. As an example, the syntax format for specifying an enclosure subpath as part of a rodCreatePath function is shown on the following page. ?encSubPath list( list( ?layer txl_layer ?enclosure n_enclosure ?beginOffset n_beginOffset ?endOffset n_endOffset ?choppable g_choppable ) ;End of first enclosure subpath list( ?layer txl_layer ?enclosure n_enclosure ?beginOffset n_beginOffset ?endOffset n_endOffset ?choppable g_choppable );End of second enclosure subpath . . . ) ;End of encSubPath list An example showing values for an enclosure subpath within a rodCreatePath function specification might look like this: poly1EndOffset = -0.4 tfId = = techGetTechFile( pcCellView ) ?encSubPath list( list( ?layer "metal2" ?enclosure techGetParam( tfId "m1m2enc" ) ?beginOffset -.4 ?choppable nil Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 202 Product Version 5.0 ) ; end of 1st enclosure subpath list( ?layer "poly1" ?enclosure .1 ?beginOffset 0 ?endOffset poly1EndOffset ?choppable nil ) ; end 2nd enclosure subpath ) ; end of 2nd enclosure subpath where poly1EndOffset is a variable and techGetParam( tfId "m1m2enc" ) is a function call. How the System Creates Subrectangles The system follows these steps to create subrectangles: 1. Creates all subrectangles on the specified layer, with the subrectangle centerline separated from the master path centerline by n_sep. When n_sep is zero, the master path centerline bisects the width of the subrectangles. When n_sep is less than or greater than zero, the subrectangles are offset from the master path centerline. 2. For the first path segment, offsets the edge of the first subrectangle from the starting edge of the master path by the distance specified in n_beginOffset. ?sep = 1.8 ?sep = 0.0 n_beginOffset = 2.0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 203 Product Version 5.0 3. Uses the value of n_space to compute the maximum number of subrectangles that fit on grid in the segment, and the value of S_gap to determine what to do with excess space, as follows: ❑ When S_gap equals distribute (the default), distributes the space as evenly as possible, in multiples of the grid space specified by mfgGridResolution. ❑ When S_gap equals minimum, places subrectangles n_space apart until there is no space for another rectangle, then leaves the excess space after the last subrectangle in the segment. 4. For each subsequent path segment, the system Excess space is distributed evenly around subrectangles. Excess space is left at end of segment. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 204 Product Version 5.0 ❑ Positions the first subrectangle on the vertex of the subrectangle centerline with half its width towards the beginning of the segment. ❑ Repeats step 3. 5. For the last path segment, the system offsets the edge of the last subrectangle from the ending edge of the master path by the distance specified in n_endOffset. For the remaining subrectangles in the last segment, the system repeats step 3. Disconnecting Shapes in a Multipart Path You can change a multipart path into separate, unrelated shapes by removing the name of the multipart path. Once you do this, all relationships between the shapes are removed. ➤ To change all of the shapes in a multipart path into separate, unrelated shapes, remove the name of the multipart path using the rodUnNameShape function. Now the master path is a separate, unnamed path; each subpath is a separate, unnamed path; and each rectangle is a separate, unnamed shape. None of themis a ROD object, and there is no relationship between them. ?sep = 1.8 Subrectangle vertex Width of subrectangles One-half width n_endOffset = 1.0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 205 Product Version 5.0 Making a Former MPP Part into a ROD Object You can make any shape that was formerly part of a multipart path (the master path, any subpath, or any individual subrectangle) into a ROD object by assigning it a unique name. ➤ To make a shape into a ROD object, assign a unique name to the shape using the rodNameShape function. Each shape to which you assign a name is now a separate, unique ROD object. Creating Paths with rodCreatePath To help you become familiar with using the rodCreatePath function, this section presents a problem to solve. To encourage you to think about and solve the problem yourself, the solution is not presented until the end of this chapter. I Problem 3-7 Create a Master Path with an Offset Subpath to the Right on page 205 For additional code examples, including computing the resistance for a ROD path, see “Code Examples” on page 315. Problem 3-7 Create a Master Path with an Offset Subpath to the Right When you create an offset subpath, you determine its location by specifying its separation from the master path (n_sep) and its justification (S_justification). Assume that you are in a pcell. Create a three-segment master path on the nwell layer as shown in the following illustration, with the width equal to 0.6, end type flush, and the centerline on the following points: 2:2, 8:2, 8:6, 10:6. Make the master path choppable and name it p1. In the same statement, create an offset subpath 1.0 units to the right of the master path on the metal2 layer, with a width of 0.8. Let the offset of the subpath ends default to zero. You can also let the cellview ID (d_cvId) default to the pcell variable pcCellView, because your statement is executed inside a pcell. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 206 Product Version 5.0 The master path and offset subpath look something like this: Solution 3-7 Create a Multipart Path with an Offset Subpath on the Right on page 288 Direction of master path X Y 0:0 Offset subpath Master path Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 207 Product Version 5.0 rodCreatePolygon rodCreatePolygon( [?name S_name] ?layer txl_layer [?pts l_pts] [?cvId d_cvId] [?fromObj Rl_fromObj] [?size txf_size] [?prop l_prop] ; ROD Connectivity Arguments for Polygons [?netName S_netName] [?termName S_termName] [?termIOType S_termIOType] [?pin g_pin] [?pinAccessDir tl_pinAccessDir] [?pinLabel g_pinLabel] [?pinLabelHeight n_pinLabelHeight] [?pinLabelLayer txl_pinLabelLayer] [?pinLabelFont S_pinLabelFont] [?pinLabelDrafting g_pinLabelDrafting] [?pinLabelOrient S_pinLabelOrient] [?pinLabelOffsetPoint l_pinLabelOffsetPoint] [?pinLabelJust S_pinLabelJust] [?pinLabelRefHandle S_pinLabelRefHandle] ) ; end rodCreatePolygon => R_rodObj | nil Description Creates one polygon from a list of points or from one or more named objects. Also creates a ROD object containing information associated with the polygon, including its name and database ID. The associated ROD object is identified by a ROD object ID. The polygon is created at level zero in the hierarchy. You can assign a property name and value, or a list of property names and values, to the polygon. You can specify connectivity for the polygon by associating it with a specific terminal and net. You can also make the polygon into a pin. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 208 Product Version 5.0 When you specify two or more existing named objects as the source for creating a polygon, as shown in the example below, the system creates a four-sided, rectangular polygon based on a bounding box around all of the object(s). The new rectangular polygon is larger or smaller than the bounding box, depending on whether you specify a positive or negative size. Note: In the current release, no relationship exists between a generated polygon and its source object(s) after the new polygon is created. Source named objects X Y 0:0 Generated ROD polygon txf_size is positive. X Y 0:0 Generated ROD polygon X Y 0:0 txf_size is negative. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 209 Product Version 5.0 For a detailed overviewof creating polygons fromother objects, see “Creating a Polygon from Another Object” on page 95. Arguments S_name Character string or symbol specifying the name for the polygon. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark (‘). ROD converts symbols to character strings. The name must be unique for the cellview. When you do not specify a name, the system assigns a unique name, consisting of the prefix polygon, followed by a number. For example, for the first unnamed polygon in a cellview, the system assigns the name polygon0, if unique; for the second, polygon1, and so on. Default: polygonn txl_layer Text string, integer, or list specifying the layer or layer-purpose pair for the polygon, such as ?layer "metal1" ?layer 45 ?layer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. For lists, use the following format: list( layer purpose ) Examples of layer-purpose pairs: ?layer list("metal1" "drawing") ?layer list(45 252) ?layer list(45 "drawing") ?layer list("metal1" 252) You are required to specify a layer. Default Purpose: drawing l_pts List of points defining the edges of the polygon. Specify a point for the beginning and end of the first edge and the end of subsequent edges. The system creates a closed shape by connecting the first and last points in the list. You cannot create a polygon with self-intersecting edges. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 210 Product Version 5.0 The systemdiscards duplicate points and excess collinear points without considering them errors. However, you must specify at least three noncoincident, noncollinear points. Coincident points have the same coordinate values. Collinear points are on the same line. If you specify more than two points on the same line, the system uses only the first and last points specified. An example of excess collinear points is 0:10, 0:20, and 0:30, where the system discards 0:20. Use one of the following formats: list( x:y x:y ... ) or list( list(x y) list(x y) ... ) You must specify either l_pts or Rl_fromObj. If you specify both, the system ignores the l_pts argument. Default: none d_cvId Database ID for the cellview in which you are creating a ROD polygon. If the rodCreatePolygon statement occurs in the body of a pcDefinePCell function or tcCreateDeviceClass function call, the default value is pcCellView or tcCellView, respectively; otherwise, this argument is required. Default: none Rl_fromObj ROD object ID or list of ROD object IDs identifying a named object or list of named objects that you want to use as a source for creating a new ROD polygon. The source objects can be instances, rectangles, polygons, paths, lines, dots, labels, and/or text-display objects. You must specify either the Rl_fromObj argument or the l_pts argument. If you specify both, the system ignores the l_pts argument. Default: none txf_size A signed integer, floating-point number, or Cadence SKILL language expression specifying the difference between the size of the source object (Rl_fromObj) and the size of the generated polygon. When the source is more than one object, txf_size specifies the difference between a bounding box around all of the objects and the size of the generated polygon. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 211 Product Version 5.0 A positive number creates a polygon that is larger than the source object(s); a negative number creates a polygon that is smaller than the source object(s). When you specify a SKILL expression, it must evaluate to a positive or negative integer or floating-point number. SKILL expressions are evaluated only when the new polygon is created. If you specify a source object (Rl_fromObj) but do not specify txf_size, then txf_size defaults to 0.0. If you specify txf_size, you must also specify Rl_fromObj, or the system issues a warning message and the function fails. Default: 0.0 l_prop A list or lists of lists, where each list contains the name of a property and its value. When the property name is a string, enclose it in quotes. For a description of the valid data types, see the “About the Add Property Form” in the Virtuoso Layout Editor User Guide. For Boolean properties, the value must be t or nil. For example, you would specify a single Boolean property as follows: ?prop list("myProp" t) and a list of properties as follows: ?prop list( list("myProp1" propValue1) list("myProp2" propValue2) ... list("myPropN" propValueN) ) For a more detailed description about specifying lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Default: nil ROD Connectivity Arguments for Polygons The connectivity arguments for polygons are the same as the connectivity arguments for rectangles. See “ROD Connectivity Arguments for Rectangles” on page 224. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 212 Product Version 5.0 Return Values R_rodObj The ROD object ID for the polygon that was created. nil No polygon was created due to an error. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 213 Product Version 5.0 rodCreateRect rodCreateRect( [?name S_name] ?layer txl_layer [?width n_width] [?length n_length] [?origin l_origin] [?bBox l_bBox] [?elementsX x_elementsX] [?elementsY x_elementsY] [?spaceX n_spaceX] [?spaceY n_spaceY] [?cvId d_cvId] [?fillBBox l_fillBBox] [?fromObj Rl_fromObj] [?size txf_size] [?prop l_prop] [?returnBoolean g_returnBoolean] [ROD Connectivity Arguments] [?subRectArray l_subrectArgs...] ) ; end of rodCreateRect => R_rodObj | t | nil ; ROD Connectivity Arguments for Rectangles [?netName S_netName] [?termName S_termName] [?termIOType S_termIOType] [?pin g_pin] [?pinAccessDir tl_pinAccessDir] [?pinLabel g_pinLabel] [?pinLabelHeight n_pinLabelHeight] [?pinLabelLayer txl_pinLabelLayer] [?pinLabelFont S_pinLabelFont] [?pinLabelDrafting g_pinLabelDrafting] [?pinLabelOrient S_pinLabelOrient] [?pinLabelOffsetPoint l_pinLabelOffsetPoint] [?pinLabelJust S_pinLabelJust] [?pinLabelRefHandle S_pinLabelRefHandle] ;l_subrectArgs Subrectangle Arguments list( list( ?layer txl_layer [?width n_width] [?length n_length] [?gap S_gap] [?lowerLeftOffsetX n_lowerLeftOffsetX] Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 214 Product Version 5.0 [?lowerLeftOffsetY n_lowerLeftOffsetY] [?upperRightOffsetX n_upperRightOffsetX] [?upperRightOffsetY n_upperRightOffsetY] [?spaceX n_spaceX] [?spaceY n_spaceY] [?prop l_prop] ;Repeat ROD Connectivity Arguments here ) ;End of first subrectangle list ... ) ;End of all subrectangle lists ;End of l_subrectArgs Description Creates a single named rectangle, one or more rows and/or columns of named rectangles, or fills a bounding box with named rectangles, where each rectangle has ROD attributes. You create these named rectangles with the arguments S_name through g_returnBoolean. Each named rectangle is a separate object, created at level zero in the hierarchy. You can also create multipart rectangles by specifying one or more arrays of unnamed subrectangles for each named rectangle, where each unnamed subrectangle is an ordinary database shape, with no ROD attributes, created at level zero in the hierarchy. The named rectangles in a multipart rectangle are referred to as master rectangles. You can assign a property name and value (or a list of property names and values) to named rectangles and/or to any set of unnamed subrectangles. You can specify connectivity to associate named rectangles with the same terminal and net and to turn named rectangles into pins on a specified terminal and net; you can also specify connectivity for each set of unnamed subrectangles to associate it with a terminal and net and turn each subrectangle into a pin. Note: When you want to create a single unnamed rectangle that is a regular database shape and has no ROD attributes, use the dbCreateRect function, documented in the Cadence Design Framework II SKILL Functions Reference. When you want to create a one- or two-dimensional array of unnamed rectangles that have no ROD attributes, use the rodFillBBoxWithRects function. Regular database shapes require less overhead, resulting in faster performance. Arguments S_name Character string or symbol specifying the name for the rectangle you want to create. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 215 Product Version 5.0 The name must be unique for the cellview. If you do not assign a name, the system assigns a unique name, consisting of the prefix rect, followed by a number. For example, for the first unnamed rectangle in the cellview, the systemassigns the name rect0; for the second rect1, and so on. Single row or column of rectangles: When you create a single row or column of rectangles, the system uses your specified name (or rectn if you did not specify a name) as a base and adds the suffix .n, where n starts at 1 and is increased by 1 for each rectangle in the row or column. For example, if you create a row of three rectangles (rectangles in the direction of the X axis) and assign the name polyRect, the system names the three rectangles polyRect.1, polyRect.2, and polyRect.3. If you create a column of three rectangles (rectangles in the direction of the Y axis) and you do not assign a name, the system names the three rectangles rect0.1, rect0.2, and rect0.3. Multiple rows and columns of rectangles: When you create multiple rows and columns of rectangles, the system uses your X Y polyRect.1 polyRect.3 polyRect.2 X Y rect0.1 rect0.2 rect0.3 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 216 Product Version 5.0 specified name as a base and adds the suffix .x.y, where .x.y is the number of the row and column. For example, if you specify three rows and four columns, the system names the rectangles as follows: Default: rectn, rectn.n, rectn.x.y txl_layer Text string, integer, or list specifying the layer or layer-purpose pair for the rectangle(s), such as ?layer "metal1" ?layer 45 ?layer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. For lists, use the following format: list( layer purpose ) Examples of layer-purpose pairs are ?layer list("metal1" "drawing") ?layer list(45 252) ?layer list(45 "drawing") ?layer list("metal1" 252) You are required to specify a layer. Default Purpose: drawing X Y myName.4.3 or rect0.4.3 myName.1.1 or rect0.1.1 myName.1.3 or rect0.1.3 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 217 Product Version 5.0 n_width Positive integer or floating-point number specifying the horizontal measurement of the rectangle, in user units. The value of l_bBox overrides the value of n_width when you specify both. If you specify neither n_width nor l_bBox, the system uses the value of n_length. If you do not specify n_length, the system uses the value for minWidth, the minimum width rule for the specified layer, from your technology file. If you specify none of these and minWidth is not available, the function reports an error. Default: n_length if specified; otherwise the minimum width rule for the specified layer from your technology file n_length Positive integer or floating-point number specifying the vertical measurement of the rectangle, in user units. The value of l_bBox overrides the value of n_length when you specify both. If you specify neither n_length nor l_bBox, the system uses the value of n_width. If you do not specify n_width, the system uses the value for minWidth, the minimum width rule for the specified layer, from your technology file. If you specify none of these and minWidth is not available, the function reports an error. Default: n_width if specified; otherwise the minimumwidth rule for the specified layer from your technology file n_width n_length Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 218 Product Version 5.0 l_origin Single point or list of coordinates specifying the lower left corner of the first rectangle; use one of the following formats: x:y or list(x y) The value of l_bBox overrides the value of l_origin when you specify both. Default: 0:0 l_bBox List of two points specifying opposite corners of a bounding box for the size of the rectangle. You can start the box in any corner. The system determines the location of the first rectangle by using the difference between the coordinates for the specified opposite corners. Use one of the following formats: list( x:y x:y ) or list( list(x y) list(x y)) Example 1 starts in the bounding box in the lower-left corner. list(3:3 30:15) or list( list(3 3) list(30 15)) Example 2 starts the bounding box in the upper-left corner. X Y 0:0 X 30:15 X 3:3 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 219 Product Version 5.0 list(3:15 30:3) or list( list(3 15) list(30 3)) When you specify a rectangle size with l_bBox, the value of l_bBox overrides the values of n_width, n_length, and l_origin. Default: none x_elementsX Positive integer specifying the number of rectangles to create in a row parallel to the X axis. If you also specify l_fillBBox, x_elementsX specifies the maximumnumber of rectangles to create in the direction of the X axis. Default: 1 x_elementsY Positive integer specifying the number of rectangles to create in a column parallel to the Yaxis. If you also specify l_fillBBox, x_elementsY specifies the maximumnumber of rectangles to create in the direction of the Y axis. Default: 1 n_spaceX Positive integer or floating-point number specifying the distance between the edges of rectangles in the direction of the X axis. This argument is ignored when a row contains only one rectangle. X Y 0:0 X 30:3 X 3:15 X Y n_spaceX Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 220 Product Version 5.0 If you do not specify n_spaceX, the system uses the value of n_spaceY. If you specify neither, the systemuses the value for minSpacing, the minimum spacing rule for the specified layer, from your technology file. If you specified neither of these and minSpacing is not available, the function reports an error. Default: n_spaceY if specified; otherwise the minimumspacing rule for the specified layer from your technology file n_spaceY Positive integer or floating-point number specifying the distance between the edges of rectangles in the direction of the Y axis. This argument is ignored when a row contains only one rectangle. If you do not specify n_spaceY, the system uses the value of n_spaceX. If you specify neither, the system uses the value of minSpacing, the minimum spacing rule for the specified layer, from your technology file. If you specified neither of these and minSpacing is not available, the function reports an error. Default: n_spaceX if specified; otherwise the minimumspacing rule for the specified layer from your technology file d_cvId Database ID for the cellview in which you are creating a rectangle. Default: pcCellView or tcCellView when a rodCreateRect statement occurs in the body of a pcDefinePCell function or tcCreateDeviceClass function call, respectively; nil if no cellview ID is specified or found l_fillBBox List of two points defining opposite corners of a bounding box to fill with rectangles, referred to as a fill-bounding box. The first point specifies any corner and the second point specifies the opposite corner. Use one of the following formats: list( x:y x:y ) X Y n_spaceY Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 221 Product Version 5.0 or list( list(x y) list(x y)) You can specify the maximum number of rectangles the system creates in the fill-bounding box with x_elementsX and x_elementsY. If the number specified exceeds the space available in the fill-bounding box, the system creates only the number of rectangles that fit. You can specify the distance between rectangles in the fill- bounding box with n_spaceX and n_spaceY. When you use l_bBox argument with l_fillBBox, the system uses the l_bBox coordinates only to compute the size of the rectangles. The system always places the first rectangle in the lower-left corner of the fill-bounding box. For example, the following argument values define a 14-by-10 fill-bounding box with its lower-left corner at 2:2: ?llBBox list( 2:2 16:12 ) ?bBox list( 0:0 4:2 ) ?spaceX 1.0 ?spaceY 2.0 The coordinates of the first rectangle (0:0 4:2) are used to compute the size of the rectangles, not the location of the first rectangle. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 222 Product Version 5.0 The size of the rectangles is 4 units wide by 2 units long. The rectangles are spaced 1 unit apart in the direction of the X axis and 2 units apart in the direction of the Y axis. The fill-bounding box is shown by a dashed line because no actual bounding box is created. Default: nil Rl_fromObj ROD object ID or list of ROD object IDs identifying a named object or list of named objects that you want to use as a source for creating a new named rectangle. The source objects can be instances, rectangles, polygons, paths, lines, dots, labels, and/or text-display objects. When you specify Rl_fromObj, the value of the Rl_fromObj argument overrides other arguments that directly or indirectly specified coordinates for the generated rectangle: n_width, n_length, l_origin, and l_bBox. Default: none txf_size A signed integer, floating-point number, or Cadence SKILL language expression specifying the difference between the size of the source object (Rl_fromObj) and the size of the generated rectangle. When the source is more than one object, txf_size specifies the difference between a bounding box around all of the objects and the size of the generated rectangle. A positive number creates a rectangle that is larger than the source objects; a negative number creates a rectangle that is smaller than the source objects. When you specify a SKILL expression, it must evaluate to a positive or negative integer or floating-point number. SKILL expressions are evaluated only when the new rectangle is created. 2:2 X Y 0:0 X X 16:12 X 6:4 First rectangle is always in lower-left corner of fill-bounding box. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 223 Product Version 5.0 If you specify a source object (Rl_fromObj) but do not specify txf_size, then txf_size defaults to 0.0. If you specify txf_size, you must also specify Rl_fromObj, or the system issues a warning message and the function fails. Default: 0.0 l_prop A list or lists of lists, where each list contains the name of a property and its value. When the property name is a string, enclose it in quotes. For a description of the valid data types, see the “About the Add Property Form” in the Virtuoso Layout Editor User Guide. For Boolean properties, the value must be t or nil. For example, you would specify a single Boolean property as follows: ?prop list("myProp" t) and a list of properties as follows: ?prop list( list("myProp1" propValue1) list("myProp2" propValue2) ... list("myPropN" propValueN) ) For a more detailed description about specifying lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Default: nil g_returnBoolean Boolean value indicating whether or not the rodCreateRect function returns a Boolean value or ROD object IDs. The value must be t or nil. When g_returnBoolean is t, the function returns t or nil. When g_returnBoolean is nil, the function returns a single ROD object ID or a list of ROD object IDs. When you are creating multiple rectangles, the rodCreateRect function executes much more quickly if g_returnBoolean is set to t, so when you do not need a list of ROD object IDs, set this argument to t. Default: nil l_subRectArray A list containing one or more lists, each of which specifies the arguments for one set of unnamed subrectangles. Each list creates a set of unnamed subrectangles for each master Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 224 Product Version 5.0 rectangle in the multipart rectangle; each set of subrectangles is created in relationship to the lower-left corner of each master rectangle. For information about how to specify lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Return Values The values returned by the rodCreateRect function is determined by how you specify the g_returnBoolean argument. When g_returnBoolean is set to t, the function returns t or nil. When g_returnBoolean is set to nil, the function returns a ROD object ID or list of ROD object IDs. When g_returnBoolean is set to nil and more than one rectangle is created, rodCreateRect returns a list of ROD object IDs with the upper right rectangle listed first and the lower left rectangle listed last. For example, ("xxx.6.6" "xxx.6.5" "xxx.6.4" "xxx.6.3" "xxx.6.2" "xxx.6.1" "xxx.5.6" "xxx.5.5" "xxx.5.4" "xxx.5.3" "xxx.5.2" "xxx.5.1" "xxx.4.6" "xxx.4.5" "xxx.4.4" "xxx.4.3" "xxx.4.2" "xxx.4.1" "xxx.3.6" "xxx.3.5" "xxx.3.4" "xxx.3.3" "xxx.3.2" "xxx.3.1" "xxx.2.6" "xxx.2.5" "xxx.2.4" "xxx.2.3" "xxx.2.2" "xxx.2.1" "xxx.1.6" "xxx.1.5" "xxx.1.4" "xxx.1.3" "xxx.1.2" "xxx.1.1") R_rodObj ROD object ID or a list of ROD object IDs in descending sequence for ROD object information associated with the new rectangle or multiple new rectangles. t Rectangles were created successfully. nil An error occurred, and no rectangles were created. ROD Connectivity Arguments for Rectangles S_netName Character string or symbol specifying the name of the net with which you want to associate the shape. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. If the net does not exist, the systemcreates the net, naming it with S_netName. To associate the shape with a net, this argument is required. Default: none S_termName Character string or symbol specifying the name of the terminal and net with which you want to associate the shape. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 225 Product Version 5.0 strings. If the terminal and net does not exist, the systemcreates them, naming them S_termName. If you specify both S_termName and S_netName, their names must be the same. If a terminal with the specified name already exists, the net it belongs to must have the same name. If the net name does not match the terminal name, the function reports an error. To associate the shape with a terminal and net, this argument is required. Default: none S_termIOType Character string or symbol specifying the direction type (I/O type) for the terminal. If S_termName is not specified, S_termIOType is ignored. If a terminal with the name specified by S_termName already exists, it must have the same direction type as specified by S_termIOType; if the direction type is not the same, the function reports an error. Valid Values: input, output, inputOutput, switch, jumper Default: inputOutput g_pin Boolean value indicating whether or not to make the shape into a pin. The value must be t or nil. When you specify g_pin, you must also specify S_netName and S_termName; if you do not, all connectivity arguments are ignored but no error is reported. When the value is t, the shape created is a pin. When the value is nil, the shape created is not a pin, and all other arguments containing the word pin are ignored. Valid Values: t, nil Default: nil tl_pinAccessDir Text string or list specifying the access directions for the pin. Enclose string values in quotation marks. Do not use a symbol. An example of a list is list( "top" "bottom" ) Valid Values: top, bottom, left right, any, none, or a list containing any of these values Default: any g_pinLabel Boolean value indicating whether or not to add a text-display label for the pin. The value must be t or nil. When the value is t, the systemcreates a text-display label attached to the pin. The text is the contents the of the S_termName argument. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 226 Product Version 5.0 Valid Values: t, nil Default: nil n_pinLabelHeight Integer or floating-point number specifying the vertical height of the pin text-display label in user units. Default: 1 txl_pinLabelLayer Text string, integer, or list specifying the layer or layer-purpose pair for the pin text-display label, such as ?pinLabelLayer "metal1" ?pinLabelLayer 45 ?pinLabelLayer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. For lists, use the following format: list(layer purpose) Examples of layer-purpose pairs are ?pinLabelLayer list("metal1" "drawing") ?pinLabelLayer list(45 252) ?pinLabelLayer list(45 "drawing") ?pinLabelLayer list("metal1" 252) When only the layer is specified, the purpose defaults to the purpose defined by l_layer. When neither layer nor purpose is specified, both layer and purpose default to the values defined by l_layer. Default: layer specified by l_layer; purpose specified by l_layer S_pinLabelFont Character string or symbol specifying the name of the font for the pin text-display label. Valid Values: euroStyle, gothic, math, roman, script, stick, swedish Default: stick g_pinLabelDrafting Boolean value indicating whether or not to rotate the pin text- display label more than 90 degrees. The value must be t or nil. When the value is t, the label can rotate 90 degrees or less. When the value is nil, the label can rotate 90 degrees or more. Valid Values: t, nil Default: t Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 227 Product Version 5.0 S_pinLabelOrient Character string or symbol specifying the orientation of the pin text-display label. Valid Values: 0 R0 MY sideways 90 R90 MYR90 sideways&90 180 R180 MX upsideDown 270 R270 MXR90 sideways&270 Default: R0 l_pinLabelOffsetPoint Single set of coordinates specifying the X and Y offset of the origin of the pin text-display label from a point handle on the rectangle. The label origin is specified by S_pinLabelJust, and the rectangle point handle is specified by S_pinLabelRefHandle. For example, to create a label on the rectangle polyRect, offset fromthe segment point handle mid2 by 2 units in the direction of the X axis and 0 units in the direction of the Y axis, specify 2:0. Use one of the following formats: x:y or list(x y) or any expression that evaluates to a list containing two numbers. Default: 0:0 S_pinLabelJust Character string or symbol specifying the origin point of the label. You must specify both words; do not abbreviate them. InOut0 X polyRect S_pinLabelRefHandle equals mid2. S_pinLabelJust equals lowerLeft. X l_pinLabelOffsetPoint equals 2:0. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 228 Product Version 5.0 Valid Values: upperLeft lowerLeft upperCenter lowerCenter upperRight lowerRight centerLeft centerCenter centerRight Default: centerCenter S_pinLabelRefHandle Character string or symbol specifying the point handle on the rectangle with which you want to associate the origin point of the text-display label. You can specify the name of any bounding box or segment point handle. Bounding box point handle names: To specify a point handle on the bounding box of a rectangle, use either the two-word handle name or its two-character abbreviation, as shown in valid values. For example, you can use uL for upperLeft. Valid Values for bounding box point handles: upperLeft or uL lowerLeft or lL upperCenter or uC lowerCenter or lC upperRight or uR lowerRight or lR centerLeft or cL centerCenter or cC centerRight or cR Segment point handle names: To specify a point handle on a segment of a rectangle, use the system-defined name for the handle. Each segment has three system-defined point handles, named startn, midn, and endn, where n is the segment number, starting at zero. The last segment also has the following point handles: startLast, midLast, and endLast. The systemnumbers segments clockwise, starting with the lower-left corner as zero, no matter how the rectangle was created. For a complete description of system-defined point handles, see “System-Defined Handles” on page 19. Valid Values: start0, mid0, end0; start1, mid1, end1; start2, mid2, end2; startLast, midLast, endLast Default: the bounding box point handle centerCenter Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 229 Product Version 5.0 Subrectangle Arguments (l_subrectArgs) txl_layer Text string, integer, or list specifying the layer or layer-purpose pair for the subrectangle(s), such as ?layer "metal1" ?layer 45 ?layer list("metal1" "drawing") Enclose string values in quotation marks. Do not use a symbol. Use one of the formats defined for the argument txl_layer. You are required to specify a layer. Default Purpose: drawing n_width Positive integer or floating-point number specifying the horizontal measurement of the subrectangle(s) in user units. If not specified, the system uses n_length; if neither is specified, the system uses the minWidth rule for the subrectangle layer fromthe technology file. If the minWidth rule is not defined in the technology file, rodCreateRect returns nil to indicate an error. Default: n_length if specified; otherwise minWidth for the subrectangle layer from the technology file n_length Positive integer or floating-point number specifying the vertical measurement of the subrectangle(s) in user units. n_width n_length Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 230 Product Version 5.0 If not specified, the system uses n_width; if neither is specified, the system uses the minWidth rule for the subrectangle layer fromthe technology file. If the minWidth rule is not defined in the technology file, rodCreateRect returns nil to indicate an error. Default: n_width if specified; otherwise, minWidth for the subrectangle layer from the technology file S_gap Character string or symbol specifying the method the system uses to place subrectangles within each master rectangle. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. The system automatically calculates the maximum number of rectangles that fit in the master rectangle, allowing for the space needed by the offset arguments, and using the value of the n_spaceX and n_spaceY arguments to determine the minimum space between subrectangles. When the value of S_gap is distribute, which is the default, the systemdistributes the space around subrectangles as evenly as possible, in multiples of the grid space specified by mfgGridResolution. Any remaining space is divided evenly and placed to the right and/or above each subrectangle. The following example shows excess space along the X axis. X 0:0 Y For distribute, excess space in the X direction is divided and placed to the right of each subrectangle. Master rectangle n_spaceY n_spaceX Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 231 Product Version 5.0 Note: When the value of S_gap is distribute and there is only one subrectangle, the system centers the subrectangle in the master rectangle. When the value of S_gap is minimum, the system places subrectangles n_spaceX and n_spaceY apart until there is no space for another subrectangle, then places all of the excess space to the right and/or above the rows/columns of subrectangles. The following example shows excess space along the X axis. Valid Values: distribute, minimum Default: distribute n_lowerLeftOffsetX Signed integer or floating-point number specifying the offset along the X axis of the left edge of the lower-left subrectangle from the left edge of the master rectangle. A positive number X 0:0 Y For minimum, all excess space in the X direction is placed to the right of the rows of subrectangles. Master rectangle n_spaceX n_spaceY Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 232 Product Version 5.0 starts the subrectangles to the right; a negative number starts the subrectangles outside the master rectangle. Default: 0 n_lowerLeftOffsetY Signed integer or floating-point number specifying the offset along the Yaxis of the bottomedge of the lower-left subrectangle fromthe bottomedge of the master rectangle. A positive number starts the subrectangles above the bottom edge of the master rectangle; a negative number starts the subrectangles outside the master rectangle. n_upperRightOffsetX Signed integer or floating-point number specifying the offset along the X axis of the right edge of the upper-right subrectangle from the right edge of the master rectangle. A positive number X 0:0 Y n_lowerLeftX is +2.0 X 0:0 Y n_lowerLeftX is -2.0 X 0:0 Y n_lowerLeftY is +1.0 X 0:0 Y n_lowerLeftY is -1.0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 233 Product Version 5.0 starts the subrectangles outside of the master rectangle; a negative number starts the subrectangles to the left of the right edge of the master rectangle. n_upperRightOffsetY Signed integer or floating-point number specifying the offset along the Y axis of the top edge of the upper-right subrectangle from the top edge of the master rectangle. A positive number starts the subrectangles outside of the master rectangle; a negative number starts the subrectangles below the top edge of the master rectangle. n_spaceX Positive integer or floating-point number specifying the distance between the edges of subrectangles in the direction of the Xaxis. If not specified, the system uses the minSpacing rule for the subrectangle layer from the technology file. If the minSpacing rule is not defined in the technology file, rodCreateRect returns nil to indicate an error. X 0:0 Y upperRightX is -1.0 X 0:0 Y upperRightX is +1.0 X 0:0 Y upperRightY is -2.0 X 0:0 Y upperRightY is +2.0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 234 Product Version 5.0 Default: minSpacing for the subrectangle layer from the technology file n_spaceY Positive integer or floating-point number specifying the distance between the edges of subrectangles in the direction of the Yaxis. If not specified, the system uses the minSpacing rule for the subrectangle layer from the technology file. If the minSpacing rule is not defined in the technology file, rodCreateRect returns nil to indicate an error. Default: minSpacing for the subrectangle layer from the technology file Examples Example 1: Creating a Single Rectangle Note: When you want to create a rectangle that is a regular, unnamed database shape, use the dbCreateRect function instead of the rodCreateRect function; using dbCreateRect produces less overhead, resulting in faster performance. You can create a single named rectangle, with ROD attributes, as shown below: with code similar to the following: rodCreateRect( ?layer "metal2" ?width 4 ?length 2 ) The return value is a single ROD object ID. n_width n_length Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 235 Product Version 5.0 Example 2: Creating Rows and Columns of Named Rectangles To create rows and columns of rectangles that are regular, unnamed database shapes, see “Filling a Bounding Box with Rectangles” on page 256. You can create rows and columns of named rectangles that have ROD attributes, as shown below: with code similar to the following. rodCreateRect( ?layer "metal1" ?width 1 ?length 1 ?origin list( 0 0 ) ?elementsX 4 ?elementsY 2 ?spaceX 1 ?spaceY 2 ) The return value is a list of eight ROD object IDs. X Y 0:0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 236 Product Version 5.0 Example 3: Filling a Bounding Box with Named Rectangles To fill a bounding box with rectangles that are regular, unnamed database shapes, see “Filling a Bounding Box with Rectangles” on page 256. You can fill a bounding box with named rectangles that have ROD attributes, as shown below: with code similar to the following (the first rectangle is always in the lower-left corner of the bounding box): rodCreateRect( ?layer "metal1" ?fillBBox list( 1:1.5 10:5 ) ?spaceX 0.5 ?returnBoolean t ) The return value is t. 1:1.5 X Y 0:0 X 10:8 X Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 237 Product Version 5.0 Example 4: Creating a Multipart Rectangle You can create a multipart rectangle consisting of a single master rectangle filled with unnamed subrectangles as shown below: with code similar to the following. In this example, S_gap is not specified; it defaults to distribute, causing the excess space to be placed between the subrectangles. cvId = deGetCellView() rodCreateRect( ?layer "metal1" ?width 24 ?length 17 ?origin list( 0 0 ) ?elementsX 1 ?elementsY 1 ?cvId cvId ?subRectArray list( list( ?layer "metal2" ?width 3 ?length 3 ?lowerLeftOffsetX 3.3 ?lowerLeftOffsetY 3 ?upperRightOffsetX -6 ?spaceX 3.3 Lower-left offset in Y is 3.0 Lower-left offset in X is 3.3 Upper-right offset in X is -6.0 Upper-right offset in Y defaults to zero. Space in X is 3.3 Master rectangle Space in Y is 3.0 X Excess space in X equals 5.4, and is distributed between rectangles. 0:0 Y Excess space in Y is 2.0 24:17 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 238 Product Version 5.0 ?spaceY 3 ) ;End first subrectangle list ) ;End of all subrectangle lists ) ; end rodCreateRect Specifying the Gaps as Minimum To place excess space to the right or above the subrectangles, you can specify the S_gap argument as minimum, as shown below. cvId = deGetCellView() rodCreateRect( ?layer "metal1" ?width 24 ?length 17 ?origin list( 0 0 ) ?elementsX 1 ?elementsY 1 ?cvId cvId ?subRectArray list( Lower-left offset in Y is 3.0 Lower-left offset in X is 3.3 Upper-right offset in X is -6.0 Upper-right offset in Y defaults to zero. Space in X is 3.3 Master rectangle Space in Y is 3.0 X 0:0 Y Excess space in X is 5.0 Excess space in X is 5.4 24:17 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 239 Product Version 5.0 list( ?layer "metal2" ?width 3 ?length 3 ?gap "minimum" ?lowerLeftOffsetX 3.3 ?lowerLeftOffsetY 3 ?upperRightOffsetX -6 ?spaceX 3.3 ?spaceY 3 ) ;End first subrectangle list ) ;End of all subrectangle lists ) ; end rodCreateRect Example 5: Creating a Multipart Rectangle with Overlapping Subrectangles You can create a multipart rectangle with overlapping unnamed subrectangles, as shown below: with code similar to the following;, where the lower-left offset arguments are less than zero and the upper-right offset arguments are greater than zero: cvId = deGetCellView() rodCreateRect( ?layer "metal1" ?width 12 ?length 12 ?origin list( 2 2 ) ?elementsX 1 ?elementsY 1 ?cvId cvId ?subRectArray list( list( ?layer "metal2" X 0:0 14:14 Y 2:2 X X Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 240 Product Version 5.0 ?width 1 ?length 1 ?lowerLeftOffsetX -2 ?lowerLeftOffsetY -2 ?upperRightOffsetX 2 ?upperRightOffsetY 2 ?spaceX 1 ?spaceY 1 ) ;End first subrectangle list ) ;End of all subrectangle lists ) ; end rodCreateRect Example 6: Creating a Ground Rail and Contacts You can create a ground rail with contacts, as shown below: where with code similar to the following, you specify a named rectangle for the metal layer, a set of unnamed subrectangles on the p-diffusion layer, and a second set of unnamed subrectangles on the contact layer: rodCreateRect( ?layer "metal1" ?width 10 ?length 2 ?origin list( 0 0 ) ?elementsX 1 ?elementsY 1 ?cvId cvId ?subRectArray list( list( ?layer "pdiff" ?width 1 ?length 1 ?gap "minimum" X 0:0 Y Master rectangle for power rail on metal1 layer First set of subrectangles on the pdiff layer Second set of subrectangles on the cont layer Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 241 Product Version 5.0 ?lowerLeftOffsetX 0.5 lowerLeftOffsetY 0.5 ) ;End of first subrectangle list list( ?layer "cont" ?width 0.5 ?length 0.5 ?gap "minimum" ?lowerLeftOffsetX 0.75 ?lowerLeftOffsetY 0.75 ?spaceX 1.5 ?spaceY 1.5 ) ;End of second subrectangle list ) ;End of all subrectangle lists ) ; end rodCreateRect In this example, specifying the space arguments for the subrectangles is not necessary; the software uses the default values for the n_spaceX and n_spaceY arguments to create the number of contacts that fit. However, if you want to an amount of space between contacts that is different than the default when the power rail is stretched, you do need to specify the space arguments. Example 7: Stretching a Multipart Rectangle The following examples include stretching the master rectangle of a multipart rectangle in the direction of the Y axis. To make the subrectangles regenerate correctly, specifying n_spaceY is necessary. The space arguments default to the minimum spacing (minSpacing) defined for the subrectangle layers in the technology file, which, in this case, does not produce the desired result. When you stretch a master rectangle using the Virtuoso ® Layout Editor Edit – Stretch command, the system regenerates all sets of unnamed subrectangles. For example, stretching the master rectangle specified in the last example to the right, as shown below: makes the power rail longer, adding more contacts horizontally, like this: X 0:0 Y Stretching the master rectangle to the right. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 242 Product Version 5.0 Stretching the master rectangle upward, as shown below: X 0:0 Y X 0:0 Y Stretching the master rectangle upward. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 243 Product Version 5.0 makes the power rail wider, adding more rows of contacts vertically, like this: 0:0 X Y Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 244 Product Version 5.0 Example 8: Creating Multiple Master Rectangles Filled with Subrectangles For a multipart rectangle, you can create rows and columns of master rectangles and fill them with unnamed subrectangles, as shown below: with code similar to the following: cvId = deGetCellView() rodCreateRect( ?layer "metal1" ?width 3.5 ?length 3 ?origin list( 0.75 0.75 ) ?elementsX 3 ?elementsY 2 ?spaceX 0.75 ?spaceY 0.75 ?cvId cvId ?subRectArray list( list( ?layer "metal2" ?width 1 ?length 0.75 ?lowerLeftOffsetX 0.5 ?lowerLeftOffsetY 0.5 ?upperRightOffsetX -0.5 ?upperRightOffsetY -0.5 ?spaceX 0.5 ?spaceY 0.5 ) ;End first subrectangle list ) ;End of all subrectangle lists ) ; end rodCreateRect 0:0 X Y Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 245 Product Version 5.0 Example 9: Creating a Rectangle from Other Objects You can specify the coordinates of a named rectangle with the n_width, n_length, and l_origin arguments or with the l_bBox argument. Optionally, you can use the Rl_fromObj argument to specify one or more named objects from which to generate a named rectangle. When you specify two or more named objects as the source for creating a rectangle, as shown in the example below, the system creates the rectangle based on a bounding box around the objects. The new rectangle is larger or smaller than the bounding box, depending on whether you specify a positive or negative size. Note: After a new rectangle is generated, no relationship exists between the generated rectangle and its source objects. Source named objects X Y 0:0 Generated ROD rectangle txf_size is positive. X Y 0:0 Generated ROD rectangle X Y 0:0 txf_size is negative. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 246 Product Version 5.0 For a detailed overview of creating rectangles from other objects, see “Creating a Rectangle from Another Object” on page 91. Creating Objects Using rodCreateRect This section presents you with a series of problems to solve, to help you become familiar with using the rodCreateRect function. To encourage you to think about or solve the problems yourself, the solutions are not presented until the end of this chapter. I Problem 3-8 Create One Rectangle with n_width and n_length on page 247 I Problem 3-9 Create One Rectangle with l_bBox on page 247 I Problem3-10 Create a Multipart Rectangle with One Row/Column of Master Rectangles on page 248 I Problem 3-11 Create a Multipart Rectangle with Multiple Rows/Columns of Master Rectangles on page 249 I Problem 3-12 Fill a Bounding Box with Master Rectangles on page 250 When using rodCreateRect, you might want to use information from your technology file for the values of some arguments. For example, for the n_width argument, you can use the value of the design rule for minimum width. You can access design rules in several ways. The problems in this section access design rules by using defaults and by including techGetTechFile and techGetSpacingRule statements, when needed. For more detailed information about accessing design rules, see “Using Design Rules in ROD Functions” on page 303. Creating a Named Rectangle Note: Remember, when you want to create a rectangle that is a regular, unnamed database shape (with no ROD information), use the dbCreateRect function instead of the rodCreateRect function. To create a named rectangle with ROD attributes, determine its size and location either by specifying the width, length, and origin (n_width, n_length, and l_origin) or by specifying a bounding box (l_bBox). The l_bBox argument overrides the values of the n_width, n_length, and l_origin arguments. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 247 Product Version 5.0 Problem 3-8 Create One Rectangle with n_width and n_length Assume that you are in a pcell, and create a rectangle named minMetal on the metal1 layer. Set the width equal to 3. Set the length equal to twice the minimum width. Use the techGetTechFile function to get the technology file ID, and set it equal to the variable tfId. Let the cellview ID (d_cvId) default to the pcell variable pcCellView, because your statement is executed inside of a pcell. Solution 3-8 Create One Rectangle with n_width and n_length on page 289 Problem 3-9 Create One Rectangle with l_bBox Create a single rectangle similar to the way it was created for Problem 3-8 Create One Rectangle with n_width and n_length on page 247, but this time, use l_bBox to specify its size and location. Make the rectangle 6 wide by 3 long, with its origin point at the coordinates 2:2. Solution 3-9 Create One Rectangle with l_bBox on page 289 Width is 3. Length is twice minWidth X Y 0:0 Width is 6. Length is 3. X Y 0:0 8:5 X X 2:2 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 248 Product Version 5.0 Creating a Multipart Rectangle with Rows/Columns of Master Rectangles To create rows and/or columns of rectangles that are regular, unnamed database shapes, see Filling a Bounding Box with Rectangles figure on page 256. To create a multipart rectangle with a single row of master rectangles parallel to the X axis, specify the number of rectangles (elements) with the x_elementsX argument. To create a single column of master rectangles parallel to the Y axis, use the x_elementsY argument. To create both rows and columns, use both x_elements arguments. Problem3-10 Create a Multipart Rectangle with One Row/Column of Master Rectangles For a pcell, you want to create a multipart rectangle with one row of master rectangles. Add a rodCreateRect statement to the body of a pcDefinePCell statement, as follows: Create nine minimum-size rectangles on the metal1 drawing layer in the direction of the X axis, and name themminMetal.1 through minMetal.9. Use the rules fromthe technology file for minimum width and minimum space between rectangles. Let the origin of the first rectangle default to the coordinates 0:0. Let the cellview ID default to the value of the pcell variable pcCellView, because your statement is executed inside of a pcell. The rectangles form a row that looks like this: Solution 3-10 Create a Single Row or Column of Rectangles on page 289 X Y 0:0 Minimum space for metal1 Minimum width for metal1 minMetal.1 minMetal.2 minMetal.9 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 249 Product Version 5.0 Problem 3-11 Create a Multipart Rectangle with Multiple Rows/Columns of Master Rectangles Inside a pcell, create rows and columns of master rectangles using polyRect as the base for the name, with five along the X axis and four along the Y axis, using the layer-purpose pair poly and drawing. Set the origin of the first rectangle to the coordinates 3:6. For the Xaxis, make the distance between the edges of rectangles equal to three greater than the minimum spacing for the poly layer. For the Y axis, make the distance between rectangles equal to six greater than the minimum spacing for the poly layer. This time, you need the technology file ID. The rectangles form rows and columns that looks like this: Solution 3-11 Create Multiple Rows and Columns of Rectangles on page 290 Filling Bounding Boxes with Master Rectangles To fill a bounding box with master rectangles that have RODattributes, use the l_fillBBox argument; to partially fill a bounding box, specify the maximum number of rectangles to X Y 0:0 Minimum metal space for poly, plus 3 Minimum metal space for poly, plus 6 X 3:6 polyRect.1.4 polyRect.5.1 Minimum width for poly Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 250 Product Version 5.0 repeat in the direction of the X and/or Y axis. The system creates rectangles starting in the lower left corner of the fill-bounding box. The system gives each rectangle a unique name, using the value of the S_name argument as a base, then adding a suffix for the row and column number, with periods in front of the row and column numbers. For example, if you specify polyRect as the base for the name, the system names the rectangle in the lower-left corner of the fill-bounding box polyRect.1.1. The system creates all rectangles at level zero in the hierarchy, so no additional hierarchy is created. Also, no bounding box is created. To specify the maximumnumber of rectangles along each axis, use the x_elementsX and x_elementsY arguments. To specify spacing between rectangles, use the n_spaceX and n_spaceY arguments. When you specify both spacing and number of elements, the system creates as many rectangles as fit inside the bounding box without exceeding the numbers specified by the x_elements arguments. Problem 3-12 Fill a Bounding Box with Master Rectangles In a pcell, define an 18-by-10 bounding box on the poly layer, offset fromthe coordinates 0:0 by 2 user units in both directions. Fill the box with master rectangles using polyRect as the base for the name and the minimum width for the poly layer. Make the distance between rectangles along the X and Y axes equal to 2.0 units. Let the cellview ID default to the variable pcCellView, because the statement is inside of a pcell. The fill-bounding box and rectangles look like this: Solution 3-12 Fill a Bounding Box with Rectangles on page 290 2:2 X Y 0:0 polyRect.5.1 X X 20:12 polyRect.1.3 polyRect.5.3 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 251 Product Version 5.0 Problem 3-13 Partially Fill a Bounding Box with Master Rectangles On the metal1 layer in a pcell, fill a bounding box that is 18 units wide and 10 units long with master rectangles. Do not define an offset for the fill-bounding box. Set the layer purpose to drawing. Fill the box with a maximum of 3 rectangles in the direction of the X axis and 2 rectangles in the direction of the Y axis. Specify the size of the rectangles as 2 units wide by 2 units long using the bounding box argument l_bBox. Set the distance between rectangles along the Y axis to the minimum design rule in the technology file for the metal1 layer. Make the distance between rectangles along the X axis twice as large as the spacing along the Y axis. The rectangles do not fill the bounding box. Let the cellview ID default to the variable pcCellView, because the statement is inside of a pcell. Solution 3-13 Partially Fill a Bounding Box with Rectangles on page 291 Problem 3-14 Overfill a Bounding Box with Master Rectangles Fill an 18-by-10 bounding box with master rectangles on the metal1 layer, with no offset. Make the rectangles as wide and long as the minimum width for the metal1 layer. Specify a maximum of six rectangles in the direction of the X axis and four rectangles in the direction of the Y axis. X Y 0:0 rect0.3.1 X 18:10 rect0.1.2 X rect0.3.2 Minimum space for metal1 layer, times 2 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 252 Product Version 5.0 Set the distance between rectangles along the X axis to 2.5 and along the Y axis to 2.0. Let the cellview ID default to the pcell variable pcCellView. The bounding box and rectangles look like this: Solution 3-14 Overfill a Bounding Box with Rectangles on page 291 Creating Rectangles on a Terminal and Net To create a shape on a specific terminal and net, specify the terminal and net name using the S_termName argument. Problem 3-15 Create a Single Named Rectangle on a Terminal and Net In a pcell, create a rectangle named termFig on the metal1 layer. Assign the rectangle to the terminal and net Aout, and make the terminal direction type output. Let the width and length default to the minimum width for the specified layer from the technology file. Let the cellview ID (d_cvId) default to the variable pcCellView. Solution 3-15 Create a Single Rectangle on a Terminal and Net on page 292 X Y 0:0 X 18:10 X Minimum width for metal1 X Y 0:0 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 253 Product Version 5.0 Looking at Properties You can look at the properties for ROD objects with the Virtuoso® layout editor Edit – Properties command. Creating Rectangular Pins To create rectangular pins with the rodCreateRect function, you must specify the net and terminal name and your intention to create a pin. The system assigns the pin to the net and terminal identified by the S_termName argument. For a short overview of pin connectivity, see “Connectivity” on page 108. Problem 3-16 Create a Rectangular Pin Create a rectangular pin named polyPin for the terminal and net named InOut0, using the layer-purpose pair poly and pin. Set the access direction to input-output and label the pin. Use the l_bBox argument to determine the pin size and to place the pin in the upper-right corner of the object named trans1. You need to define a local variable for the minimum width so that you can use it to compute the size of the bounding box for the rectangle. You also need a local variable for the coordinates of the upper-right corner of the ROD object trans1. You can use the rodPointX function to get the X coordinate fromyour variable for the upper-right corner and rodPointY to get the Y coordinate. The polyPin pin looks like this: Solution 3-16 Create a Rectangular Pin on page 292 minwidth X Y 0:0 trans1~>upperRight trans1 IN0 minwidth X Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 254 Product Version 5.0 rodDeleteHandle rodDeleteHandle( R_rodObj S_name ) ; end rodDeleteHandle => t | nil Description Deletes a user-defined handle. You provide the ROD object ID and handle name. Arguments R_rodObj ROD object ID for the named object for which you want to delete a handle. This argument is required. S_name Character string or symbol specifying the name of the handle to delete. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. You cannot delete a system-defined handle. This argument is required. Valid Values: the name of any existing user-defined handle Default: none Return Values t The handle was deleted successfully. nil An error occurred and no handle is deleted. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 255 Product Version 5.0 rodFillBBoxWithRects rodFillBBoxWithRects( ?cvId d_cvId ?layer txl_layer ?fillBBox l_fillBBox [?width n_width] [?length n_length] [?gap S_gap] [?spaceX n_spaceX] [?spaceY n_spaceY] [?prop l_prop] [?returnBoolean g_returnBoolean] ) ; end rodFillBBoxWithRects => d_dbId | t | nil Description Fills a bounding box with rectangles, as many as fit within the bounding box you specify. The rectangles are ordinary unnamed shapes, identified by database IDs; the rectangles have no ROD attributes. You can assign a property name and value, or a list of property names and values, to the set of rectangles. The property or list of properties apply to every rectangle in the bounding box. You specify the return value of the function to be Boolean or a list of the database IDs for the rectangles. When you want to create a one- or two-dimensional array of rectangles, and the rectangles do not need to be ROD objects, use this function instead of rodCreateRect because regular database shapes require less overhead, contributing to faster performance. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 256 Product Version 5.0 Figure 3-5 Filling a Bounding Box with Rectangles You can fill a bounding box with rectangles as shown below simply by defining the lower-left and upper-right points of the bounding box. Notice where the system places any excess space. cvId = deGetCellView() dbIdList = rodFillBBoxWithRects( ?cvId cvId ?layer "metal1" ?fillBBox list( 1:1 12:6 ) ?width 2.0 ?length 1.0 ?spaceX 0.7 ?spaceY 0.7 ?returnBoolean nil ) ; end rodFillBBoxWithRects In the example above, the S_gap argument is not specified, so it defaults to distribute, causing excess space to be placed between the subrectangles. Therefore, the actual space between rectangles along the Y axis is 0.3 more than the minimum of 0.7 specified by the n_spaceY argument. The example code returns the variable dbIdList, which contains a list of 12 database IDs. 0:0 12:6 Y X Lower-left corner is at 1:1 n_spaceY is set to 0.7. Excess space equals 0.3. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 257 Product Version 5.0 Figure 3-6 Filling a Bounding Box with Rectangles with Minimum Gaps You can fill the same bounding box specified above, but with the S_gap argument set to minimum, to create the rectangles shown below. cvId = deGetCellView() rc = rodFillBBoxWithRects( ?cvId cvId ?layer "metal1" ?fillBBox list( 1:1 12:6 ) ?width 2.0 ?length 1.0 ?gap "minimum" ?spaceX 0.7 ?spaceY 0.7 ?returnBoolean t ) ; end rodFillBBoxWithRects The S_gap argument was set to minimum, so the systemspaced the rectangles apart using the values of n_spaceX and n_spaceY, and placed the remaining space above and to the right of the rectangles.The example code returns the variable rc, which is set to t. Arguments d_cvId Database ID for the cellview in which you are creating rectangles. Valid Values: valid cellview ID Default: nil txl_layer Text string, integer, or list specifying the layer or layer-purpose pair for the rectangle(s), such as 0:0 12:6 Y X Lower-left corner is at 1:1 n_spaceY and n_spaceX are set to 0.7. Excess space is placed above and to the right. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 258 Product Version 5.0 ?layer "metal1" ?layer 45 ?layer list("metal1" "drawing") Enclose string values in quotation marks. Use one of the formats defined for the argument txl_layer. You are required to specify a layer. Default Purpose: drawing l_fillBBox List of two points defining opposite corners of a bounding box to fill with rectangles. Valid Values: list of two points Default: nil n_width Positive integer or floating-point number specifying the horizontal measurement of the rectangle(s) in user units. If not specified, the system uses n_length; if neither is specified, the system uses the minWidth rule for the rectangle layer fromthe technology file. If the minWidth rule is not defined in the technology file, rodFillBBoxWithRects returns nil to indicate an error. Default: n_length if specified; otherwise minWidth for the rectangle layer from the technology file n_length Positive integer or floating-point number specifying the vertical measurement of the rectangle(s) in user units. If not specified, the system uses n_width; if neither is specified, the system uses the minWidth rule for the rectangle layer fromthe technology file. If the minWidth rule is not defined in the technology file, rodFillBBoxWithRects returns nil to indicate an error. Default: n_width if specified; otherwise, minWidth for the rectangle layer from the technology file S_gap Character string or symbol specifying the method the system uses to place rectangles within the bounding box. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 259 Product Version 5.0 The system always uses the value of n_spaceX and n_spaceY for minimum space between rectangles and calculates the maximum number of rectangles that fit in the bounding box. When the value of S_gap is distribute, the system distributes the space around rectangles as evenly as possible, in multiples of the grid space specified by mfgGridResolution. Any remaining space is placed to the right of the rows of rectangles and/or above the columns of rectangles. Note: When the value of S_gap is distribute and there is only roomfor one rectangle, the systemcenters the rectangle in the bounding box. When the value of S_gap is minimum, the system places rectangles n_spaceX and n_spaceY apart until there is no space for another rectangle, then places andy remaining space to the right of the rows of rectangles and/or above the columns of rectangles. Valid Values: distribute, minimum Default: distribute n_spaceX Positive integer or floating-point number specifying the distance between the edges of rectangles in the direction of the X axis. If not specified, the system uses the minSpacing rule for the rectangle layer from the technology file. If the minSpacing rule is not defined in the technology file, rodFillBBoxWithRects returns nil to indicate an error. Default: minSpacing for the rectangle layer fromthe technology file n_spaceY Positive integer or floating-point number specifying the distance between the edges of rectangles in the direction of the Y axis. If not specified, the system uses the minSpacing rule for the rectangle layer from the technology file. If the minSpacing rule is not defined in the technology file, rodFillBBoxWithRects returns nil to indicate an error. Default: minSpacing for the rectangle layer fromthe technology file Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 260 Product Version 5.0 l_prop A list or lists of lists, where each list contains the name of a property and its value. When the property name is a string, enclose it in quotes. For a description of the valid data types, see the “About the Add Property Form” in the Virtuoso Layout Editor User Guide. For Boolean properties, the value must be t or nil. For example, you would specify a single Boolean property as follows: ?prop list("myProp" t) and a list of properties as follows: ?prop list( list("myProp1" propValue1) list("myProp2" propValue2) ... list("myPropN" propValueN) ) For a more detailed description about specifying lists of lists, see “Formatting List-of-Lists Arguments for Subparts” on page 201. Default: nil g_returnBoolean Boolean value indicating whether or not the rodFillBBoxWithRects function returns a Boolean value or list of database object IDs. (This functions does not return a ROD object ID). The value of the g_returnBoolean argument must be t or nil. When g_returnBoolean is t, the function returns t or nil. When g_returnBoolean is nil, the function returns a list of database object IDs. When you are creating multiple rectangles, this function executes much more quickly if g_returnBoolean is set to t, so when you do not need the database object IDs, set this argument to t. Default: nil Return Values The value returned by the rodFillBBoxWithRects function is determined by how you specify the g_returnBoolean argument. When g_returnBoolean is set to t, the function returns t or nil. When g_returnBoolean is set to nil, the function returns a database ID or list of database IDs. (This function does not return ROD object IDs.) When g_returnBoolean is set to nil and more than one rectangle is created, Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 261 Product Version 5.0 rodFillBBoxWithRects returns a list of database IDs with the upper right rectangle listed first and the lower left rectangle listed last. The numbers in the illustration below show the sequence in which the database IDs of the rectangles would be returned. d_dbId Database object ID or list of database object IDs (not the ROD object ID) for the rectangles created to fill the bounding box, in descending sequence. t Rectangles were created successfully. nil An error occurred, and no rectangles were created. 0:0 Y X 1 2 3 4 5 6 7 8 9 10 11 12 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 262 Product Version 5.0 rodGetHandle rodGetHandle( R_rodObj S_name ) ; end rodGetHandle => g_handleValue | nil Description Returns the value of a system- or user-defined handle. You specify the handle name and the ROD object ID for the object with which the handle is associated. For Boolean handles, the value can be either t or nil. When the value is nil, rodGetHandle returns an ambiguous result: nil could mean that the handle was not found or that the value of the handle is nil. To avoid ambiguity for Boolean handles, verify that the handle exists with the rodIsHandle function before you try to access it. Arguments R_rodObj ROD object ID for the object with which the handle is associated. S_name Character string or symbol specifying the name of the handle whose value is returned. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. Return Values g_handleValue The value of the handle. The values of point handles are fully transformed into the coordinate system of the top-level cellview. nil No handle was found, or, if the handle is Boolean, the handle value is equal to nil. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 263 Product Version 5.0 rodGetNamedShapes rodGetNamedShapes( d_cvId ) ; end rodGetNamedShapes => list( R_rodObj... ) | nil Description Returns a list of the ROD object IDs for all named shapes (rectangles, polygons, and paths) at level zero in the hierarchy within the specified cellview that are ROD objects. This function looks only at the top level of hierarchy and does not return the ROD object ID for instances or cellviews. Arguments d_cvId Database ID for the cellview in which you want to identify named shapes that are ROD objects. If the rodGetNamedShapes statement occurs in the body of a pcDefinePCell function or tcCreateDeviceClass function call, the default value is pcCellView or tcCellView, respectively; otherwise, this argument is required. Default: none Return Values list( R_rodObj... ) A list of the ROD object IDs for all named shapes in the specified cellview that are ROD objects. nil No ROD objects or other named shapes exist in the cellview, or an error occurred. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 264 Product Version 5.0 rodGetObj rodGetObj( S_hierarchicalName | d_dbId [d_cellViewId] ) ; end rodGetObj => R_rodObj | nil Description Lets you find a named object at any level of hierarchy in your cellview. You must specify either the database ID for the object or its hierarchical name. If you specify the hierarchical name, you must also specify the cellview ID. When you specify a cellview ID, it is not necessary to also specify the database ID; however, if you specify both, the cellview ID must be correct for the database ID you specify. If your rodGetObj statement occurs in the code for a pcell (in the body of a pcDefinePCell function or tcCreateDeviceClass function call), specifying the cellview ID is optional; if you do not specify it, the cellview ID defaults to pcCellView or tcCellView, respectively. Arguments S_hierarchicalName Character string or symbol specifying an object name, preceded by the names of the instances in the path to the object, separated by the slash character ( / ). If you specify this argument, you must specify the cellview ID as well, unless the statement is in the code for a pcell or device. When you specify a cellview ID, it is not necessary to also specify the database ID; however, if you specify both, the cellview ID must be correct for the database ID you specify. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. For this argument, an empty character string (null) is a valid value. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 265 Product Version 5.0 For example, the hierarchical name for the shape polyRect shown below is mem/pTran/polyRect. An empty string ("") means that there is no named object; the function returns the ROD object ID for the cellview specified by d_cellViewId. Default: none. d_dbId Database ID for the object. If you specify this argument, you do not need to specify a cellview ID. However, if you specify both a database IDand a cellviewID, the cellviewIDmust be correct for the database ID you specify. d_cellViewId ID for the top-level cellview that contains the object specified by the S_hierarchicalName or d_dbId argument. When S_hierarchicalName is specified as an empty string (""), specify the cellview for which you want the ROD object ID. This argument is required when you do not specify d_dbId, unless the rodGetObj statement is in the code for a pcell or device. If you specify this argument, you do not need to specify the database ID. However, if you specify both a database ID and a cellview ID, the cellview ID must be correct for the database ID you specify. Default: pcCellView or tcCellView when the rodGetObj statement occurs in the body of a pcDefinePCell function or tcCreateDeviceClass function call, respectively Return Values R_rodObj ROD object ID for the object. nil An error occurred and no object was found. polyRect pTran mem The hierarchical name for polyRect is mem/pTran/polyRect. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 266 Product Version 5.0 Using rodGetObj This section presents you with a few problems to solve using the rodGetObj function. To encourage you to think about or solve the problems yourself, the solutions are not presented until the end of this chapter. I Problem 3-17 Accessing Coordinates without Hierarchy on page 267 I Problem 3-18 Accessing Coordinates through One Level of Hierarchy on page 267 I Problem 3-19 Accessing Coordinates through Two Levels of Hierarchy on page 268 For more information about the ROD object ID (the value returned by the rodGetObj function), see “About ROD Objects and ROD Object IDs” on page 113. Note: Although you can access ROD object information about mosaics, in the current release you cannot descend into a mosaic or access anything within a mosaic. Transforming Coordinates through Hierarchy The following problems show how the systemtransforms a set of coordinates up through the hierarchy to the top-level layout cellview. This information applies to the rodGetObj and rodGetHandle functions and to queries made using the ROD object ID with the database access operator (~>) to access point handles on ROD objects. Note: In hierarchical names, be sure to use the instance name, not the cellview name. To get the ROD object ID for an object, you must provide either the database ID, or both the hierarchical name and cellviewIDas input to the rodGetObj function. When the rodGetObj function is within the body of pcell code, you can use one of the following variables for the cellview ID: I The pcCellView variable when rodGetObj is in a pcDefinePCell statement. The pcDefinePCell function automatically sets the value of the pcCellView variable to the cellview ID. I The tcCellView variable when rodGetObj is in a tcCreateDeviceClass function call. The tcCreateDeviceClass function automatically sets the value of the tcCellView variable to the cellview ID. For convenience, you might want to assign these internal variables to a variable with a shorter name, for example cv = pcCellView or cv = tcCellView Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 267 Product Version 5.0 You can access information about the attributes of ROD objects by using the ROD object ID and the database access operator (~>). For detailed information about how to do so, see “Accessing ROD Object Attributes” on page 118. Problem 3-17 Accessing Coordinates without Hierarchy The layout cellview AAA contains a shape named polyRect. The lower-left corner of polyRect is 3 units above and 3 units to the right of the coordinates 0:0 on the X and Y axes. The library name is rodTestLib. Assign the cellview ID for layout cellview AAA to the local variable cv and the coordinates of the lower-left corner of polyRect to the local variable point1. What is the value of point1? Solution 3-17 Accessing Coordinates without Hierarchy on page 293. Problem 3-18 Accessing Coordinates through One Level of Hierarchy The layout cellview BBB contains two instances of layout cellview AAA: IA1 and IA2. Each instance of AAA contains the shape polyRect. Instance IA1 is offset from the coordinates 0:0 by 6 units on the X axis and 3 units on the Y axis. Instance IA2 is offset from0:0 by 66 units and 3 units, respectively. The origin of shape polyRect is offset from the origin of each instance by 3 units and 3 units. 0:0 polyRect 3:3 X Cellview AAA Y X lowerLeft point handle is at 3:3 Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 268 Product Version 5.0 Assign local variables point1 and point2 to the values of the lowerLeft point handles on the shape polyRect in instances IA1 and IA2, respectively. What are the values of point1 and point2? Solution 3-18 Accessing Coordinates through One Level of Hierarchy on page 293. Problem 3-19 Accessing Coordinates through Two Levels of Hierarchy The layout cellview CCC contains instance IB1 of layout cellview BBB, and instance IB1 contains instance IA1 of AAA. The named shape polyRect is in instance IA1. Instance IB1 is 3 units above and 6 units to the right of the coordinates 0:0. Instance IA1 is offset from the origin of IB1 by 6 units and 3 units. The shape polyRect is offset from the origin of IA1 by 3 units and 3 units, respectively. 66:3 polyRect Cellview BBB 6:3 X IA1 of AAA 9:6 X polyRect IA2 of AAA 69:6 X X 0:0 Y X Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 269 Product Version 5.0 Assign the value of the lowerLeft point handle for the shape polyRect to the local variable point1. What is the value of point1? Solution 3-19 Accessing Coordinates through Two Levels of Hierarchy on page 293. lowerLeft point handle is at 15:9 IB1 of BBB 6:3 X Cellview CCC 0:0 polyRect IA1 of AAA 15:9 X 12:6 X Y X Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 270 Product Version 5.0 rodIsFigNameUnused rodIsFigNameUnused( S_name [d_cvId] ) ; rodIsFigNameUnused => t | nil Description Determines whether the name specified by S_name is a valid name and whether it is already assigned to a ROD object, instance, or mosaic in the cellview specified by d_cvId. A valid name cannot contain hierarchy (indicated by one or more slashes) and cannot be an empty string. You might want to verify whether a name is already assigned before you attempt to assign it to a shape with the rodNameShape function. Arguments S_name Character string or symbol specifying the name you want to verify as valid and not assigned to a ROD object, instance, or mosaic in the specified cellview. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. This argument is required For example, you can type the characters testName as "testName" or as 'testName. Valid Values: any non-empty character string or symbol that does not contain a slash (/) Default: none d_cvId Database IDfor the cellviewin which you want to verify S_name. If the rodIsFigNameUnused statement occurs in the body of a pcDefinePCell function or tcCreateDeviceClass function call, the default value is pcCellView or tcCellView, respectively; otherwise, this argument is required. Default: none Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 271 Product Version 5.0 Return Values t The name is a valid name and is not assigned to a ROD object, instance, or mosaic in the cellview identified by d_cvId. nil The name is either already assigned to a ROD object, instance, or mosaic in the cellview identified by d_cvId or is not a valid name. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 272 Product Version 5.0 rodIsHandle rodIsHandle( R_rodObj S_name ) ; rodIsHandle => t | nil Description Determines whether the name specified for S_name identifies a valid system- or user- defined handle associated with the object specified by R_rodObj. Use this function prior to the rodGetHandle function when you want to verify that the handle exists before you try to access it. Arguments R_rodObj ROD object ID for the named object about which you are inquiring. This argument is required. Default: none S_name Character string or symbol specifying the name you want to verify as the name of a valid system- or user-defined handle for the object identified by R_rodObj. Enclose character strings in quotation marks (""); precede symbols with a single quotation mark ('). ROD converts symbols to character strings. This argument is required. Valid Values: any text string, enclosed in quotation marks Default: none Return Values t The name is a valid system- or user-defined handle for the object identified by R_rodObj. nil The name is not a valid system- or user-defined handle for the object identified by R_rodObj. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 273 Product Version 5.0 rodIsObj rodIsObj( g_object ) ; rodIsObj => t | nil Description Determines whether the object specified for g_object identifies a valid ROD object. This function is useful for testing variables and parameters to see if they contain a ROD object ID. For information about what happens to ROD object IDs when you do an Undo in a cellview, see “ROD object ID changes after Undo” on page 338. Arguments g_object Value of any data type. This argument is required. Default: none Return Values t The object is a valid ROD object. nil The object is not a valid ROD object. Examples The following examples show the results of using rodIsObj in several circumstances. Example 1 Using rodCreateRect to create a rectangle results in a ROD object, and the function returns the ROD object ID. Assigning the result to the variable rect sets rect equal to the ROD object ID. rect = rodCreateRect( ?cvId geGetEditCellView() ?layer "metal1" ) => rodObj:19984408 Using rodIsObj to test rect returns t, as the object is a ROD object: rodIsObj( rect ) t Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 274 Product Version 5.0 Example 2 Testing anything other than a valid ROD object ID, such as a number, returns nil: rodIsObj( 42 ) nil Example 3 As in Example 1, above, the variable rect contains the ROD object ID for the new rectangle: rect = rodCreateRect(?cvId cv ?name "r1" ?layer "metal1" ?width 5 ?length 10 ) ; end rodCreateRect => rodObj:23494680 Testing rect returns a ROD object ID: rect rodObj:23494680 Using rodIsObj to test rect returns t, as the object is a ROD object: rodIsObj( rect ) t However, if you select the ROD rectangle, move it, and then do an Undo, the variable rect no longer contains a ROD object ID. rect rod:invalid rodIsObj(rect) nil For more information about what happens when you do an Undo in a cellview that contains ROD objects, see “ROD object ID changes after Undo” on page 338. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 275 Product Version 5.0 rodNameShape rodNameShape( [?name S_name] ?shapeId d_shapeId [?permitRename g_permitRename] ) ; rodNameShape => R_rodObj | nil Description Assigns a name to an unnamed database shape or renames a ROD shape. Creates (or updates) a ROD object containing information associated with the shape, including its name and database ID. The associated ROD object is identified by a ROD object ID. Optionally, you can specify whether to rename an existing ROD object. Note: Instances and mosaics are not shapes. You cannot rename an instance or a mosaic with this function. You can refer to a named shape through hierarchy using its hierarchical name. You can also access system-defined handles associated with a named shape and create user-defined handles for a named shape. To assign a name to an unnamed shape, you must identify the shape by its database ID. You can specify a name that is unique within the cellview or let the system generate a name. If you attempt to assign a name to an object that already has a name, and the g_permitRename argument is set to nil, the system displays an error message. You can assign a property name and value, or list of property names and values, to the shape you are naming. For example, you could assign a Boolean property named myProp and a value of t or nil to the shape you are renaming. Before assigning a name, you might want to verify that the string is a valid name and that it has not already been used in the cellview. To do this, use the rodIsFigNameUnused function. Arguments S_name Character string or symbol specifying the name you want to assign to the shape. Enclose a character string in quotation marks (""); precede a symbol with a single quotation mark ('). ROD converts symbols to character strings. For example, to name an object polyrect, you can type the name as Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 276 Product Version 5.0 "polyrect" or as 'polyrect. The name must be unique for the cellview. The name cannot contain hierarchy, where hierarchy is indicated by one or more slashes. For example, at the lowest level in the hierarchy (zero-level), you can assign the name polyRect. You cannot assign a name with implied hierarchy, such as I1/I2/polyRect. When you do not specify a name, the system determines whether the shape is a rectangle, polygon, path, line, ellipse, donut, dot, label, and/or text-display object and assigns a name indicating the shape. For rectangles, the systemassigns rect0 to the first rectangle you name in the cellview, rect1 to the second, and so on. For polygons, the system assigns polygon0, polygon1, and so on; for paths, pathn. For an ellipse, donut, dot, line, label, and/or text-display object, the system assigns ellipsen, donutn, dotn, linen, labeln, or textn, respectively. For a shape other than these, the system issues a warning message and the function fails. Default: rectn, polygonn, pathn, ellipsen, donutn, dotn, linen, labeln, or textn, as determined by the system d_shapeId Database ID of unnamed shape or database ID of a ROD object (not the ROD object ID; instances and mosaics are not shapes.)This argument is required. g_permitRename A Boolean value specifying whether or not to rename the shape if it already has a name. The value must be t or nil. Default: nil Return Values R_rodObj ROD object ID for ROD object information associated with the newly named shape. nil An error occurred and no shape was named. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 277 Product Version 5.0 Naming Shapes Normally, you create named rectangles and paths using the rodCreateRect, rodCreatePolygon, and rodCreatePath functions, so you do not need to name them. But if you want to assign a name and create ROD object information for a shape that was created with a database function, such as dbCreateRect, dbCreatePolygon, or dbCreatePath, you can do so with the rodNameShape function and the database ID of the shape. The dbCreate functions return the database ID of the newly created shape. If you are working interactively in the Virtuoso® layout editor and the CIW and need the database ID for an unnamed shape, follow the steps below. Use variables to hold the value returned by each function. To get the database ID for a shape, do the following: 1. Select the shape in the layout cellview window. 2. To get the cellview ID for a selected shape in the active cellview window, type in the CIW cv = deGetCellView() 3. To return a list of the database IDs for the selected shapes (in this case, only one shape), type in the CIW: selset = geGetSelectedSet(cv) 4. To return the first element in the list (even though there is only one element), type in the CIW: dbId = car(selset) Problem 3-20 Naming a Polygon Created by dbCreatePolygon in a Pcell The polygon shown in this problem was created inside a pcell with the dbCreatePolygon function. The dbCreatePolygon function returns the database ID of the new polygon. In this problem, the polygon ID is stored in the variable polyDbId. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 278 Product Version 5.0 Verify that the name testName is a valid name and that it has not been used in the cellview. Then assign the name testName to the unnamed polygon. Use a variable to save the value returned by the rodNameShape function. Solution 3-20 Naming a Polygon Created in a Pcell on page 294 Problem 3-21 Naming a Shape Created in the CIW and Layout Window You are working interactively in a layout cellview window and the CIW. You used the layout editor to create the ordinary, unnamed rectangle. Assign the name rectA to the shape, using variables for values returned by functions. Solution 3-21 Naming a Shape Created in the CIW and Layout Window on page 294 0:0 Y X Unnamed polygon 0:0 Y X Unnamed shape Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 279 Product Version 5.0 rodPointX rodPointX( l_point ) ;end rodPointX => n_num | nil Description Returns the X coordinate of the point specified by l_point. Arguments l_point A set of coordinates in one of the following formats: x:y or list(x y). Default: none Return Values n_num A signed integer or floating-point number that is the X coordinate of the point specified by l_point. nil No coordinate was returned due to an error. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 280 Product Version 5.0 rodPointY rodPointY( l_point ) ;end rodPointY => n_num | nil Description Returns the Y coordinate of the point specified by l_point. Arguments l_point A set of coordinates in one of the following formats: x:y or list(x y). Default: none Return Values n_num A signed integer or floating-point number that is the Y coordinate of the point specified by l_point. nil No coordinate was returned due to an error. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 281 Product Version 5.0 rodSubPoints rodSubPoints( l_point1 l_point2 ) ;end rodSubPoints => l_point | nil Description Subtracts l_point2 from l_point1 and returns the resulting point as l_point. Arguments l_point1 A set of coordinates in one of the following formats: x:y or list(x y) Default: none l_point2 A set of points in one of the following formats: x:y or list(x y) Default: none Return Values l_point The point resulting from subtracting l_point2 from l_point1. nil No point was subtracted due to an error. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 282 Product Version 5.0 rodUnAlign rodUnAlign( R_rodObj1 [R_rodObj2] ) ;end rodUnAlign => t | nil Description When you specify only one ROD object ID, removes all alignments for the object specified. When you specify two ROD object IDs, removes only the alignment between the two objects. Arguments R_alignObj1 ROD object ID for the first or only object for which you want to remove alignments. When R_alignObj2 is specified, only the alignments between the two objects are removed. When R_alignObj2 is not specified, all alignments for R_alignObj1 are removed. This argument is required. Default: none R_alignObj2 ROD object ID for the second object for which you want to remove alignments. When specified, only the alignment between R_alignObj2 and R_alignObj1 are removed. Default: none Return Values t The alignment constraints were removed successfully. nil An error occurred and no alignment constraints were removed. Unaligning All Zero-Level Shapes in a Cellview To remove the alignments from all zero-level ROD shapes in a cellview, run the procedure shown below. This procedure does not remove alignments from shapes at levels in the hierarchy other than zero. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 283 Product Version 5.0 1. Set the variable cvId equal to the desired cellview ID by using your library name for library and your cell name for cell. cvId = dbOpenCellViewByType( "library" "cell" "layout" ) 2. Load the following procedure: ; ; ExUnAlignShapes -- removes alignments from all zero-level ROD ; shapes in cellview ; procedure( ExUnAlignShapes( cvId ) prog( ( shapelist shape rodId ) ; Get list of all shapes in cellview shapelist = cvId~>shapes if(shapelist then ; For each shape in cellview, get rodID foreach( shape shapelist if( rodId = rodGetObj( shape ) then ; The shape is a ROD object because the ROD ID ; is not nil; remove all associated alignments. rodUnAlign( rodId ) ) ;end if rodID ) ;end foreach ) ;end if shapelist ) ;end prog ) ;end procedure 3. Execute the procedure using the cellview ID: ExUnAlignShapes(cvId) Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 284 Product Version 5.0 rodUnNameShape rodUnNameShape( Rl_rodObj ) ; rodUnNameShape => t | nil Description Removes the name froma named shape or list of named shapes. The ROD object ID for the shape and all user-defined handles associated with it are deleted. If the object is an instance, the instance keeps its name but all user-defined handles associated with the instance are deleted. Also removes all alignment constraints that reference the shape. Arguments Rl_rodObj ROD object ID or list of ROD object IDs that identifies the named shape for which you want to remove the name. Default: none Return Values t The name(s) of the shape(s) was removed and all alignment constraints that reference the shape(s) were deleted. nil An error occurred and no changes were made to the shape(s). Unnaming All Named Shapes in a Cellview To remove the names from all named shapes in a cellview, run the procedure shown below. 1. Set the variable cvId equal to the desired cellview ID by using your library name for library and your cell name for cell. cvId = dbOpenCellViewByType( "library" "cell" "layout" ) 2. Load the following procedure: Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 285 Product Version 5.0 ; ; ExUnNameAll -- removes ROD names from all ROD objects in cellview ; procedure( ExUnNameAll( cvId ) prog( ( shapelist shape rodId ) ; Get list of all shapes in cellview shapelist = cvId~>shapes if( shapelist then ; For each shape in the cellview,get rodID foreach( shape shapelist rodId = rodGetObj( shape ) ; if it has a rodId (ie., is a ROD object) ; then remove it’s ROD name if( rodId then rodUnNameShape( rodId ) ) ;end if rodId ) ;end foreach ) ;end if shapelist ) ;end prog ) ;end procedure 3. Execute the procedure using the cellview ID: ExUnNameAll(cvId) Solutions to Problems Here are solutions to the problems presented in this chapter. Solutions for rodAlign on page 285 Solutions for rodCreateHandle on page 287 Solutions for rodCreatePath on page 288 Solutions for rodCreateRect on page 289 Solutions for rodGetObj on page 293 Solutions for rodAlign Solution 3-1 Aligning an Object to a Point rodAlign( ?alignObj rodGetObj("boundary") ?alignHandle "lowerLeft" ?refPoint 15:10 ) ;end of rodAlign Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 286 Product Version 5.0 For the rodGetObj function, you let the cellviewIDdefault to the local variable pcCellView, because the statement is in the body of pcell code. There is no separation between the lowerLeft point handle and the reference point because the txf_xSep and txf_ySep arguments defaulted to zero. You can align a named object directly to a specific point by specifying a value for the reference point argument l_refPoint. When you specify a reference point, you do not have to specify a reference object (R_refObj) and a reference handle (S_refHandle). If you specify a reference point and also specify a reference object (with or without specifying a reference handle), the value of the reference point overrides the values for reference object and reference handle. Return to Problem 3-1 Aligning an Object to a Point on page 150. Solution 3-2 Aligning Two Rectangles at the Same Level of Hierarchy cvId = deGetCellView() rodAlign( ?alignObj rodGetObj("polyRect" cvId) ?refObj rodGetObj("activeRect" cvId) ) ;end of rodAlign To get the ROD object IDs for polyRect and activeRect using the rodGetObj function, you need the cellview ID. The reference handle arguments (S_refHandle and S_alignHandle) default to the value centerCenter for both rectangles, so the center of polyRect is aligned to the center of the reference object activeRect. The txf_xSep and txf_ySep arguments default to zero, so the centers of the two rectangles are on the same point. The g_maintain argument defaults to t, so this alignment is maintained. Return to Problem3-2 Aligning Two Rectangles at the Same Level of Hierarchy on page 151. Solution 3-3 Moving an Object with rodAlign rodAlign( ?alignObj rodGetObj("boundary") ?alignHandle "lowerCenter" ?refObj rodGetObj("activeRect") ?refHandle "upperLeft" ?ySep 6.0 ?maintain nil ) ;end of rodAlign When you specify g_maintain as equal to nil, the alignment operation behaves like a move. No alignment information is saved after the rodAlign function completes. Return to Problem 3-3 Moving an Object with rodAlign on page 151. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 287 Product Version 5.0 Solution 3-4 Aligning Objects at Different Levels in the Hierarchy tfId = techGetTechFile( pcCellView ) rodAlign( ?alignObj rodGetObj("nTran1/rect0") ?alignHandle "centerRight" ?refObj rodGetObj("nTran2/rect0") ?refHandle "centerLeft" ?xSep "-techGetSpacingRule(tfId \"minSpacing\" \"metal1\")" ) ;end of rodAlign The rectangles were specified by their hierarchical names nTran1/rect0 and nTran2/ rect0. Separation along the Yaxis defaulted to zero. Separation along the Xaxis is negative, so the aligned object is moved to the left of the reference object by the distance specified in the minSpacing rule for the metal1 layer. The alignment will be maintained because the g_maintain argument defaulted to t. The techGetSpacingRule expression is enclosed in quotation marks so that whenever the minSpacing rule for the metal1 layer changes in your technology file, the system updates the alignment using the new rule. If you do not enclose the whole expression in double quotations marks, the systemevaluates the expression immediately and uses the result from then on. Be sure to include a backslash in front of each double quotation mark within the string to prevent the system from interpreting it as the end of the string. For more detailed information about accessing design rules, see “Using Design Rules in ROD Functions” on page 303. Return to Problem 3-4 Aligning Objects at Different Levels in the Hierarchy on page 152. Solutions for rodCreateHandle Solution 3-5a Creating a Point Handle for a Cellview cvId1 = dbOpenCellViewByType( "cellLib" "AAA" "layout" ) rodId = rodGetObj( "" cvId1 ) rodCreateHandle( ?name "originAAA" ?type "point" ?value 0:0 ?rodObj rodId ) ; end rodCreateHandle First, you need the ROD object ID for the cellview, and to get it, you need the cellview ID. You can use dbOpenCellViewByType to get the cellview ID. Get the ROD object ID for the cellview with rodGetObj, where the name of the cellview is represented by a null string. Return to Problem 3-5a Creating a Point Handle for a Cellview on page 177. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 288 Product Version 5.0 Solution 3-5b Querying a Point Handle for a Cellview cvId2 = dbOpenCellViewByType( "cellLib" "BBB" "layout" ) rodId = rodGetObj( "IA1" cvId2 ) origin = rodID~>originAAA or origin = rodGetObj( "IA1" cvId2 )~>originAAA First, get the ID for cellview BBB. Then either set a variable equal to the ROD object ID for cellview BBB and query the variable, or performboth actions in a single statement. The value of originAAA in the coordinate system of cellview BBB is 3:3. Return to Problem 3-5b Querying a Point Handle for a Cellview on page 178. Solution 3-6 Querying a System-Assigned Handle Name cvId = dbOpenCellViewByType( "cellLib" "myCell" "layout" ) rodId = rodGetObj( "" cvId ) rodId~>userHandleNames You can use the database access operator (~>) and the ROD object ID to query the value of ROD object attributes. The last name assigned by the system to a user-defined handle is at the end of the list of user handle names. Return to Problem 3-6 Querying a System-Assigned Handle Name on page 178. Solutions for rodCreatePath Solution 3-7 Create a Multipart Path with an Offset Subpath on the Right rodCreatePath( ?name "p1" ?layer "nwell" ?width 0.6 ?pts list(2:2 8:2 8:6 10:6) ?endType "flush" ?offsetSubPath list( list( ?layer "metal2" ?width 0.8 ?justification "right" ?sep 1.0 ) ; end of sublist ) ; end of offset subpath list ) ; end rodCreatePath Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 289 Product Version 5.0 For both the master path and the offset path, the layer purpose defaults to drawing. The master path is choppable because g_choppable defaults to t. Because S_justification is set to right, the offset subpath appears on the right side of the master path, relative to the direction of the master path. Return to Problem3-7 Create a Master Path with an Offset Subpath to the Right on page 205. Solutions for rodCreateRect Solution 3-8 Create One Rectangle with n_width and n_length tfId = techGetTechFile( pcCellView ) rodCreateRect( ?name "minMetal" ?width 3 ?layer "metal1" ?length 2 * techGetSpacingRule( tfId "minWidth" "metal1" ) ) ; end of rodCreateRect The layer purpose defaults to drawing. To use minimum width in a calculation, you must refer to the technology file rule for minimum width directly. Do this by using the techGetSpacingRule function with the standard user-defined name for minimum width, minWidth, and the layer name, metal1. Let the origin of the rectangle default to 0:0. Return to Problem 3-8 Create One Rectangle with n_width and n_length on page 247. Solution 3-9 Create One Rectangle with l_bBox tfId = techGetTechFile( pcCellView ) rodCreateRect( ?name "minMetal" ?bBox list( 2:2 8:5 ) ?layer "metal1" ) ; end of rodCreateRect The rectangle is 6 by 3 with its origin at 2:2, and the upper-right corner is at 8:5. Return to Problem 3-9 Create One Rectangle with l_bBox on page 247. Solution 3-10 Create a Single Row or Column of Rectangles rodCreateRect( ?name "minMetal" ?layer "metal1" Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 290 Product Version 5.0 ?elementsX 9 ) ; end of rodCreateRect Because the rectangle width and space between rectangles was not specified, the system automatically retrieves the minimum width and minimum design rules for the metal1 layer from your technology file. Return to Problem 3-10 Create a Multipart Rectangle with One Row/Column of Master Rectangles on page 248. Solution 3-11 Create Multiple Rows and Columns of Rectangles tfId = techGetTechFile( pcCellView ) rodCreateRect( ?name "polyRect" ?layer "poly" ?elementsX 5 ?elementsY 4 ?origin list( 3 6 ) ?spaceX techGetSpacingRule( tfId "minSpacing" "poly" ) + 3 ?spaceY techGetSpacingRule( tfId "minSpacing" "poly" ) + 6 ) ; end of rodCreateRect For rectangle size, let the system use the minimum width for the poly layer from the technology file for both width and length. Set a local variable equal to the technology file ID. Use the techGetSpacingRule function to get the minimum space between rectangles for the poly layer. Let the cellview ID default to the variable pcCellView, because the statement is executed inside of a pcell. Return to Problem3-11 Create a Multipart Rectangle with Multiple Rows/Columns of Master Rectangles on page 249. Solution 3-12 Fill a Bounding Box with Rectangles rodCreateRect( ?name "polyRect" ?layer "poly" ?fillBBox list( 2:2 20:12 ) ?spaceX 2.0 ) ; end of rodCreateRect Let the rectangle width and length default to the minimum design rules in the technology file for the poly layer and the distance between rectangles along the Y axis default to the value of the n_spaceX argument. The layer purpose defaults to drawing. Return to Problem 3-12 Fill a Bounding Box with Master Rectangles on page 250. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 291 Product Version 5.0 Solution 3-13 Partially Fill a Bounding Box with Rectangles tfId = techGetTechFile( pcCellView ) rodCreateRect( ?fillBBox list( 0:0 18:10 ) ?layer list( "metal1" "drawing" ) ?elementsX 3 ?elementsY 2 ?bBox list( list(0 0) list(2 2)) ?spaceY techGetSpacingRule( tfId "minSpacing" "metal1" ) ?spaceX techGetSpacingRule( tfId "minSpacing" "metal1" ) * 2 ) ; end of rodCreateRect This is the first time rectangles were created in the cellview, so the names of the rectangles default to rect0.x.y. The system did not use the values for l_bBox to determine the location of the first rectangle because using the l_fillBBox argument always causes the first rectangle to be placed in the lower-left corner of the fill-bounding box. Use the techGetSpacingRule function to retrieve the minimumdesign rule for the metal1 layer. Return to Problem 3-13 Partially Fill a Bounding Box with Master Rectangles on page 251. Solution 3-14 Overfill a Bounding Box with Rectangles rodCreateRect( ?fillBBox list( 0:0 18:10 ) ?layer "metal1" ?elementsX 6 ?elementsY 4 ?spaceX 2.5 ?spaceY 2.0 ) ; end of rodCreateRect This is the second time rectangles were created in the cellview, so the names of the rectangles default to rect2.x.y. When you use the l_fillBBox argument, the system always places the first rectangle in the lower-left corner of the fill-bounding box. The width and length of the rectangles defaults to the minimum width for the metal1 layer from the technology file, which is 2.0. The number of rectangles specified with the n_elements arguments, combined with the distance between them, exceeds the space in the fill-bounding box, so the system creates only as many rectangles as fit inside the box. In this case, the system creates four columns and three rows of rectangles. Return to Problem 3-14 Overfill a Bounding Box with Master Rectangles on page 251. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 292 Product Version 5.0 Solution 3-15 Create a Single Rectangle on a Terminal and Net rodCreateRect( ?name "termFig" ?layer "metal1" ?termName "Aout" ?termIOType "output" ) ; end of rodCreateRect The layer purpose defaults to drawing. The origin of the rectangle defaults to 0:0. The rectangle termFig is now associated with the terminal and net Aout. Return to Problem 3-15 Create a Single Named Rectangle on a Terminal and Net on page 252. Solution 3-16 Create a Rectangular Pin tfId = techGetTechFile( pcCellView ) localMinWidth = techGetSpacingRule( tfId "minWidth" "poly" ) ptUR = rodGetObj( "trans1" )~>upperRight rodCreateRect( ?name "polyPin" ?pin t ?termName "InOut0" ?layer list( "poly" "pin" ) ?pinLabel t ?bBox list( list( rodPointX( ptUR ) - localMinWidth rodPointY( ptUR ) - localMinWidth ) ; list for value of lower-left corner ptUR ; value of upper-right corner ; end of bBox list of points ) ; end of rodCreateRect First, the technology file ID is set equal to the variable tfId, and the local variable localMinWidth is set equal to the minimumwidth rule fromthe technology file for the poly layer. Then, the local variable ptUR is set equal to the coordinates of the upper-right corner of the bounding box around the object trans1, using the rodGetObj function. The upper- right corner of the pin has the same coordinates. In the rodCreateRect statement, set the g_pin argument to t for true to create a pin. Let the pin access direction default to inputOutput. Set g_pinLabel to t to create a pin text- display label. The text of the label is the contents of the S_termName argument, InOut0. The location of the origin of the text-display label defaulted to centerCenter. Next, compute the coordinates for the lower-left corner of the pin bounding box as follows: I To compute the X coordinate, use the rodAddToX function to subtract the minimum width for the poly layer from the X coordinate of ptUR. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 293 Product Version 5.0 I To compute the Y coordinate, use the rodAddToY function to subtract the minimum width for the poly layer from the Y coordinate of ptUR. For the upper-right corner of the pin bounding box, use the value of the ptUR variable, the same point as the upper-right corner of trans1. Return to Problem 3-16 Create a Rectangular Pin on page 253. Solutions for rodGetObj Solution 3-17 Accessing Coordinates without Hierarchy cv = dbOpenCellViewByType( "rodTestLib" "AAA" "layout" "maskLayout" "a" ) point1 = rodGetObj( "polyRect" cv )~>lowerleft There is no hierarchy in layout cellview AAA. First, you used the database function dbOpenCellViewByType to get the cellview ID for AAA. Then you got the RODobject IDfor the object polyRect and used the database access operator (~>) to retrieve the system-defined point handle for the lower-left corner. The lowerLeft point handle is at 3:3, so point1 = 3:3. Return to Problem 3-17 Accessing Coordinates without Hierarchy on page 267. Solution 3-18 Accessing Coordinates through One Level of Hierarchy cv = dbOpenCellViewByType( "rodTestLib" "BBB" "layout" "maskLayout" "a" ) point1 = rodGetObj( "IA1/polyRect" cv )~>lowerLeft point2 = rodGetObj( "IA2/polyRect" cv )~>lowerLeft There is one level of hierarchy. The coordinates of the lower-left corner of polyRect are 9:6 for instance IA1 and 69:6 for instance IA2, so point1 = 9:6 and point2 = 69:6. Return to Problem3-18 Accessing Coordinates through One Level of Hierarchy on page 267. Solution 3-19 Accessing Coordinates through Two Levels of Hierarchy cv = dbOpenCellViewByType( "rodTestLib" "CCC" "layout" "maskLayout" "a" ) point1 = rodGetObj( "IB1/IA1/polyRect" cv )~>lowerLeft Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 294 Product Version 5.0 There are two levels of hierarchy. The coordinates of the lower-left corner of polyRect are 15:9, so point1 = 15:9. Return to Problem 3-19 Accessing Coordinates through Two Levels of Hierarchy on page 268. Solutions for rodNameShape Solution 3-20 Naming a Polygon Created in a Pcell cvId = deGetCellView() testName = "abcde" rodId = if( rodIsFigNameUnused( testName cvId ) then rodNameShape( ?name testName ?shapeId polyDbId ) ;end rodNameShape ) ;end if To verify whether the name testName has already been used in the cellview, you need the cellview ID. The local variable polyDbId was set equal to the database ID for the polygon when it was created, so you can use polyDbId in your rodNameShape statement. You can specify a name as a character string enclosed in quotation marks or as a symbol preceded by a single quotation mark ('). The rodNameShape function returns the ROD object ID for the shape you named. Return to Problem 3-20 Naming a Polygon Created by dbCreatePolygon in a Pcell on page 277. Solution 3-21 Naming a Shape Created in the CIW and Layout Window cvId = deGetCellView() selSet = geGetSelectedSet(cvId) dbId = car(selSet) rectRodId = rodNameShape(?name "rectA" ?shapeId dbId) First, you must select the unnamed shape in the active cellviewwindowby clicking on it. Then, get the cellview ID (cvId) using deGetCellView(). Use cvId with geGetSelectedSet to return a list of the database IDs for all objects in the selected set (in this case, just one object). Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 295 Product Version 5.0 Use the variable containing the list of database IDs (selSet) with the car Cadence ® SKILL language function to get the first database ID in the list (dbId). Use dbId to identify the shape you want to rename with rodNameShape. Return to Problem 3-21 Naming a Shape Created in the CIW and Layout Window on page 278. Virtuoso Relative Object Design User Guide Using Relative Object Design Functions July 2002 296 Product Version 5.0 Virtuoso Relative Object Design User Guide July 2002 297 Product Version 5.0 A Using Environment Variables with ROD There are a number of environment variables that influence how Virtuoso ® relative object design (ROD) functionality works. The following table describes these environment variables. Table A-1 Environment Variables That Influence ROD Variable Default Description constraintAssistedMode t Virtuoso ® XL Layout Editor environment variable that controls Constraint Assisted Mode. When on, you cannot edit stretchable pcells by stretching their handles. To stretch pcell handles, turn it off. You can turn it off on the Layout XL Options form. displayStretchHandles t Boolean graphic and Virtuoso ® layout editor environment variable that controls whether stretch handles are displayed in layout cellviews. preserveAlignInfoOn t Boolean ROD environment variable specifying whether alignment between ROD objects is preserved or broken when a ROD object is moved or modified. readCellviewWarningOn nil Boolean ROD environment variable specifying whether, when you open a cellview containing aligned ROD objects in read-only mode, the system displays a warning in the CIW stating that alignments in the design data might not be current. Virtuoso Relative Object Design User Guide Using Environment Variables with ROD July 2002 298 Product Version 5.0 For a description of how to set graphic editor and layout editor environment variables, see “Environment Variable Functions” in the Custom Layout SKILL Functions Reference. For a description of the XL environment variables, see “Setting Environment Variables” in the Virtuoso XL Layout Editor User Guide. rodAutoName none String layout editor environment variable specifying whether rectangles, polygons and/or shape pins are created as ROD objects. You can assign a name to the shape in the Create formor let the systemassign a name. Specify one or more of the following valid values: rectangle, polygon, or pin stretchHandlesLayer y0 drawing String graphic editor environment variable that controls the layer and purpose for displaying stretch handles. The default is the y0 layer and drawing purpose. traceTriggerFunctionsOn nil Boolean ROD environment variable controls the printing of trace messages for debugging. You might turn on this variable when you encounter a problem that requires customer support. updatePCellIncrement Every grid snap Floating-point layout editor environment variable that controls how often the system updates pcell parameters and regenerates the pcell during a stretch operation. The default is at every grid snap, as defined by the technology file variable mfgGridResolution. Table A-1 Environment Variables That Influence ROD, continued Virtuoso Relative Object Design User Guide Using Environment Variables with ROD July 2002 299 Product Version 5.0 Checking the Value of a ROD Environment Variable To determine the current value of an environment variable, ➤ Type in the CIW envGetVal( "rod" "variable_name" ) For example: envGetVal( "rod" "preserveAlignInfoOn" ) How the System Evaluates ROD Environment Variables The system looks for the value of a ROD environment variable as follows: 1. First, the system looks in the local .cdsenv file in your home directory, ~/.cdsenv 2. If the variables are not defined in your ~/.cdsenv file, the system looks for the system- defined default settings in the following file: install_dir/etc/tools/rod/.cdsenv Changing the Settings of ROD Environment Variables You can change the default settings of ROD environment variables in the CIWor in your local ~/.cdsenv file, as described below. Changing Settings for Environment Variables in the CIW To change the value of an environment variable temporarily, do the following: ➤ In the CIW, set the value of the variable with the following statement: envSetVal("rod" "variable_name" ‘data_type value) where variable_name is the name of the variable. The backwards tick mark ( ‘ ) in front of data_type is necessary. It tells the system not to interpret the value of the argument, but to use it literally, as a data type. For example: envSetVal("rod" "preserveAlignInfoOn" ‘boolean nil) Virtuoso Relative Object Design User Guide Using Environment Variables with ROD July 2002 300 Product Version 5.0 Changing Settings for Environment Variables in ~/.cdsenv You can add ROD environment variables to the .cdsenv file in your home directory by typing them or by copying them from the .cdsenv file in the samples directory in your Cadence hierarchy. Note: Do not copy lines from the rod/.cdsenv file to the .cdsenv file in your home directory. The file formats are slightly different, so the lines that result from copying do not work. The ROD environment variable settings should look like this in your ~/.cdsenv file: rod preserveAlignInfoOn boolean value rod traceTriggerFunctionsOn boolean value where value is equal to t or nil. If you do not have a .cdsenv file in your home directory, you can copy the .cdsenv file from the samples directory in your local Cadence hierarchy to your home directory and modify it. Copying Variables from the Samples Directory to ~/.cdsenv To copy ROD environment variables from the samples directory to the ~/.cdsenv file in your home directory, do the following: 1. In one window, open your ~/.cdsenv file. 2. In another window, open install_dir/dfII/samples/.cdsenv where install_dir is the path to your Cadence hierarchy. 3. In the samples/.cdsenv file, search for rod and then for the variable name, such as preserveAlignInfoOn. 4. Copy the setting for the ROD environment variable and paste it into the .cdsenv file in your home directory. 5. If desired, change the setting. 6. Save your ~/.cdsenv file. 7. To use the settings in future sessions, save the settings with Save Defaults on the Options menu in the CIW. Virtuoso Relative Object Design User Guide July 2002 301 Product Version 5.0 B Accessing the Cellview ID You do not need to supply the cellview ID as an argument when you execute a Virtuoso ® relatvie object design (ROD function within the body of a pcDefinePCell statement or within the body of a tcCreateDeviceClass function call. The cellview ID defaults to the local variable pcCellView or tcCellView, respectively. You need to specify the cellview ID when you execute a ROD function in the command interpreter window (CIW). You can get the cellview ID fromthe active cellview window or from the database, without opening a cellview window. Getting the Cellview ID To get the cellview ID, do one of the following: ➤ To get the cellview ID for the cellview in the active open cellview window, type the following: cvId = deGetCellView() ➤ To get the cellview ID without opening a cellview window, type the following: cvId = dbOpenCellViewByType( "myLib" "myCell" "layout" "r" ) where myLib is your library name, myCell is your cellview name, layout is the view type, and r sets the mode to read-only. The cellview will be opened only in the database, not in a window. For more information on the dbOpenCellViewByType command, see “Data Access” in the Cadence Design Framework II SKILL Functions Reference. Virtuoso Relative Object Design User Guide Accessing the Cellview ID July 2002 302 Product Version 5.0 Virtuoso Relative Object Design User Guide July 2002 303 Product Version 5.0 C Using Design Rules in ROD Functions You might want to use design rules defined in your technology file as the values of some arguments of Virtuoso ® relative object design (ROD) functions. You can let the value of an argument such as n_width default to a design rule, or you can access your technology file more directly by using the techGetTechFile, techGetSpacingRule, or another technology file function. Using Design Rules for Default Values When you do not specify values for the keyword arguments listed below, the system automatically assigns a default, as described in the “Arguments” section for the RODfunction: n_width n_length n_spaceX n_spaceY n_enclosure The default is often the value of a design rule from the technology file. Using the rodCreateRect function as an example, when you do not specify a value for n_length, the systemassigns the value specified for n_width. If you specified neither n_length nor n_width, the system looks in the technology file associated with your cellview for the minimumwidth rule for the specified layer, using the standard name minWidth, and assigns its value to both n_length and n_width. In this case, you do not have to specify the technology file ID or the technology file name. As long as minWidth for the layer is defined in the technology file for your library, the system can find it automatically using the cellview ID. The names for variables representing design rules are user defined; however, assigning standard names, such as minWidth, maxWidth, minSpacing, and maxSpacing, is a good practice. If your design rules do not have standard names, you must access your design rules using a technology file function, such as techGetSpacingRule. Virtuoso Relative Object Design User Guide Using Design Rules in ROD Functions July 2002 304 Product Version 5.0 Accessing Design Rules with techGetSpacingRule You can access design rules from your technology file with the techGetSpacingRule function. You must specify the technology file ID, layer name, and the name of the design rule. You can get the technology file ID with the techGetTechFile function, which requires the cellview ID or library ID. For example, say you want to access the minimum design rule for the metal1 layer, and the name of your minimum width rule is minWidth. You can access minWidth in one of the ways shown below. I To get value of the technology file ID and store it in a variable, type the following: tfId = techGetTechFile( d_cellViewId ) techGetSpacingRule( tfId "minWidth" "metal1" ) I To get value of the technology file ID without storing it in a variable, combine both functions in one statement, as follows: techGetSpacingRule( techGetTechFile( d_cellViewId ) "minWidth" "metal1" ) If the techGetSpacingRule function returns nil, either minWidth is not defined for the metal1 layer or the technology file does not exist. For more information about technology file design rules, see “Physical Rules SKILL Functions” in the Technology File and Display Resource File SKILL Reference Manual. Virtuoso Relative Object Design User Guide July 2002 305 Product Version 5.0 D Displaying Pin Names in a Layout Window To see terminal names for pins in a layout window, the display setting for pin names must be turned on. You can turn on the display of pin names for just the duration of your editing session, or you can change the default. I To temporarily turn on Pin Names display, use the Display Options form in a layout window and then apply the changes, but do not save them. I To change the default for the display of pin names, either edit your local .cdsenv file or turn on Pin Names option in the Display Options form and save the changes. Setting the Pin Names Environment Variable in .cdsenv To display terminal names for pins by setting the displayPinNames environment variable in the .cdsenv file in your home directory, do the following: 1. Use a text editor to edit your ~/.cdsenv file. 2. Search for layout. 3. Search for displayPinNames. By default, the setting looks like this: layout displayPinNames boolean nil 4. Change nil to t so that the setting looks like this: layout displayPinNames boolean t 5. Save your file and start the Virtuoso ® layout editor. Turning on Pin Names in the Display Options Form To display terminal names for pins by setting the Pin Names option in a layout window, do the following: 1. In your layout window, choose Options – Display. Virtuoso Relative Object Design User Guide Displaying Pin Names in a Layout Window July 2002 306 Product Version 5.0 The Display Options form appears. 2. In the Display Options form, make sure the Pin Names option is on. You can apply your settings to just the current editing session or save themto the current cellview or as a file. 3. Apply or save your Display Option settings by doing one of the following: ❑ To apply your settings to the current editing session only, click on OK in the Display Options form. When you save display settings to a cellview, the settings are automatically applied when you reopen the cellview. ❑ To save your settings with the cellview, turn on Cellview and click on Save To; then click on OK. When you save to your ~/.cdsenv file (the default file), the settings automatically load when the layout editor starts. Pin Names option is on. 1. Turn on Cellview. 2. Click on Save To. Virtuoso Relative Object Design User Guide Displaying Pin Names in a Layout Window July 2002 307 Product Version 5.0 ❑ To save your settings in your ~/.cdsenv file, turn on File and click on Save To, then click on OK. To save in ~/.cdsenv file, turn on the File option. 2. Click on Save To. Virtuoso Relative Object Design User Guide Displaying Pin Names in a Layout Window July 2002 308 Product Version 5.0 Virtuoso Relative Object Design User Guide July 2002 309 Product Version 5.0 E How Virtuoso Layout Editor Works with ROD Objects The following tables summarize the level of support for how Virtuoso ® layout editor commands work on relative object design (ROD) objects in the current release. Using commands that are not fully supported for ROD objects could cause the objects to lose the ROD information associated with them, changing the objects into ordinary shapes. Note: ROD functionality is not implemented for mosaics. Table E-1 Virtuoso Layout Editor Creation Commands Create Command Degree of ROD Support Rectangle... r Create and name new rectangles as ROD objects using the Create Rectangle form. Polygon... P Create and name new polygons as ROD objects using the Create Polygon form. Path... p Create and name paths as ROD objects using the Create Path form. Multipart Path... Create and name new multipart paths as ROD objects using the Create Multipart Path form. This form lets you choose a template from your technology file, load templates from an ASCII file, and save form values as a template in your technology file (if you have write permission) or in an ASCII file. Label... l You cannot create a label as a ROD object. However, you can make an existing label a ROD object by assigning it a name with the rodNameShape function. Instance... i An instance is automatically a ROD object because it has a unique name. The ROD object name is the same as the instance name. Virtuoso Relative Object Design User Guide How Virtuoso Layout Editor Works with ROD Objects July 2002 310 Product Version 5.0 Pin... ^p Create and name new pins as ROD objects using the Create Pin Shape form. Pins From Labels... You cannot create a pin from a label as a ROD object. However, you can make an existing pin a ROD object by assigning it a name with the rodNameShape function. Contact... o A symbolic contact is automatically a ROD object because it is an instance and has a unique name. The ROD object name is the same as the instance name. Device... A symbolic device is automatically a ROD object because it is an instance and has a unique name. The ROD object name is the same as the instance name. Conics Circle Circles are supported as ROD objects. However, there is no user interface for naming a circle; use the rodNameShape function. Ellipse Ellipses are supported as ROD objects. However, there is no user interface for naming an ellipse; use the rodNameShape function. Donut Donuts are supported as ROD objects. However, there is no user interface for naming a donut; use the rodNameShape function. Layer Generation... You cannot create a shape using a layer generation operation as a ROD object. However, you can make a generated shape a ROD object by assigning it a name with the rodNameShape function. Table E-2 Virtuoso Layout Editor Editing Commands Edit Command Degree of ROD Support Undo u The Undo command fully supports ROD objects. Redo U The Redo command fully supports ROD objects. Table E-1 Virtuoso Layout Editor Creation Commands, continued Virtuoso Relative Object Design User Guide How Virtuoso Layout Editor Works with ROD Objects July 2002 311 Product Version 5.0 Move m Moving ROD objects is supported as follows: I You can move a ROD object within the same cellview or to another cellview. I Within the same cellview, moving a ROD object that has other objects aligned to it causes the aligned objects to move as well. I When you move a ROD object between cellviews, and the RODobject is aligned to another RODobject(s), the system preserves alignment only when the aligned ROD object(s) is also in the selected set; otherwise the alignment is broken. I Avoid rotating aligned ROD objects during a move because the aligned handle names are not updated after the move, so the results might not be what you want. Copy c Copying ROD objects is supported as follows: I You can copy a ROD object within the same cellview or to another cellview. The system automatically assigns unique names to the copies. I Alignments between ROD objects in the selected set result in alignments between the corresponding copy objects. I Alignments to objects not in the selected set are ignored. I You can copy a whole multipart path (MPP) or a whole multipart rectangle (MPR), but not an individual subpart of an MPP or MPR. Stretch s The Stretch command fully supports ROD objects, including stretchable parameterized cells (pcells). Reshape R Except for multipart paths and multipart rectangles, all reshapable ROD objects remain ROD objects after a Reshape operation. When you reshape any ROD object, all alignments to that object are deleted. Table E-2 Virtuoso Layout Editor Editing Commands Virtuoso Relative Object Design User Guide How Virtuoso Layout Editor Works with ROD Objects July 2002 312 Product Version 5.0 Delete del The Delete command fully supports ROD objects. When you delete using the Net Interconnect option, all ROD objects on the selected net are deleted, except for pins. For multipart paths (MPP) and multipart rectangles (MPR), when the master path or master rectangle is on the selected net, the MPP or MPR and all subparts are deleted; otherwise, no part of the MPP or MPR is deleted. When you delete a segment of an MPP with the Path Segment option, the remaining segments of the MPP become two separate multipart paths, each with its own name. Properties... q You can use the Edit Properties command for ROD objects to: I View system-defined and user-defined handle names and handle values I View alignments for the selected ROD object I Modify the X and Y separation between the selected ROD object and other ROD objects. Search... S You can search for any ROD object by name, including rectangles, paths, polygons, and text display objects. Merge M Merge is not supported for ROD objects. When ROD objects are merged, the resulting shape is not a ROD object. Select All ^a The Select All command fully supports ROD objects. Deselect All ^d The Deselect All command fully supports ROD objects. Hierarchy: Make Cell... The Make Cell command fully supports ROD objects. Table E-2 Virtuoso Layout Editor Editing Commands Virtuoso Relative Object Design User Guide How Virtuoso Layout Editor Works with ROD Objects July 2002 313 Product Version 5.0 Flatten The Flatten command fully supports ROD objects. To preserve the attributes of ROD objects (such as object name, alignments, multipart path subparts, and master rectangles in multipart rectangles), turn on the Preserve ROD Objects button in the Flatten form. When this option is off, ROD objects become ordinary unnamed objects, the subparts of multipart paths become ordinary paths and rectangles, and the master rectangles in multipart rectangles become ordinary, unnamed rectangles. The system assigns the flattened object a name based on the hierarchical name of the ROD object by replacing slashes with dashes. For example, when you flatten the ROD object I1/I4/ rect3, the resulting object is named I1-I4-rect3. Other Chop Most shapes lose ROD attributes when they are chopped. For multipart paths, the effect of a chop depends on what parts are choppable and how you chop them. For details, see “Chopping Multipart Paths” on page 86. When you chop the master rectangle of a multipart rectangle, all subrectangles are deleted and the shapes resulting from chopping the master rectangle are regular, unnamed database shapes. When you chop any ROD object, all alignments to that object are deleted. Modify Corner... The Modify Corner command supports ROD polygons and ROD rectangles, except for master rectangles that are a part of a multipart rectangle. Size... The Size command supports ROD objects. However, when you size a multipart path (MPP), the master path becomes a ROD polygon and inherits its name from the original MPP; all subparts become ordinary, unnamed database shapes. When you size any ROD object, all alignments to that object are deleted. Split ^s Except for ellipses, circles, donuts, multipart paths, and multipart rectangles, ROD objects remain ROD objects after a split operation. When you split any ROD object, all alignments to that object are deleted. Table E-2 Virtuoso Layout Editor Editing Commands Virtuoso Relative Object Design User Guide How Virtuoso Layout Editor Works with ROD Objects July 2002 314 Product Version 5.0 Attach/Detach v The Attach/Detach commands fully support ROD objects. Convert To Polygon The Convert To Polygon command fully supports ROD objects, except for rectangles and multipart rectangles. The Convert To Polygon command has no affect on rectangles and multipart rectangles. When you convert a multipart path, the polygon resulting from the master path is a ROD object and takes the name of the multipart path. Subparts, if any, become unnamed, ordinary database shapes (paths and rectangles). Subparts are not converted to polygons. When you convert any ROD object (except rectangles and multipart rectangles) to a polygon, all alignments to the converted object are deleted. Move Origin The Move Origin command fully supports ROD objects. Rotate... O With the exception of multipart rectangles the Rotate command supports the rotation of ROD objects, unless there are alignments. Avoid rotating aligned ROD objects because aligned handle names are not updated after the rotation, so the results might not be what you want. For multipart rectangles with subrectangles offset from the master rectangle corners, avoid rotation unless the offsets are all equal. The Rotate command does not rotate these offsets. Do not rotate chopped multipart paths as the chop holes might not rotate correctly. If you want to chop and rotate an MPP, rotate the MPP first, then chop it. Yank y The Yank command does not support ROD objects. The Yank command copies only the shapes, but not the names of the shapes or the alignments. When you paste, the result is unnamed, unaligned, non-ROD shapes. Paste Y The Paste command does not support ROD objects. If you yank and paste ROD objects, the result is unnamed, unaligned, non-ROD shapes. Table E-2 Virtuoso Layout Editor Editing Commands Virtuoso Relative Object Design User Guide July 2002 315 Product Version 5.0 F Code Examples The examples in this appendix show how you might use Virtuoso® relative object design (ROD) functions to create some commonly used devices. Using ROD to Create Multipart Paths Creating a Bus on page 316 Creating a Contact Array on page 318 Creating a Guard Ring on page 319 Creating a Shielded Path on page 322 Creating a Transistor on page 323 Using Stretchable Pcells Stretchable MOS Transistor on page 329 Virtuoso Relative Object Design User Guide Code Examples July 2002 316 Product Version 5.0 Creating a Bus ;; Create a bus with 7 offset subpaths procedure( bus(cv layer) (let (tfId layerWidth layerSpace) tfId = techGetTechFile(cv) layerWidth = techGetSpacingRule(tfId "minWidth" layer) layerSpace = techGetSpacingRule(tfId "minSpacing" layer) rodCreatePath( ?name "bus" ?layer layer ?pts list(20:-20 40:-20 40:-30 80:-30) ?width layerWidth ?justification "center" ?cvId cv ?offsetSubPath list( list( ?layer layer ?justification "left" ?sep layerSpace ) ;end subpath1 list( ?layer layer ?justification "left" ?sep (layerSpace * 2) + layerWidth ) ;end subpath2 list( ?layer layer ?justification "left" ?sep (layerSpace * 3) + (layerWidth * 2) ) ;end subpath3 list( Virtuoso Relative Object Design User Guide Code Examples July 2002 317 Product Version 5.0 ?layer layer ?justification "left" ?sep (layerSpace * 4) + (layerWidth * 3) ) ;end subpath4 list( ?layer layer ?justification "left" ?sep (layerSpace * 5) + (layerWidth * 4) ) ;end subpath5 list( ?layer layer ?justification "left" ?sep (layerSpace * 6) + (layerWidth * 5) ) ;end subpath6 list( ?layer layer ?justification "left" ?sep (layerSpace * 7) + (layerWidth * 6) ) ;end subpath7 ) ;end list of lists ) ;end rodCreatePath ) ; end of let ) ; end of procedure Virtuoso Relative Object Design User Guide Code Examples July 2002 318 Product Version 5.0 Creating a Contact Array ;; Create a contact array procedure(buildCnts(cv layer1 layer2 layer3 width1 width3 length3 pathpnts terminal pinlabel enc offset chop) ; pinlabel is a boolean that determines whether a label will be ; created let( ( fig ) fig = rodCreatePath( ?cvId cv ?layer layer1 ?width width1 ?pts pathpnts ?encSubPath list( list( ?layer layer2 ?enclosure enc ?choppable chop ?pin t ?termName terminal ?pinLabel pinlabel ?pinLabelHeight length3 ?pinLabelLayer "text" ) ;end enc sublist1 ); end enc list ?subRect list( list( ?layer layer3 ?width width3 ?length length3 ?endOffset offset ) ;end rect sublist1 ) ;end subRect list ) ;end rodCreatePath ) ;end of let ) ;end of procedure Virtuoso Relative Object Design User Guide Code Examples July 2002 319 Product Version 5.0 Creating a Guard Ring ;; Create guard ring ;; ;; This procedure is an example of how to create a guardring ;; interactively with the layout editor.This code builds ;; three types of guardrings: ndiff, pdiff, and poly. ;; Please do the following using this code: ;; 1. Copy acpd.tf and display.drf to your library directory. ;; 2. In the CIW, use Technology File->New to create a new technology ;; library named "acpd", using the ASCII technology file "acpd.tf" ;; as input. ;; 3. Load the file "guardring.exp" in the CIW. ;; The arguments for this procedure are all optional. ;; If you specify no arguments, the guardring defaults to ndiff. ;; The system prompts you for coordinates and you draw the guardring ;; in the current open window. ;; Optionally, you can also specify the type of material and ;; cellview ID, and you can pass in a pointlist. ;; Note: If you load this procedure and try to run it in another ;; library, it will not work. To make this procedure works in a ;; different library, make sure the physical design rules are ;; specified and that the technology file ID techParam is set to ;; the name of the library. procedure( buildGuardRing( @optional (type "ndiff") (winId hiGetCurrentWindow()) (pointList nil) ) ;end buildGuardRing Virtuoso Relative Object Design User Guide Code Examples July 2002 320 Product Version 5.0 prog( ( cvId tfId botLayNumber topLayNumber viaLayNumber viaWidth botOLvia topOLvia botWidth prompt1 prompt2 buildCnts_info ) ;; Check the cellView. Get the techfile ID. if( (cvId = geGetEditCellView(winId)) && cvId->objType == "cellView" then tfId = techGetTechFile(cvId) else printf("Invalid cellView %L\n" cvId) return() ) ;end if ;; Find out what layers to use based on the type of guardring. botLayNumber = case(type ("ndiff" techGetParam(tfId "ndiff")) ("pdiff" techGetParam(tfId "pdiff")) ("poly" techGetParam(tfId "poly")) ) ;end case topLayNumber = techGetParam(tfId "metal1") viaLayNumber = techGetParam(tfId "cont") ;; Find the design rules. viaWidth = techGetSpacingRule(tfId "minWidth" viaLayNumber) botOLvia = techGetOrderedSpacingRule( tfId "minEnclosure" botLayNumber viaLayNumber) topOLvia = techGetOrderedSpacingRule( tfId "minEnclosure" topLayNumber viaLayNumber) botWidth = (2 * botOLvia) + viaWidth ;; Build a global variable list for the enter function to use. buildCnts_info = ncons(nil) buildCnts_info->cv = cvId buildCnts_info->layer1 = botLayNumber buildCnts_info->layer2 = topLayNumber buildCnts_info->layer3 = viaLayNumber buildCnts_info->width1 = botWidth buildCnts_info->width3 = viaWidth buildCnts_info->length3 = viaWidth buildCnts_info->pathpnts = pointList buildCnts_info->terminal = nil buildCnts_info->pinlabel = nil buildCnts_info->enc = (botOLvia - topOLvia) buildCnts_info->offset = -botOLvia buildCnts_info->chop = t ;; Prompts for points if points where not passed in. prompt1 = "Enter the first point in the coordinate list:" prompt2 = "Enter the next point in the coordinate list:" enterPath( ?prompts list(prompt1 prompt2) ?doneProc "guardRingDoneCB" ?pathWidth botWidth ?points pointList ?pathStyle "flush" ) ;end enterPath Virtuoso Relative Object Design User Guide Code Examples July 2002 321 Product Version 5.0 return(t) ) ;end prog ) ;end procedure ;; The following procedure uses a callback from the enterFunction. ;; car(args) = winId ( Current window ) ;; cadr(args) = exitStatus ( t if applied, nil if cancelled ) ;; caddr(args) = pointList ( points entered by user ) ;; ;; Use the variable buildCnts_info (define within the buildGuardRing ;; procedure above) to contain the layer and design rule information. ;; procedure( guardRingDoneCB(@rest args) let((pointList) when(cadr(args) && (pointList = caddr(args)) && length(pointList) > 1 when(boundp(‘buildCnts_info) && listp(buildCnts_info) length(buildCnts_info) == 14 buildCnts_info->pathpnts = pointList rodCreatePath( ?cvId buildCnts_info->cv ?layer buildCnts_info->layer1 ?width buildCnts_info->width1 ?pts buildCnts_info->pathpnts ?choppable nil ?encSubPath list( list( ?layer buildCnts_info->layer2 ?enclosure buildCnts_info->enc ?choppable buildCnts_info->chop ?pinLabel buildCnts_info->pinlabel ?pinLabelHeight buildCnts_info->length3 ?pinLabelLayer buildCnts_info->pinlabel ) ) ;end encSubpath lists ?subRect list( list( ?layer buildCnts_info->layer3 ?width buildCnts_info->width3 ?length buildCnts_info->length3 ?endOffset buildCnts_info->offset ) ) ;end of subRect lists ) ;end of rodCreatePath ) ;end of 1st when ) ;end of 2nd when ) ;end of let ) ;end of procedure Virtuoso Relative Object Design User Guide Code Examples July 2002 322 Product Version 5.0 Creating a Shielded Path ;; Create a shielded path procedure( shieldedPath(cv) errset( (let (tfId) rodCreatePath( ?name "shieldedPath" ?layer "metal1" ?pts list(2:-15 2:-5 15:-5 15:-15) ?width .8 ?justification "center" ?cvId cv ?offsetSubPath list( list( ?layer "vapox" ?justification "left" ?sep 1 ?width .4 ) ;end of offset sublist1 list( ?layer "vapox" ?justification "right" ?sep 1 ?width .4 ) ;end of offset sublist2 ) ;end of offset list of lists ) ;end of rodCreatePath ) ; end of let t ) ; end of errset ) ; end of procedure Virtuoso Relative Object Design User Guide Code Examples July 2002 323 Product Version 5.0 Creating a Transistor ;; Create a gate procedure( tran(cv w l name) let((tfId pext pcs pds cw cs m1oc doc grid ptslist tran) tfId = techGetTechFile(cv) pext = techGetSpacingRule(tfId "minExtension" "poly") pcs = techGetSpacingRule(tfId "minSpacing" "poly" "cont") pds = techGetSpacingRule(tfId "minSpacing" "poly" "ndiff") cw = techGetSpacingRule(tfId "minWidth" "cont") cs = techGetSpacingRule(tfId "minSpacing" "cont") m1oc = techGetOrderedSpacingRule(tfId "minEnclosure" "metal1" "cont") doc = techGetOrderedSpacingRule(tfId "minEnclosure" "ndiff" "cont") grid = techGetMfgGridResolution(tfId) ptslist = list(0:0 0:(w + 2 * pext)) tran = rodCreatePath( ?name name ?layer "poly" ?pts ptslist ?width l ?termName "G" ?justification "center" ?cvId cv ?offsetSubPath list( list( ?layer "poly" ?beginOffset 0.0 ?endOffset -(pext + w + pds) ?width l ?pin t ?termName "G" ) ;end of offset sublist1 list( Virtuoso Relative Object Design User Guide Code Examples July 2002 324 Product Version 5.0 ?layer "poly" ?beginOffset -(pext + w + pds) ?endOffset 0.0 ?width l ?pin t ?termName "G" ) ;end of offset sublist2 list( ?layer "metal1" ?justification "left" ?sep pcs - m1oc ?beginOffset m1oc - pext - doc ?endOffset m1oc - pext - doc ?width cw + 2 * m1oc ?pin t ?termName "S" ) ;end of offset sublist3 list( ?layer "metal1" ?justification "right" ?sep pcs - m1oc ?beginOffset m1oc - pext - doc ?endOffset m1oc - pext - doc ?width cw + 2 * m1oc ?pin t ?termName "D" ) ;end of offset sublist4 list( ?layer "ndiff" ?justification "left" ?sep 0.0 ?beginOffset -pext ?endOffset -pext ?width doc + cw + pcs ?termName "S" ) ;end of offset sublist5 list( ?layer "ndiff" ?justification "left" ?sep 0.0 ?beginOffset -pext ?endOffset -pext ?width 2 * grid ?pin t ?termName "S" ) ;end of offset sublist6 list( ?layer "ndiff" ?justification "right" ?sep 0.0 ?beginOffset -pext ?endOffset -pext ?width doc + cw + pcs ?termName "D" ) ;end of offset sublist7 list( ?layer "ndiff" ?justification "right" ?sep 0.0 ?beginOffset -pext ?endOffset -pext Virtuoso Relative Object Design User Guide Code Examples July 2002 325 Product Version 5.0 ?width 2 * grid ?pin t ?termName "D" ) ;end of offset sublist8 ) ?subRect list( list( ?layer "cont" ?length cw ?width cw ?space cs ?justification "left" ?sep pcs ?beginOffset -(pext + doc) ?endOffset -(pext + doc) ) ;end of subRect sublist1 list( ?layer "cont" ?length cw ?width cw ?space cs ?justification "right" ?sep pcs ?beginOffset -(pext + doc) ?endOffset -(pext + doc) ) ;end of subRect sublist2 ) ;end of subRect list of lists ) ;end of rodCreatePath ) ;end of let ) ;end of procedure Virtuoso Relative Object Design User Guide Code Examples July 2002 326 Product Version 5.0 Getting the Resistance for a ROD Path The following procedures create and update a user-defined handle for the resistance of a ROD path. All three procedures require the ROD object ID (rodId) as input. getRodPathLength Goes through the list of points in a ROD path and adds up the lengths of the segments. getRodPathRes Gets the length and sheet resistance values for a ROD path and calculates the resistance. createResHandle Creates or recalculates a user-defined handle for the resistance (res) of a ROD path. When you calculate the resistance of a ROD path from within a pcell, you only need to execute the createResHandle procedure once inside the pcell because the geometries in a pcell are recreated every time the pcell is evaluated. When you calculate the resistance of a ROD path from outside a pcell, such as in an open cellview window, you must update the resistance handle (res) by executing the createResHandle procedure in the Command Interpreter Window whenever you make a change to the ROD path, such as stretching or chopping it. Virtuoso Relative Object Design User Guide Code Examples July 2002 327 Product Version 5.0 getRodPathLength Procedure ;; This procedure goes through the list of points in a ROD path ;; and adds the lengths of the segments. Returns the total length. ;; procedure(getRodPathLength(rodId) let( ( (total_length 0) ) ;end variables for let for(i 0 (rodId~>numSegments - 1) total_length = total_length + rodGetHandle(rodId symbolToString(concat("length" i))) ) ;end of for total_length ) ;end of let ) ;end of procedure getRodPathRes Procedure ;; This procedure gets the length and sheet resolution values for ;; a ROD path, then calculates and returns the resistance. ;; Remember to load the procedure getRodPathLength procedure(getRodPathRes(rodId) let(( corner_value sheet_res path_width num_segs num_corners total_length num_squares ) ;; Percentage of a square. Usually, values from 0.5 to 0.65 ;; are used for corner resistance. The rodPcells sample library ;; uses .559 for corner resistance, so that value is used here. ;; Adjust the value of corner_value to suit your needs. corner_value = .559 ;; Get the sheet resistance for the current layer. sheet_res = techGetElectricalRule(techGetTechFile(rodId~>cvId) "sheetRes" rodId~>dbId~>layer) ;; Get path width, number of segments, number of corners, ;; and total path length. path_width = rodId~>dbId~>width num_segs = rodId~>numSegments num_corners = num_segs - 1 total_length = getRodPathLength(rodId) ;; Now compute the number of squares of resistance material ;; and calculate the total resistance value. num_squares = (total_length / path_width) - (num_corners * corner_value) ;; Return the resistance value. num_squares * sheet_res ) ;end of let ) ;end of procedure Virtuoso Relative Object Design User Guide Code Examples July 2002 328 Product Version 5.0 createResHandle Procedure ;; This procedure creates or updates the value of a user-defined ;; resistance handle ("res") for a ROD path, and returns the ;; resistance value. ;; procedure(createResHandle(rodId) let((res) when(rodId~>dbId~>objType == "path" && (res = getRodPathRes(rodId)) when((rodHandle = rodGetHandle(rodId "res")) rodDeleteHandle(rodId "res") ) ;end of 2nd when rodCreateHandle( ?rodObj rodId ?name "res" ?type "float" ?value res ) ;end of rodCreateHandle ) ;end of 1st when ) ;end of let ) ;end of procedure Virtuoso Relative Object Design User Guide Code Examples July 2002 329 Product Version 5.0 Stretchable MOS Transistor This is an example of a very simple MOS transistor with stretchable contact arrays and user- defined functions.This code might not work with your technology file, but you can modify the code as desired. For more complex MOS code examples, see the Sample Parameterized Cells Installation and Reference. The parameters for the sample mos transistor pcell are specified as follows: Stretch handles are assigned to the transistor pcell as follows: I To make the source contacts stretchable, the upperCenter and lowerCenter point handles on the source contact array are assigned to the pcell parameter leftcov with the stretch type relative and the stretch direction Y. Parameter Name Default Value Parameter Description w 1.3 Width of gate l 0.25 Length of gate leftcov 1.0 Left contact coverage rightcov 1.0 Right contact coverage leftPos "top" Position of left contacts rightPos "top" Position of right contacts Virtuoso Relative Object Design User Guide Code Examples July 2002 330 Product Version 5.0 I To make the drain contacts stretchable, the upperCenter and lowerCenter point handles on the drain contact array are assigned to the pcell parameter rightcov with the stretch type relative and the stretch direction Y. For steps describing how to stretch the handles on the contact arrays, see “Stretching a Contact Array in a Transistor Pcell Instance” in the Virtuoso Layout Editor User Guide. Code for simplemos Transistor devices( tcCreateDeviceClass("layout" "simplemos" ; class parameter name value pairs ( ( xtrType "ndiff" ) ) ; formal parameters (name-value pairs) ( (w 1.3) (l 0.25) (leftcov 1.0) (rightcov 1.0) (leftPos "top") (rightPos "top") ) ; end formal parameters ; access controls techfile class for layout design rules ; and layer info tfId = techParam("tfId") poly = techParam("poly") ; poly layer number diff = techParam(xtrType) ; xtrType diff layer number contact = techParam("cont") ; cont layer number metal1 = techParam( "metal1") ; metal1 layer number pext = techGetSpacingRule(tfId "minExtension" poly) pcs = techGetSpacingRule(tfId "minSpacing" poly contact) cw = techGetSpacingRule(tfId "minWidth" contact) cs = techGetSpacingRule(tfId "minSpacing" contact) m1oc = techGetOrderedSpacingRule(tfId "minEnclosure" metal1 contact) upperCenter point handle for source contacts lowerCenter point handle for source contacts upperCenter point handle for drain contacts lowerCenter point handle for drain contacts Virtuoso Relative Object Design User Guide Code Examples July 2002 331 Product Version 5.0 doc = techGetOrderedSpacingRule(tfId "minEnclosure" diff contact) dop = techGetOrderedSpacingRule(tfId "minEnclosure" diff poly) pps = techGetSpacingRule(tfId "minSpacing" poly ) grid = techGetMfgGridResolution(tfId) ;************* draw gate with connectivity ************* gate = rodCreateRect( ?layer poly ?length w + (2 * pext) ?width l ) ; end gate rodCreateRect topPin = rodCreateRect( ?layer poly ?length pext ?width l ?termName "G" ?pin t ) ; end topPin rodCreateRect botPin = rodCreateRect( ?layer poly ?length pext ?width l ?termName "G" ?pin t ); end botrodCreateRectPin dbReplaceProp(gate~>dbId "lxBlockOverlapCheck" "boolean" t) rodAlign( ?refObj gate ?refHandle "lowerLeft" ?alignObj botPin ?alignHandle "lowerLeft" ) ; end rodAlign rodAlign( ?refObj gate ?refHandle "upperLeft" ?alignObj topPin ?alignHandle "upperLeft" ) end rodAlign ; ******** draw source contacts and source diffusion************* metOvDiff = doc - m1oc metOvPoly = pcs - m1oc cntsw = w - (2*doc) length = ((cntsw + (2*m1oc)) * leftcov/grid)*grid minLength = cw + (2 * m1oc) when(length < minLength length = minLength ) ; end when leftCnts = rodCreatePath( ?layer metal1 ?width (2*m1oc)+cw ?pts list(0:0 0:length) ?justification "center" ?subRect list( list( ?layer contact ?length cw Virtuoso Relative Object Design User Guide Code Examples July 2002 332 Product Version 5.0 ?width cw ?space cs ?endOffset -m1oc )) ; end subrect list ?termName "S" ?pin t ) ; end leftCnts rodCreatePath leftDiff = rodCreateRect( ?layer diff ?width cw + doc + pcs + l/2 ?length w ) ; end leftDiff rodCreatePath rodAlign( ?refObj gate ?refHandle "cC" ?alignObj leftDiff ?alignHandle "cR" ) ; end rodAlign ; ******** make source contacts stretchable ********* ; The user-defined function "contcov" sets a range for the ; contacts from a 100% coverage to minimum contact width rodAssignHandleToParameter( ?parameter "leftcov" ?rodObj leftCnts ?handleName list("upperCenter" "lowerCenter") ?displayName "leftcov" ?stretchDir "y" ?stretchType "relative" ?userFunction "contcov" ) ; end rodAssignHandleToParameter ; ******** set source contact alignment ********* ; This is an example where rodAssignHandleToParameter is ; being used to set a parameter value and where no display ; is required. ; The userfunction "mystretch" checks which handle is ; currently being stretched and then returns the location ; where the contacts should be aligned, either to the top ; or bottom. rodAssignHandleToParameter( ?parameter "leftPos" ?rodObj leftCnts ?handleName list("upperCenter" "lowerCenter") ?stretchType "relative" ?userFunction "mystretch" ) ; end rodAssignHandleToParameter case( leftPos ("top" rodAlign( ?refObj gate ?refHandle "uL" ?alignObj leftCnts ?alignHandle "uR" ?xSep -metOvPoly ?ySep -(pext + metOvDiff) Virtuoso Relative Object Design User Guide Code Examples July 2002 333 Product Version 5.0 ) ; end rodAlign ) ; end top ("bottom" rodAlign( ?refObj gate ?refHandle "lowerLeft" ?alignObj leftCnts ?alignHandle "lowerRight" ?xSep -metOvPoly ?ySep pext + metOvDiff ); end rodAlign ) ; end bottom ); end case ; ******** draw drain contacts and drain diffusion************* length = ((cntsw + (2*m1oc)) * rightcov/grid)*grid when(length < minLength length = minLength ) ; end when rightCnts = rodCreatePath( ?layer metal1 ?width (2*m1oc)+cw ?pts list(0:0 0:length) ?justification "center" ?subRect list( list( ?layer contact ?length cw ?width cw ?space cs ?endOffset -m1oc )) ; end subrect lists ?termName "D" ?pin t ) ; end rightCnts rodCreatePath rightDiff = rodCreateRect( ?layer diff ?width pcs + cw + doc + l/2 ?length w ) ; end rightDiff rodCreatePath rodAlign( ?refObj gate ?refHandle "cC" ?alignObj rightDiff ?alignHandle "cL" ) ; end rodAlign ; ******** make drain contacts stretchable ********* rodAssignHandleToParameter( ?parameter "rightcov" ?rodObj rightCnts ?handleName list("upperCenter" "lowerCenter") ?displayName "rightcov" ?stretchDir "y" ?stretchType "relative" ?userFunction "contcov" ) ; end rodAssignHandleToParameter ; ******** set drain contact alignment ********* Virtuoso Relative Object Design User Guide Code Examples July 2002 334 Product Version 5.0 rodAssignHandleToParameter( ?parameter "rightPos" ?rodObj rightCnts ?handleName list("upperCenter" "lowerCenter") ?stretchType "relative" ?userFunction "mystretch" ) ; end rodAssignHandleToParameter case( rightPos ("top" rodAlign( ?refObj gate ?refHandle "uR" ?alignObj rightCnts ?alignHandle "uL" ?xSep metOvPoly ?ySep -(pext + metOvDiff) ) ; end rodAlign ) ; end top ("bottom" rodAlign( ?refObj gate ?refHandle "lowerRight" ?alignObj rightCnts ?alignHandle "lowerLeft" ?xSep metOvPoly ?ySep pext + metOvDiff ) ; end rodAlign ); end bottom ); end case ) ; end tcCreateDeviceClass ; Declare a cvs of device class simplemos called simplepmos ; and simplenmos tcDeclareDevice( "layout" "simplemos" "simplepmos" ( ( xtrType "pdiff" ) ) ) ; end tcDeclareDevice tcDeclareDevice( "layout" "simplemos" "simplenmos" ( ( xtrType "ndiff" ) ) ) ; end tcDeclareDevice ) ; end devices Code for contcov User-Defined Function ;; contcov is a user-defined function specified for the pcell created ;; by simplemos.il. ; The user-defined function "contcov" sets a range for the contacts ; from 100% coverage to minimum contact width for the layer from the ; technology file. procedure( contcov(myDefstruct) let(((returnVal myDefstruct->paramVal + myDefstruct->increment) Virtuoso Relative Object Design User Guide Code Examples July 2002 335 Product Version 5.0 tfId metal1 contact m1oc cw length minLength) tfId = techGetTechFile((myDefstruct->rodObj)~>cvId) metal1 = techGetParam(tfId "metal1") contact = techGetParam(tfId "cont") m1oc = techGetOrderedSpacingRule(tfId "minEnclosure" metal1 contact) cw = techGetSpacingRule(tfId "minWidth" contact) length = (myDefstruct->rodObj)~>length * returnVal minLength = cw + 2*m1oc when(returnVal > 1.0 || length < minLength progn(warn("returnVal for parameter %s must be < 1 or > %f\n" myDefstruct->parameter cw) if(returnVal > 1.0 then returnVal = 1.0 else returnVal = cw ) ; endif ) ; end progn ) ; end when returnVal ) ; end of let ) ; end of procedure Code for myStretch User-Defined Function ;; myStretch.il is a user-defined function specified for the pcell ;; created by simplenmos.il. ; The user-defined function "mystretch" checks which handle is ; currently being stretched and then returns the location where ; the contacts should be aligned, either to the top or bottom. procedure( mystretch(myDefstruct) let( (leftPos) if(myDefstruct->handleName == "upperCenter" then leftPos = "bottom" else leftPos = "top" ) ; endif myDefstruct->paramValue = leftPos ) ;end let ) ; end procedure Virtuoso Relative Object Design User Guide Code Examples July 2002 336 Product Version 5.0 Virtuoso Relative Object Design User Guide July 2002 337 Product Version 5.0 G Troubleshooting This appendix describes problems you might encounter while using ROD functionality and suggests how to solve them. The problems are divided into two categories: I Warnings in the CIW I Dialog Box Messages Warnings in the CIW “Template templateName is replacing an existing template by the same name” on page 337 “Creating instance forces unname of ROD object” on page 338 “ROD object ID changes after Undo” on page 338 Template templateName is replacing an existing template by the same name When you load an ASCII MPP template file, the system checks the names of the MPP templates in the ASCII file against the names of MPP templates that already exist in the technology file in virtual memory. If there is a name conflict, the systemdisplays a warning in the CIWsaying that an MPP template in the ASCII file is replacing an existing MPP template. The existing template in the technology file in Virtual Memory is overwritten. Solution: If you do not want to overwrite the original MPP template in your binary technology library on disk, then do not save changes to the technology file. You can also avoid overwriting existing templates by changing the duplicate names in your ASCII file to unique template names. Virtuoso Relative Object Design User Guide Troubleshooting July 2002 338 Product Version 5.0 If you want to change the names of the MPP templates in your ASCII file right away, or you want to be able to save other changes to your technology library on disk without overwriting the original template, you need to: 1. Exit the layout software without saving technology file changes. 2. Edit your ASCII file to change template names. 3. Restart the layout software. 4. Reload your ASCII MPP template file. Creating instance forces unname of ROD object WARNING* rodiFigTriggerFunc: Creating instance named instance_name forced unname of ROD shape_type to avoid name conflict. *WARNING* You might want to use Undo now. If you create an instance using the dbCreateInst function in the CIW and a ROD shape already exists with the same name in the same cellview as the instance you are creating, the warning above appears in the CIW. If you do not do an undo, the system unnames the ROD object, turning it into an ordinary shape without any ROD attributes. Solution: Immediately do an undo. Avoid using dbCreateInst to create instances that have the same name as ROD objects in the same cellview. ROD object ID changes after Undo When you do an Undo in a cellview with the hiUndo function or Edit – Undo, the system restores the previous version of the cellview. Variables that used to contain ROD object IDs no longer do so. If you do a Redo with the hiRedo function or Edit – Redo, the system restores the “undone” cellview, but assigns new ROD object IDs to all ROD objects in the cellview. Therefore, you need to reset your variables for ROD objects. Note: This behavior occurs only during interaction with ROD objects in the CIW. For example, if a layout cellview is open for editing and you type the following statement in the CIW: rect = rodCreateRect( ?cvId geGetEditCellView() ?name "myRect" ?layer "poly" ) Virtuoso Relative Object Design User Guide Troubleshooting July 2002 339 Product Version 5.0 the system responds by creating the rectangle in the cellview and displaying its ROD object ID in the CIW as follows: rodObj:22032408 If you do an Undo at any time during the same editing session, the system restores the previous version of the cellview. The rect variable no longer points to a valid ROD object. When you test rect after an Undo, the system displays the following: rect rod:invalid rodIsObj( rect ) nil If you follow an Undo with a Redo (with the hiRedo function or Edit – Redo), the system restores the cellview. However, the systemassigns the rectangle a newRODobject ID, so the rect variable remains invalid, as it still contains the old ROD Object ID. rect rod:invalid rodIsObj( rect ) nil Solution: To update the rect variable to the new ROD object ID for the rectangle, use a statement similar to this: rect = rodGetObj( "myRect" geGetEditCellView() ) Nowwhen you query the variable rect, the systemresponds with the current RODobject ID, as follows: rect rodObj:22032420 rodIsObj( rect ) t Note: The name of a RODobject is persistent, but the RODobject IDmight not be. Therefore, rather than storing the ROD object ID in a variable, get it whenever it is needed. Dialog Box Messages Why is a dialog box asking about saving the technology file? If you are asked whether you want to save changes to your technology file when you exit the layout software, and you do not know what the changes are, it might be that an ASCII MPP Virtuoso Relative Object Design User Guide Troubleshooting July 2002 340 Product Version 5.0 template file was loaded during your editing session. The ASCII MPP template file could contain templates with unique names, templates with names that match templates existing in your technology file, or both. I When the ASCII MPP template file contains templates with unique names, saving changes to your technology file causes the system to add the new templates to the existing templates in your binary technology library on disk. I When the ASCII MPP template file contains a template with a name that matches an existing template in the technology file, saving changes to your technology file causes the systemto overwrite the matching template with the ASCII version. This might not be what you intended. Solution: You can verify whether templates loaded fromASCII files produced name conflicts by looking for the following message in the CDS.log file: Template templateName is replacing an existing template by the same name For information about what to do, see “Template templateName is replacing an existing template by the same name” on page 337. Virtuoso Relative Object Design User Guide July 2002 341 Product Version 5.0 Index Symbols .cdsenv file 299 to 300 .il files rodPrintSystemHandleValues.il 125 rodPrintUserHandleValues.il 128 [ ] in syntax 13 { } in syntax 13 | in syntax 13 ~> database access operator accessing object attributes 118 point handle 37 A accessing alignment information with ~> 118 coordinates through hierarchy 37 to 268 handles 18 system-defined 19 with rodGetHandle function 262 MPP chop holes with ~> 118 multipart path bounding box with ~> 23 named objects 17 number of segments with ~> 118 object attribute names and values 121 system-defined handle names with ~> 118 handle values with a procedure 125 user-defined handles values with a procedure 128 align, object attribute 118 aligned objects, how chopping affects ?? to 89 aligning objects 35 separating 37 with rodAlign function 143 unalign object with rodUnAlign function 282 alignment when recalculate? 36 argument definition 159 assign handle to parameter 154 attributes accessing names and values 121 B bounding box point handles 19 to 20 width, length handles 20 to 22 braces in syntax 13 brackets in syntax 13 bus code example 316 C calculating alignment, when 36 CDF callback procedure 52 .cdsenv file 299 to 300 chop hole in multipart path ?? to 89 path with rodAddMPPChopHole function 137 chopHoles, object attribute 118 connectivity in ROD objects 109 multipart paths 85 multipart rectangles 56 constraintAssistedMode environment variable 297 contact array code example 318 coordinate finding X with rodPointX function 279 finding Y with rodPointY function 280 createResHandle procedure 326 cvId, object attribute 118 D data types defined 133 in syntax 12 Virtuoso Relative Object Design User Guide July 2002 342 Product Version 5.0 user-defined handles, for 34 database access operator ~> accessing object attributes 118 point handle 37 database ID, getting 277 dbId Also see database ID object attribute 118 dbOpenCellViewByType function 301 defstruct 159, 168 deGetCellView function 301 deleting user-defined handle with rodDeleteHandle function 254 description 165 disconnecting shapes of multipart paths 204 Display Options Form 305 displaying pin/terminal names 305 displayStretchHandles environment variable 297 E editing RODobjects, limitations 11, 57, 86, 132 enclosure subpath of multipart path 59 environment variable constraintAssistedMode 297 displayStretchHandles 297 readCellviewWarningOn 297 rodAutoName 298 stretchHandlesLayer 298 environment variables ?? to 300 preserveAlignInfoOn 297 traceTriggerFunctionsOn 298 updatePCellIncrement 298 examples accessing coordinates through hierarchy 267 to 268 system-defined handle values with a procedure 125 user-defined handle names with a procedure 128 Aligning an Object to a Point 150 Aligning Objects at Different Levels in the Hierarchy 152 Aligning Two Rectangles at the Same Level of Hierarchy 151 bus 316 contact array 318 Create a Master Path with an Offset Subpath to the Right 205 Create a Rectangular Pin 253 Create a Single Rectangle on a Terminal and Net 252 Create a Single Row or Column of Rectangles 248 Create Multiple Rows and Columns of Rectangles 249 Create One Rectangle with l_bBox 247 Create One Rectangle with n_width and n_length 247 Creating a Point Handle for a Cellview 177 Enclosure Subpaths 72 Fill a Bounding Box with Rectangles 250 length of path, calculating the 326 list of lists for subparts, specifying 201 Moving an Object Using rodAlign 151 Naming a Polygon Created by dbCreatePolygon in a Pcell 277 Naming a Shape Created in the CIWand Layout Window 278 Offset Subpaths 65 offsetting ends of subparts 81 Offsetting the Master Path 61 Overfill a Bounding Box with Rectangles 251 Partially Fill a Bounding Box with Rectangles 251 Querying a Point Handle for a Cellview 178 Querying System-Assigned Handle Name 178 resistance, calculating the 326 Sets of Subrectangles 75 sheet resistance, calculating the 326 shielded path 322 transistor 323 extended-type paths 30, 31 F files .cdsenv 299 to 300 libInit 166 rodPrintSystemHandleValues.il 125 Virtuoso Relative Object Design User Guide July 2002 343 Product Version 5.0 rodPrintUserHandleValues.il 128 fill box with rects 255 functions dbOpenCellViewByType 301 deGetCellView 301 pcDefinePCell 264, 266, 301 rodAddMPPChopHole 137 rodAddPoints 140 rodAddToX 141 rodAddToY 142 rodAlign 143 rodAssignHandleToParameter 154 rodCreateHandle 13, 175 rodCreatePath 179 rodCreatePolygon 207 rodCreateRect 213 rodDeleteHandle 254 rodFillBBoxWithRects 255 rodGetHandle 262 rodGetNamedShapes 263 rodGetObj 264 rodIsFigNameUnused 270 rodIsHandle 272 rodIsObj 273 rodNameShape 275 rodPointX 279 rodPointY 280 rodSubPoints 281 rodUnAlign 282 rodUnNameShape 284 tcCreateDeviceClass 264, 266, 301 G getRodPathLength procedure 326 getRodPathRes procedure 326 H handles 18 accessing name attribute with ~> 119 ROD object IDs for subshapes with ~> 118 system-defined handle values with a procedure 125 user-defined handle values with a procedure 128 assign to parameter 154 bounding box point 19 to 20 width, length 20 to 22 creating user-defined with rodCreateHandle function 175 multiple for same point, benefits of 33 segment length 31 names of 26 to ?? point 26 to 30, ?? to 31 system-defined 19 for multipart paths 31 user-defined 34 deleting with rodDeleteHandle function 254 verifying existance with rodIsHandle function 272 hierarchical names 17 K keyword-value pairs in syntax 13 L lambda function 159, 167 length handles 20 maximum for string 135 of path, code example 326 segment handles, of 31 libInit file 166 list of lists, specifying for subparts 201 literal characters in syntax 12 M maximum string length 135 mosaics 309 mosaics, limitations 114 MPP. See multipart paths mppBbox, multipart path bounding box handle 23 multipart paths 59, 180 aligned objects, how chopping affects ?? to 89 calculating bounding box 22 chop function 137 Virtuoso Relative Object Design User Guide July 2002 344 Product Version 5.0 chopping ?? to 89 connectivity 85, 109 creating with rodCreatePath function 180 disconnecting shapes, how to 204 length, calculating the total 327 mppBbox bounding box handle 23 resistance, calculating the 326 stretching 89 system-defined handles 31 width, length handles 22 multipart rectangles connectivity 56 stretching 58 N name, object attribute 118 named shapes, getting with rodGetNamedShapes function 263 names 17 accessing for object with ~> 118 hierarchical 17, 266 maximum string length 135 pin/terminal, displaying 305 segment handles, of 26 to 31 setting pin names 305 using special characters 136 naming shapes removing name with rodUnNameShape function 284 with rodNameShape function 275 numSegments, object attribute 118 O objects getting with rodGetObj function 264 naming 17 stretching multipart rectangles 58 unaligning with rodUnAlign function 282 offset subpath of multipart path 59 P parametertized cell. See pcells paths extended type 30, 31 length calculating the total 327 of segment 31 multipart. See multipart paths resistance, calculating the 326 segment numbers 24, 26 width of 33 pcCellView variable 135, 266, 301 pcDefinePCell function 264, 266, 301 pcells, using ROD to create 16 pin names displaying 305 setting 305 point handles 18 bounding box 19 segment 26 polygons creating with rodCreatePolygon 207 length of segment 31 segment numbers 24, 25 preserveAlignInfoOn environment variable 297 procedures rodPrintSystemHandleValues.il 125 rodPrintUserHandleValues.il 128 Q quote mark, single 134 R readCellviewWarningOn environment variable 297 recalculating alignment, when 36 rectangles creating with rodCreateRect 214 in multipart path, sub 59 segment numbers 25 segment point handle names 27 related manuals 11 relative alignment, overview 35 object design, defined 11, 16 repeated object, connectivity 109 resistance code example 326 results of using 52 Virtuoso Relative Object Design User Guide July 2002 345 Product Version 5.0 results of using in stretchable pcells 52 right arrow in syntax 13 ROD object ID 113 to 115 getting in a cellview 114 getting with rodGetObj function 264 ROD objects 113 accessing attributes 118 to 130 accessing through hierarchy 37 to 293 editing limitations 11, 57, 86, 132 finding with rodGetObj function 264 separating 37 rodAddMPPChopHole function 137 rodAddPoints function 140 rodAddToX function 141 rodAddToY function 142 rodAlign function 143 rodAssignHandleToParameter function 154 rodAutoName environment variable 298 rodCellView variable 135 rodCreateHandle function 175 rodCreatePath function 179 rodCreatePolygon 207 rodCreateRect function 213 rodDeleteHandle function 254 rodFillBBoxWithRects function 255 rodGetHandle function 262 rodGetNamedShapes 263 rodGetObj function 264 rodIsFigNameUnused function 270 rodIsHandle function 272 rodIsObj function 273 rodNameShape function 275 rodPointX function 279 rodPointY function 280 rodPrintSystemHandleValues.il 125 rodPrintUserHandleValues.il 128 rodSubPoints function 281 rodUnAlign function 282 rodUnNameShape function 284 S segment handle names 27 to 31, 32 to 33 length handles 31 numbering ?? to 24, 24 to 26 point handles 26 separating aligned objects 37 setting pin names 305 shapes getting names with rodGetNamedShapes function 263 naming with rodNameShape function 275 removing name with rodUnNameShape function 284 sheet resistance code example 326 shielded path code example 322 single quote mark 134 solutions to problems for rodCreateAlign aligning an object to a point 285 aligning objects at different levels in the hierarchy 287 aligning two rectangles at the same level of hierarchy 286 moving an object 286 rodCreateHandle creating a point handle for a cellview 287 creating a system-assigned handle name 288 querying a point handle for a cellview 288 rodCreatePath create a master path with an offset subpath on the right 288 rodCreateRect Create a Rectangular Pin 292 Create a Single Rectangle on a Terminal and Net 292 Create a Single Row or Column of Rectangles 289 Create Multiple Rows and Columns of Rectangles 290 Create One Rectangle with l_bBox 289 Fill a Bounding Box with Rectangles 290 Overfill a Bounding Box with Rectangles 291 Partially Fill a Bounding Box with Rectangles Virtuoso Relative Object Design User Guide July 2002 346 Product Version 5.0 291 rodGetObj Accessing Coordinates through One Level of Hierarchy 293 Accessing Coordinates through Two Levels of Hierarchy 293 Accessing Coordinates without Hierarchy 293 rodNameShape Naming a Polygon Created in a Pcell 294 Naming a Polygon Created in the CIW and Layout Window 294 special characters in names 136 stretch process flow, in 40 stretchHandlesLayer environment variable 298 stretching objects multipart rectangles 58 string length, maximum 135 subrectangles of multipart path 59 subShapes, attribute of multipart paths 118 symbol tick mark 134 syntax conventions 12 data types 133 formating list of lists 201 keyword-value pairs 13 system-defined handles 18 for multipart paths 31 getting with rodGetHandle function 262 values, accessing with procedure 125 verifying existance with rodIsHandle function 272 systemHandleNames object attribute 118 T tcCellView variable 135, 266 tcCreateDeviceClass function 264, 266, 301 terminal names, displaying 305 traceTriggerFunctionOn environment variable 298 transform, object attribute 119 transforming coordinates through hierarchy 37 to 293 coordinates when accessing a point handle 119 transistor code example 323 U unalign objects with rodUnAlign function 282 updatePCellIncrement environment variable 298 user-defined function 40, 52, 159, 165 user-defined handles 18 data types 34 deleting with rodDeleteHandle function 254 getting with rodGetHandle function 262 values, accessing with a procedure 128 verifying existance with rodIsHandle function 272 userHandleNames, object attribute 119 V variables pcCellView 135, 266, 301 rodCellView 135 tcCellView 135, 266 vertical bars in syntax 12, 13 W width handles 20 paths, of 33 width handles 20 X X coordinate, finding with rodPointX function 279 Virtuoso Relative Object Design User Guide July 2002 347 Product Version 5.0 Y Y coordinate, finding with rodPointY function 280 Virtuoso Relative Object Design User Guide July 2002 348 Product Version 5.0
Copyright © 2024 DOKUMEN.SITE Inc.