数字库全局电源改为Inherited电源

数字库全局电源改为Inherited电源

步骤1:
Copy一份原始的数字库做为Work Library,将库中无schematic的单元全部删除,主要是filler cell。

步骤2:
用skill函数将库中所有schematic的vdd!和vss!改为vdd和vss。skill函数为CCSchangeGlobalBangPinsInSchemLib.il,在virtuoso的CIW中输入:load(“CCSchangeGlobalBangPinsInSchemLib.il”)。然后调用CCSchangeGlobalBangPinsInSchemLib(lib ?newDirection “inputOutput”)。lib为要操作的数字库。

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;         _               Copyright (c) 2016
;;       c a d e n c e     Cadence Design Systems
;;                         All Rights Reserved
;;
;; THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF CADENCE DESIGN SYSTEMS
;; The copyright notice above does not evidence any actual or intended
;; publication of such source code.
;;
;; This code is the Intellectual Property of Cadence and a license has been
;; acquired through purchase from Cadence.
;; Unless otherwise contractually defined, the Customer may use this IP code
;; exclusively for the target design environment for which it was acquired
;; from Cadence. The code may be modified for maintenance purposes due
;; to changes in the target design environment.
;;
;; This code remains Cadence intellectual property and may not
;; be given to third parties, neither in original nor in modified
;; versions, without explicit written permission from Cadence.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      /********************************************************************
      * DISCLAIMER: The following code is provided for Cadence customers  *
      * to use at their own risk. The code may require modification to    *
      * satisfy the requirements of any user. The code and any            *
      * modifications to the code may not be compatible with current or   *
      * future versions of Cadence products.                              *
      *                                                                   *
      * THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING    *
      * WITHOUT LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED WARRANTIES   *
      * OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.               *
      ********************************************************************/

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Function    : CCSchangeGlobalBangPinsInSchemLib
;;; Date        : 2016.09.28
;;; Description : Remove the ! for all globals nets and update pins
;;; How to Run    : CCSchangeGlobalBangPinsInSchemLib(lib ?newDirection "inputOutput")
;;;
;;; Tested in     : IC6.1.67
;;; SKILL Lint Score IC50(Max=100) : 100
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(procedure (CCSchangeGlobalBangPinsInSchemLib lib @key
				 (newDirection "inputOutput")
				 (views  "schematic"))
  (let (libId l_views cname cv doSave (thefun "CCSchangeGlobalBangPinsInSchemLib"))
    libId = ddGetObj(lib)
    (unless libId
      error( "%s:ERR00: Unable to locate library %L\n" thefun lib)) ; unless
    l_views = parseString(views)

    info( "[%s] Update pins and nets for library %L\n" thefun lib )
    info( "[%s] Processing views: %L\n" thefun l_views )

    ;;; process all cells in the given library ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (foreach cell libId~>cells
      cname = cell~>name
      ;;; open all views of the given types (default: schematic) ;;;;;;
      (foreach view setof(xx cell~>views~>name member(xx l_views))
        info( "[%s]   - Processing: %s / %s\n" thefun cname view )
        cv = dbOpenCellViewByType( lib cname view nil "a")
        doSave = (CCSchangeGlobalBangPinsInSchem cv ?newDirection newDirection)
      ) ; foreach (view)
      ;;; if required, perform a save on the cellview ;;;;;;;;;;;;;;;;;;;;;;;;;;
      (when doSave
	(schCheck cv)
        (dbSave cv)
      ) ; when
      (dbClose cv)
    ) ; foreach (cell)
  ) ; let
) ; procedure CCSchangeGlobalBangPinsInSchemLib

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Function    : CCSchangeGlobalBangPinsInSchem
;;; Date        : 2016.09.28
;;; Description : Remove the ! for all globals nets and update pins
;;; How to Run    : CCSchangeGlobalBangPinsInSchem(cellView ?newDirection "inputOutput")
;;;
;;; Tested in     : IC6.1.67
;;; SKILL Lint Score IC50(Max=100) : 100
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(procedure (CCSchangeGlobalBangPinsInSchem cellView @key
				 (newDirection "inputOutput"))
  (let ((netsToChange setof( netId cellView~>nets rexMatchp("!" netId~>name)))
         pin_cell cv_sym saveFlag)
    (case newDirection
      ("input" pin_cell="ipin")
      ("output" pin_cell="opin")
      ("inputOutput" pin_cell="iopin")
      (t error("Invalid direction %L specified, valid directions are input,
                 output, inputOutput\n" newDirection))
    ) ;case
    cv_sym=dbOpenCellViewByType("basic" pin_cell "symbol" "schematicSymbol" "r")

    (when netsToChange
       (foreach net netsToChange
          (letseq ((netname net~>name)
                   (newName (substring netname 1 (strlen netname)-1))
		   newnetId labelFigs)
             ;;; Replace the pin direction
	     (when newDirection && net~>pins
	       (let (pinId)
	       pinId = car(net~>pins)
	       pinId~>fig~>master=cv_sym
	       pinId~>direction = newDirection
	       pinId~>term~>direction = newDirection))

             ;;; Replace all things to new names for net
	     newnetId=dbCreateNet(cellView newName)
             dbMergeNet(newnetId net)
	     (newnetId~>term~>name = newName)
	     labelFigs = (setof fig newnetId~>figs fig~>theLabel == netname)
	     (when labelFigs (foreach fig labelFigs fig~>theLabel = newName))
	     ))
	     saveFlag = t)
     ;; Returns
     saveFlag))

步骤3:
调用skill函数将指定的pin改为Inherited的类型。skill函数为CCSpgNetExp.il。先在CIW中load skill函数,然后调用CCSpgNetExpLib(“mylib” list(“vdd” “vss”))

/*************************************************************************
* DISCLAIMER: The following code is provided for Cadence customers       *
* to use at their own risk. The code may require modification to         *
* satisfy the requirements of any user. The code and any modifications   *
* to the code may not be compatible with current or future versions of   *
* Cadence products. THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, *
* INCLUDING WITHOUT LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED         *
* WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.         *
*************************************************************************/

/* USAGE:
SKILL script CCSpgNetExp.il can create the net expression on the pin and at the same time take care of the named wire.

Load the SKILL code in CIW:
load "CCSpgNetExp.il"

This defines a procedure named CCSpgNetExpCell and it expects 4 arguments:

1. Library name
2. Cell name
3. View name
4. List of power and ground pin names on which net expression needs to be added.

And then call:
CCSpgNetExpCell("mylib" "mycell" "schematic" list("VDD" "VSS"))

To make this change on all schematics of a given library call:
CCSpgNetExpLib("mylib" list("VDD" "VSS"))

*/


procedure(CCSschNetAndTermRename(cvId oldNetname newNetName "dtt")
let(()
foreach( term cvId~>terminals
	if(term~>name == oldNetname then
	term~>name = newNetName ;change terminals name
	printf("\tRenamed Terminal %d->%s ---> %d->%s\n" term oldNetname term term~>name)
		); if
	) ;foreach

foreach( net cvId~>nets
	if(net~>name == oldNetname then
		foreach( fig net~>figs
			when( fig~>objType == "label"
				fig~>theLabel = newNetName ;change the label attached with nets
			printf("\tRenamed Net->Fig->theLabel %d->%s ---> %d->%s\n" net oldNetname net fig~>theLabel)
				) ;when
			) ;foreach
		); if
) ;foreach
); let
); procedure

procedure(CCSpgNetExpCell(libName cellName viewName powerPinNames "tttl")
let((cv netId netName locNet glbNet netExpr dummyNet)
;Open schematic
cv = dbOpenCellViewByType(libName cellName viewName "schematic" "a")
printf("\tAll Nets in Schematic:\n\t%L\n\n" cv~>nets~>name)
printf("\tAll Terms in Schematic:\n\t%L\n\n" cv~>nets~>term~>name)

foreach(pwrPin powerPinNames
	if(dbFindNetByName(cv pwrPin)~>term then
	netId = dbFindTermByName(cv pwrPin)
	netName = netId~>name
	locNet = dbFindNetByName(cv pwrPin)
	glbNet = dbFindNetByName(cv strcat(pwrPin "!"))
	
	printf("\tFound Power Pin Net: %L->%L\n" netId pwrPin)

		if(and(locNet glbNet) then
		printf("\t\tFound Global Power Pin Net: %L->%L\n" glbNet glbNet~>name)
		warn("\t\tGlobal Power Pin Net %L will short with Net %L\n" glbNet~>name pwrPin)
		netExpr = strcat( "[@" pwrPin ":%:" glbNet~>name "]" )
	else
	netExpr = strcat( "[@" pwrPin ":%:" pwrPin "!]" )

			); if

		if(dbGetTermNetExpr(dbFindTermByName(cv pwrPin)) then
		printf("\t\tFound Terminal Net Expression: %L\n" dbGetTermNetExpr(netId))
		printf("\t\tReplacing Old Net Expression Label %s to New Net Expression Label %s\n" dbGetTermNetExpr(netId) netExpr)
		dbDeleteObject(glbNet)
		dbReplaceTermNetExpr(netId netExpr)
		CCSschNetAndTermRename(cv pwrPin strcat(pwrPin "!"))
		dbSave(cv)
		t
	else
	printf("\t\tNo Terminal Net Expression Found on Net: %L\n" dbFindTermByName(cv pwrPin)~>name)
	printf("\t\tCreating New Net Expression Label %s at Net %s\n" netExpr netName)
	dbCreateTermNetExpr(netId netExpr)
	CCSschNetAndTermRename(cv pwrPin strcat(pwrPin "!"))
	dbSave(cv)
	t
			); if */
		); if

	if(and(dbFindNetByName(cv pwrPin) dbFindNetByName(cv strcat(pwrPin "!"))) then
	printf("\tNet %s and %s both Found.\n" pwrPin strcat(pwrPin "!"))
	dummyNet = dbFindNetByName(cv pwrPin)
	printf("\tRenaming Dummy Net %d->%s ---> %d->%s....\n" dummyNet dummyNet~>name dummyNet strcat(pwrPin "!"))
			CCSschNetAndTermRename(cv pwrPin strcat(pwrPin "!"))
	dbSave(cv)
	t
		); if
	); foreach

;Run schematic check and Save
dbSave(cv)
t
schVIC(cv)
schCheck(cv)
dbClose(cv)
); let
); procedure

procedure(CCSpgNetExpLib(library powerPinNames "tl")
let((cellNo libName cellName viewName)
unless(libName=ddGetObj(library) error("Library %s does not exists\n" library))
cellNo = 0
foreach(cell libName~>cells
	if(exists(x cell~>views~>name (x=="schematic")) then
	cellNo = cellNo+1
	libName = library
	cellName = cell~>name
	viewName = "schematic"
	printf("%d.\tProcessing cell %s\n" cellNo cellName)
	CCSpgNetExpCell(libName cellName viewName powerPinNames)
		) ;if
	);foreach
) ;let
) ; procedure 

步骤4:
将之前删除的cell拷贝回来,然后调用DPDK的PasFlexUpdateLib更新check and save数字库。

步骤1:Copy一份原始的数字库做为Work Library,将库中无schematic的单元全部删除,主要是 […]