Sunteți pe pagina 1din 20

SKILL – DATABASE AND BINDKEYS

Module 6:

Sharifsab Nadaf
August 2019
Table of Contents

• Database?
• DFII
• Type - CDBA and OA
• Everything is object
• Accessing and modifying objects
• Basic functions – db, le, hi commands
• Understanding built-in functions and it’s arguments
• Object attributes and properties, Instance master
• Example programs
• Bindkeys
• Assignments

2
What is database?

• Database  A structured set of data held in a computer, especially one that is accessible
in various ways.
• Ex: Database of all the employees covering role, address and salary info.

• All Cadence tools use the Design Framework II unified database


• A binary database that stores data as "objects.“
• DFII – Design Framework

• DFII supports both physical and logical information about a design


• Physical info - stored in objects such as geometrical shapes and an IC layout
• Logical info - stored in objects such as nets or schematics

3
CDBA and OA

• Design Framework II now supports two database types


• CDBA  Cadence Data Base Access
• OA  Open Access

• dbGetDatabaseType()
• => CDBA / OpenAccess

• Difference between CDBA and OA?


• CDBA – Cadence proprietary and not generic
• OA - Not owned by any individual/org, can be used by any semiconductor vendor

4
Everything is object

• Object Oriented Programming Languages


• Same code performs different operations based on the type of object
• Also, in some cases, certain operations are permitted only on few types

• DFII stores everything as object. Various object types are:


• Library, Cells, views
• Rectangle, polygon, path
• Instances
• Pins

5
Accessing and modifying objects

• A label known as the object identifier or ID should be used.


• Unique for each object
• Special type - dbObject.
• Only database routines can create IDs
• ID’s cannot be altered directly
• When you use a function that operates on a database object, you must also give the ID as an
argument to the function.
• Deleting the object. makes the DataBase ID(dbid) invalid
• Closing the cellview makes the related dbids invalid

• The database access operator  ~>


• Gives access to the database using dbid.
• Using ~>, database can be read, created, modified or deleted.

6
Accessing and modifying objects

• bbox=dbid~>bBox
• Layer_name = dbid~>layerName
• dbid~>layerName = “met2”
• dbid~>?  Lists all the attributes and properties of the object
• Try dbid~>??

Some of the functions to get the database ID:


• geGetSelSet()
• css()
• geGetEditCellView()
• dbopenCellViewByType()

7
Basic functions

• Different commands for different type of application


• db : operates in Data Base level
• le : Layout Editor commands
• ge : Graphical Editor
• hi : Commands which needs Human Interface
• sch : Schematic editor commands
• ipc : Commands to run any process in background
• de : Design Editor commands

• geGetSelSet()  Returns the list of IDs of the selected items(device, shapes, pins etc)
• css()  Retunes the ID of the single selected item. If multiple are selected?
• geGetEditCellView()  Returns ID of the currently opened cell view
• dbOpenCellViewByType()  Opens the cellview in virtual mode and returns the ID. Cellview
details are given as arguments
• hiUndo  Reverts the previous action
8
Understanding built-in fucntions

Prefix dbCreateInst(

d_cellView

Prefix shows d_master


data type
t_name
Arguments to be
l_point passed

t_orient
Optional [x_numInst]
arguments in [ ]
)
Function return value
=>d_inst/nil Success/Fail

9
Built-in functions - Arguments

• d_cellView : Data base id


• t_name : String
• l_point : list
• t_orient : String
• [ x_numInst ] : Integer
[ <--Optional arguments--> ]
• g_libname : any type
• n : number ; integer or float
• p_techFile : I/O port
• y_Boolean : Binary
• u_funcName : Function
• f_area : floating point(Not integer)

10
Object attributes and properties, instance master

• Each object type has a predefined set of attributes that you can retrieve using type-
specific access functions.
• Attributes are predefined and managed by the database.

• An object property has a name and a value, such as a Boolean value, an integer, a floating
point number, a string, or a representation of time.
• Properties are defined and managed by applications built on top of the database.

• Instance master
• An original cellview which will be instantiated

11
Example codes

• dbCreateRect(geGetEditCellView() list("m1" "drawing") list(0:0 10:10) )  rectangle created


• dbCreatePath(geGetEditCellView() list("m2" "drawing") list(0:0 0:2 2:2 2:0) 1.0) Path created

• cellview = dbOpenCellViewByType("sharif_testlib" "test_InstMaster" "layout" "maskLayout" "r")


•  Cellview is opened in virtual memory
• dbCreateInst( geGetEditCellView() cellview "" 10:10 "R0" )  Instance is created
• car(geGetSelSet())~>objType  "path"
• car(geGetSelSet())~>width  1.0
• geGetEditCellView()~>cellName  "test_sarif"
• geGetEditCellView()~>cellName  nil
• css()~>width = 1.5  1.5

12 css()~>layerName  "m1"
Example program -1

Program to change all metal1 to metal2 in current cell

foreach(shape geGetEditCellView()~>shapes
if(shape~>layerName == "m1" then
shape~>layerName = "m2"
)
)
(db:0x4b86059a db:0x4b86059b db:0x4b86059c)
Example program -2

Program to print the size of the cellview

procedure(getSize()
cvid = geGetEditCellView()
box = cvid~>bBox
width = rightEdge(box)-leftEdge(box)
height = topEdge(box) - bottomEdge(box)

printf("Size of this cellview is %f X %f", width, height)


)

hiSetBindKey("Layout" "Shift<key>a" "getSize()")

 Size of this cellview is 15.857000 X 12.500000


Example program -3

Program to get the top level metal in the given cell


/*********************************************
Purpose : Function to find the top level metal in the given cellview
Owner : Sharif Nadaf
Date : 25th July, 2019
Usage : Update the cell details and replace “m” with any other word that metal layer is named
with i.e. met or metal
Improvements : 1)Can be updated to take the cell details as user arguments
2)Can be updated to work on all cells in a library
*********************************************/
procedure(getTopMetal()
cvid = dbOpenCellViewByType("sharif_lib" "test_sarif" "layout" "maskLayout" "r")
topMet = 0
metals = setof(x cvid~>shapes rexMatchp("m[0-9]" x~>layerName ))
;printf("# of metals :%d", length(metals))
Example program -3 – contd

foreach(met metals
metNum = parseString(met~>layerName "m")
metNum = evalstring(car(metNum))
;println(metNum)
if(metNum > topMet then
topMet = metNum
)
)
printf("Top level metal present in this cellview is Metal%d", topMet)
)
 Top level metal present in this cellview is Metal9
Bindkeys

• Binding a SKILL command string to a keyboard key or a mouse sequence for an application i.e.
Shortcuts to execute skill commands
• Function
hiSetBindKey(t_arg1, t_arg2, t_arg3)
hiSetBindKey("Layout" “Ctrl<key>g" “printCellInfo()")
t_arg1 – Application type where Bindkey needs to be set
t_arg2 – Bindkey
t_arg3 – Skill command for which Bindkey is to be set

Application type can be


• Layout
• Schematics
• Command Interpreter
Bindkeys -- contd

• Bindkeys can be
• Any key i.e. a-z, A-Z, 0-9 etc
• Can be combination of keys Shift<Key>a, Ctrl Shift<Key>a
• Alt can also be used. But only with mouse as it is set as menu access key.

• Function can be the user defined function or the Skill function.

• Examples
hiSetBindKey("Layout" “<key>p" “hiLeCreatePath()")
hiSetBindKey("Layout" “Shift<key>9" “addReviewInputs”)
hiSetBindKey(“Schematic" “Shift<key>9" “checkAndSave”)
hiSetBindKey(“Command Interpreter" “Ctrl Shift<key>9" “closeDataAndRefresh”)
Assignments

• For a given std cell, create VSS and VDD label on the centre of the powerline. Set a
Bindkey to do the same in layout.
• Set a Bindkey to join 2 paths(1 is running in vertical direction and other one is
horizontal) in layout.
• For a given library, print the below info for all cells
• Cell name Area # of poly pitches

• Bindkey to increase/decrease width of the path


• Bindkey to toggle the mode of the cell i.e. read to write and vice versa
• Bindkey to increase or decrease # of rows/columns of vias
Thank You

S-ar putea să vă placă și