Never miss a story from System, PCB, & Package Design . Subscribe for in-depth analysis and articles.
Allegro PCB Editor stores design data as various types of objects in a proprietary database format. These object types can create a complete representation of an electronic circuit. You can create, operate on, and extract information from the database using AXL SKILL function calls (APIs). For example, the following Allegro SKILL code prints the reference designator and XY location of all the components in a design.
A clear understanding of database objects helps you write useful Allegro SKILL programs. In this blog post, we will learn about the different types of database objects supported by Allegro PCB Editor.
Allegro SKILL (AXL SKILL) is an extension of the core Cadence SKILL language. All Allegro PCB Editor SKILL functions or API names begin with axl. These AXL functions are classified into families that typically have similar calling sequences and share a common part in their names. For example, the axlDBCreate family, with members such as axlDBCreateShape and axlDBCreateSymbol creates shapes or symbols. Similarly, functions of the axlForm family, such as axlFormCallback, axlFormSetField, and axlFormGetField, are related to GUI creation. These SKILL functions are explained in detail in the blog post, Creating GUIs Using Allegro SKILL.
The AXL SKILL functions are used to access the Allegro PCB Editor database, its display, and user interfaces. The following illustration displays various types of Allegro SKILL APIs:
The AXL SKILL database stores both physical and logical information of a layout design. Physical information includes geometrical shapes and objects (connecting etch). Logical information includes nets and logical components. This information can be processed using core SKILL functions.
Database objects can be classified into the following types:
Each Allegro PCB Editor database object has a unique database identifier (dbid) associated with it. For example, you can use axlDBGetDesign to get the dbid of a root design.
The value of database id (dbid:<number>) varies from design to design.
A function that operates on a database object, when called, requires the dbid of the object as an argument. For example, axlDBGetExtents(o_dbid g_visibleOnly) provides the extent of a physical database object, where o_dbid is the dbid of an element.
You use AXL functions to create dbid of any object. Also, you cannot change dbid directly, except for parameter database ids.
Each Allegro PCB Editor object has a set of attributes that describe its functionality or behavior. For example, each symbol object has an attribute objType with a value symbol. Another attribute isMirrored, returns the value t if the symbol is mirrored or nil if it is not. The attributes of the symbol definition are shown in the following table:
Symdef (Symbol Definition) Attributes
List of children making up the symbol
List of symbol instances using this symbol
Name of symbol definition
Type of object. For symbol definition, it is symdef
List of pins
Symbol type can be one of the following: PACKAGE, MECHANICAL, FORMAT, SHAPE, or FLASH
Each Allegro PCB Editor object includes the following types of attributes:
The attributes generic to all the Allegro PCB Editor database objects are listed in the following table. For example, all symbol definition objects have objType set as symbol. Similarly, design objects have objType set as design.
Name of the object type
List of attached properties
List of groups to which the object belongs
If the value is t, the object cannot be modified. Else, the object is considered read-only.
The common figure attributes are as follows:
The bounding box of a figure.
The branch parent of an etch figure.
The layer of a figure. For a multi-layer object, the value is nil.
The unconnected owner of a figure.
Net object if the figure is associated with a net.
These are a set of attributes specific to an object. For example, Symdef has two attributes: pins and instances. The pins attribute represents a list of symbol pins. The instances represent a list of symbol instances using that symbol.
Although a database object type can have multiple attributes, learning the semantics of a few attributes can equip you with the ability to draw useful information from the Allegro PCB Editor database.
Use the ->att_name access operator and attribute combination to find the value of attributes of an element, where att_name is any legal attribute for a specific element type. For example, if dbid of a line element is stored in the line_dbid variable, the line_dbid->layer returns the class or subclass where the line exists. If the attribute does not exist for that object, the function returns nil.
Let’s consider another example:
A Symdef object, mysymdef, can be used as follows:
If an attribute does not apply to an object or a property does not exist on the object, the access function returns nil.
For example, the following function returns nil:
Special attributes ? (Interrogation mark) and ?? are used to view all the attributes and all the attribute and value pairs of an object, respectively.
The following SKILL code shows the attributes of a symbol definition:
This SKILL code illustrates the following steps:
If you try the same code, note that the dbids and firstSymDef differ with designs.
When a dbid is separated from its object, the dbid is considered out-of-scope. For example, when an object is deleted, or AXL SKILL is closed.
Evaluating an out-of-scope dbid returns the following message:
Using an out-of-scope database id in a function causes unexpected results. So, you should set the variable to the id again.
Now, let’s understand a simple program to print the reference designator and the XY location of all the components in a design.
design_dbid=axlDBFetDesign() l_comp_dbids=design_dbid->components foreach(comp_dbid l_comp_dbids ref_des=comp_dbid->name symbol_dbid=comp_dbid->symbol xy_loc=symbol_dbid->xy printf("%s \t %L/n" ref_des xy_loc) );foreach
This SKILL code includes the following steps:
Allegro SKILL database objects are the basic building blocks of the Allegro PCB Editor database. They are essential for viewing design data required to perform any task in the layout design using SKILL routines.
For any feedback or any topics you want us to include in our blogs, write to us at firstname.lastname@example.org.
Subscribe to stay updated about our upcoming blogs.
The BoardSurfers series provides solutions to the various tasks related to the creation and management of PCB design using the Allegro platform products. The name and logo of this series are designed to resonate with the vision of making the design and manufacturing tasks enjoyable, just like surfing the waves. Regular, new blog posts by experts cover every aspect of the PCB design process, such as library management, schematic design, constraint management, stack up design, placement, routing, artwork, verification, and more.