0% found this document useful (0 votes)
21 views6 pages

Allegro System Capture AppNote - DRC

Allegro System Capture allows users to define custom design rule checks (DRC) using Tcl APIs, with rules specified in a text file named rulesIndex.txt. Users must place this file in designated directories and create a tclIndex file for the rules to be recognized. The document also includes basic Tcl types and a sample DRC script to check for overlapping component pins.

Uploaded by

Chris Zhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

Allegro System Capture AppNote - DRC

Allegro System Capture allows users to define custom design rule checks (DRC) using Tcl APIs, with rules specified in a text file named rulesIndex.txt. Users must place this file in designated directories and create a tclIndex file for the rules to be recognized. The document also includes basic Tcl types and a sample DRC script to check for overlapping component pins.

Uploaded by

Chris Zhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Design Rule Checks in Allegro System

Capture
Introduction
Allegro System Capture provides a set of Tcl APIs for writing custom design rule checks (DRC).

Defining Custom Rules


Custom DRC rules for Allegro System Capture can be defined using the Tcl scripting API provided as a
part of the standard installation. A custom rule is a Tcl procedure identified by its name.

Setting up Custom Rules


To set up custom rules, you need to list the custom rules in a text file named rulesIndex.txt. This file is
defined using a Tcl list format. The top-level list is a collection of the rules defined, whereas each list
entry defines a specific rule:
{
{
<Name of the rule - To be enclosed in quotes if it includes spaces>
<Description of the rule - To be enclosed in quotes if it includes spaces>
<Valid Tcl procedure name>
<Rule type - Can be one of the following: Electrical, Graphical, Custom>
}
{
...
}
...
}

A sample rulesIndex.txt file:


## Sample rules index for ACME organization
{
{
"Large Pins"
"Checks for components exceeding a specific pin-count"
acme_custom_large_pin_count
Electrical
}
}
After a custom rule is defined, it is displayed in the list of DRC rules accessible from the
Project Preferences dialog (Edit->Preferences->Project Preferences) as illustrated in the following
screenshot:

Placing Custom Rules File


Custom rules must be placed at one of the following locations:

• <CADENCE SPB INSTALLATION>/share/cdssetup/canvas/rules/custom – If the Cadence SPB installation


hierarchy is writable, place the rules file here.
• $CDS_SITE/cdssetup/canvas/rules/custom – If a custom site is defined, place the rules file here.
• $HOME/cdssetup/canvas/rules/custom – You can also place the rules file in your HOME area.

After a custom rules file is placed, create a tclIndex file for the custom rules using the auto_mkIndex Tcl
command from a Tcl shell. A standalone Tcl shell is supplied with Cadence SPB installation at: <CADENCE
SPB INSTALL>/tcltk/bin/tclsh.
Allegro System Capture Tcl Graphics API

Basic Scripting Tcl Types


The following table lists some basic scripting Tcl types along with their descriptions:

Tcl Type Description


dbId Unique ID associated with an object. Example db:0000002a
dbPoint List of x and y coordinates. Example {0 100}
dbBox List of two dbPoints denoting the upper-left and lower-right
coordinates of a rectangle. Example {{0 0} {100 100}}
dbBool Boolean (True/False) value
dbType Type number denoting the type of an object

DB API Table of Tcl Procedures


The sch namespace should be prefixed to each of the Tcl API functions. Example: The following call
returns a list of selected items on the current page:

set selItem [sch::dbGetSelectedItems [sch::dbGetActivePage]]

The following table lists the supported Tcl DB APIs:

RETURN
# Name ARG1 ARG2 TYPE Description
Converts number in user units to
1 dbConvertToDBUnits number number database units
Converts number in database units
2 dbConvertToUserUnits number number to user units
3 dbGetActivePage dbId returns the dbId of the active page
returns the bounding box of the
4 dbGetBBox dbId of item dbBox item
returns the SPATH of a loaded
5 dbGetBlockSPath block name string design
returns a list of dbIds of all children
6 dbGetChildren dbId of item list of dbIds of an item
dbId of pin returns a list of dbIds of all route
7 dbGetConnectedItems item list of dbIds items connected to a pin
dbId of pin
8 dbGetHotSpot item dbPoint returns the hotspot of the pin
returns a list of dbIds of items
9 dbGetItemsInBBox dbBox list of dbIds within a bounding box
returns a list of dbIds of linked
10 dbGetLinkedItems dbId of item list of dbIds items
dbId of page
11 dbGetPage schematic name dbId returns dbId of a page
returns a list of dbIds of all items on
12 dbGetPageItems dbId of page list of dbIds a page
13 dbGetParent dbId of item dbId returns the dbId of the parent item
return position of the item on the
14 dbGetPos dbId of item dbPoint page in DB units
returns a list of properties defined
15 dbGetProperties dbId of item list of props on the item
spath list property
dbId of of name and returns the property name and
16 dbGetPropNameVal property design value value as a two-element list
returns the visibility values for the
property as follows:
0 – name and value invisible
1 – only name is visible
dbId of 2 – only value is visible
17 dbGetPropVisibility property short 3 – both name and value visible
returns the segments associated
with a route. A segment is denoted
dbId of route list of pair of by a pair of points. Example: {{{0 0}
18 dbGetSegments item points {0 100}} {{0 100} {100 100}}}
returns a list of dbIds of items
19 dbGetSelectedItems list of dbIds selected on a page
returns the SPATH of the selected
20 dbGetSPath dbId of item string item, if available
21 dbGetSPathForActiveTab string returns the SPATH of the active tab
22 dbGetType dbId of item dbType return the type number
23 dbIsByPassItem dbId of item dbBool checks if item is Bypass
24 dbIsValid dbId of item dbBool checks for valid dbId
25 dbName2Type type name numeric returns the type number
26 dbType2Name type number string returns the type name
DRC Sample to Determine Component Pin Overlaps
# **************************************************************
# Rule: To check if any component pin overlaps and if there is a pin-to-pin connection
# between any two components.

# 1. Function gets the component pins from the canvas and creates a list of component pins.
# 2. Gets all the zero length segments from the canvas and creates a list containing the segments.
# 3. Iterates over all the component pins and for each pin calculates bounding box.
# **************************************************************
proc asda_pins_overlap {designName msgType} {
set compPinInsts [asda_get_all_comppins]
set zerolengthSegments [asda_get_zerolength_segments]
set overlapped_insts {}
set count 0
foreach item $compPinInsts {
set item_bbox [sch::dbGetBBox $item]
set count [incr count]
set insts_to_visit [lrange $compPinInsts $count end]
foreach item1 $insts_to_visit {
set item1_bbox [sch::dbGetBBox $item1]
if {[asda_checkbbox_intersection $item_bbox $item1_bbox]} {
foreach segment $zerolengthSegments {
if { [asda_segment_pt_in_bbox $segment $item_bbox ]} {
lappend overlapped_insts $item
}
}
}
}
}
set msgInfo [asda_get_drc_msg_info [lindex [info level [info level]] 0]]
set msgId [ lindex $msgInfo 0 ]
set message [ lindex $msgInfo 1 ]
asda_report_drc $designName $msgType $msgId $message $overlapped_insts
return [llength $overlapped_insts]
}

You might also like