skill for hierarchical copy including referenced libs

T

t-t

Guest
Hi All-
I'm looking for way to copy an entire design to a new location but I
do not want to break the reference links. For example:
Now:
LibA
schematicA with some blocks instantiated from LibB
schematicB
schematicC
LibB
contains schematics referenced by schematicA

After the copy procedure:
LibA_new
schematicA with some blocks instantiated LibB_new
LibB_new
contains schematics referenced by schematicA

I think this can done via skill program but (to be honest) I'm a
beginnner at skill. If someone has something similar what I'm looking
and willing to share or has something I can starting hacking, I will
be deeply appreciated.
 
Hi,

the code I posted here is very _ALPHA_ and not well tested,
it also does not exactly what you need and it is customized
for my companies environment, but maybe it could give you a
starting point.

Look for cdscopy in the docs.
The main functios are ccpCopy or ccpCopyDesign, to collect your design use
gdmCreateSpecList, gdmCreateSpec and gdmAddSpecToSpecList.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Disclaimer : NO WARRANTY, this SKILL function(s) is(are) released
;; without any warranty. The Author does not warrant,
;; guarantee, or make any representations regarding the
;; use, or the results of use of this SKILL function(s).
;; The entire risk of the use of this SKILL function(s)
;; is with you.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; File Name : copyAndRename.il
;;
;; Function(s) : XIcopyAndRename
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Application : Design Framework II
;;
;; SW Release : 5.0.32
;;
;; SKILL Lint : $passed$
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyAndRename( )
;;
;; Description : This is a script to copy all cells of a library
;; into a new one or copy a design hierarchical to
;; a new library. It renames the cell name prefix
;; regarding the Xignal design guidelines automatically
;; to the prefix of the new library and does an
;; automatic update of the cell references in the
;; new library.
;;
;; Arguments : -
;;
;; Return Value : -
;;
;; Example : -
;;
;; Modification : None
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyAndRename( )

unless( boundp( 'GBcopyAndRenameForm ) && hiIsFormDisplayed( GBcopyAndRenameForm )
XIcreateCopyAndRenameForm( )
)

hiDisplayForm( GBcopyAndRenameForm )

) ;; close procedure XIcopyAndRename


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIprintToOutPort
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIprintToOutPort( l_printArgument )
;;
;; Description : fprintf wrapper function.
;;
;; Arguments : l_printArgument List of print arguments
;; e.g. text string and varibables.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIprintToOutPort( printArgument )

t_logFile = hiGetCurrentForm( )->r_logFileField->value
p_outPort = outfile( t_logFile "a" )

apply( 'fprintf cons( p_outPort printArgument ) )

close( p_outPort )

) ;; close XIprintToOutPort


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrInputCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrInputCb( formDataStruc )
;;
;; Description : Source library and source top cell field callback
;; function, checks if the source library and source top
;; cell for the copy procedure exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrInputCb( formDataStruc )

unless( formDataStruc->r_srcLibField->value == ""
if( ddGetObj( formDataStruc->r_srcLibField->value ) then
hiHighlightField(
formDataStruc
'r_srcLibField
'background
)
formDataStruc->r_srcCellPrefixField->value =
formDataStruc->r_srcLibField->value

unless( formDataStruc->r_srcTopCellField->value == ""
if( ddGetObj( formDataStruc->r_srcLibField->value
formDataStruc->r_srcTopCellField->value ) then
hiHighlightField(
formDataStruc
'r_srcTopCellField
'background
)
t
else
hiHighlightField(
formDataStruc
'r_srcTopCellField
'error
)
XIsrcTopCellFieldDialog( formDataStruc )
nil
) ;; close if
) ;; close unless
t
else
hiHighlightField(
formDataStruc
'r_srcLibField
'error
)
XIsrcLibFieldDialog( formDataStruc )
nil
) ;; close if

) ;; close unless

) ;; close XIscrInputCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIsrcLibFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIsrcLibFieldDialog( formDataStruc )
;;
;; Description : Source library field dialog,
;; informs the user if the source library for the copy
;; procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIsrcLibFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_srcLibDBox )
?dboxBanner "Library Error!"
?dboxText strcat(
"Library '"
formDataStruc->r_srcLibField->value
"' does not exist.\n"
)
?buttonLayout 'UserDefined
?buttons '( "Reset" )
?callback '( "XIscrLibDBoxResetCb( hiGetCurrentForm( ) )" )
?dialogType hicErrorDialog
)

) ;; close XIsrcLibFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrLibDBoxResetCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrLibDBoxResetCb( formDataStruc )
;;
;; Description : Source library field reset callback,
;; resets the source library field if the source library
;; for the copy procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrLibDBoxResetCb( formDataStruc )
hiHighlightField(
formDataStruc
'r_srcLibField
'background
)
formDataStruc->r_srcLibField->value = ""
) ;; close XIscrLibDBoxResetCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIsrcTopCellFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIsrcTopCellFieldDialog( formDataStruc )
;;
;; Description : Source top cell field dialog,
;; informs the user if the source top cell for the copy
;; procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIsrcTopCellFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_srcTopCellDBox )
?dboxBanner "Cell Error!"
?dboxText strcat(
"Cell '"
formDataStruc->r_srcTopCellField->value
"' does not exist.\n"
)
?buttonLayout 'UserDefined
?buttons '( "Reset" )
?callback '( "XIscrTopCellDBoxResetCb( hiGetCurrentForm( ) )" )
?dialogType hicErrorDialog
)

) ;; close XIsrcTopCellFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrTopCellDBoxResetCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrTopCellDBoxResetCb( formDataStruc )
;;
;; Description : Source top cell field reset callback,
;; resets the source top cell field if the source top cell
;; for the copy procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrTopCellDBoxResetCb( formDataStruc )
hiHighlightField(
formDataStruc
'r_srcTopCellField
'background
)
formDataStruc->r_srcTopCellField->value = ""
) ;; close XIscrLibDBoxResetCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibFieldCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibFieldCb( formDataStruc )
;;
;; Description : Destination library field callback function,
;; checks if the destination library for the copy procedure
;; allready exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibFieldCb( formDataStruc )

unless( formDataStruc->r_destLibField->value == ""
if( ddGetObj( formDataStruc->r_destLibField->value ) then
hiHighlightField(
formDataStruc
'r_destLibField
'error
)
XIdestLibFieldDialog( formDataStruc )
nil
else
hiHighlightField(
formDataStruc
'r_destLibField
'background
)
formDataStruc->r_destCellPrefixField->value =
formDataStruc->r_destLibField->value
t
) ;; close if

) ;; close unless

) ;; close XIdestLibFieldCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibFieldDialog( formDataStruc )
;;
;; Description : Destination library field dialog,
;; informs the user if the destination library for the copy
;; procedure allready exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_destLibDBox )
?dboxBanner "Library Error!"
?dboxText strcat(
"Library '"
formDataStruc->r_destLibField->value
"' exist.\n"
)
?dialogType hicErrorDialog
?buttonLayout 'UserDefined
?buttons '( "Overwrite" "New" )
?callback '(
"XIdestLibDBoxOverwriteCb( hiGetCurrentForm( ) )"
"XIdestLibDBoxNewCb( hiGetCurrentForm( ) )"
)
)

) ;; close XIsrcLibFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibDBoxOverwriteCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibDBoxOverwriteCb( formDataStruc )
;;
;; Description : Destination library field dialog callback,
;; removes the error blinking form the field
;; and prevents the library name from being
;; reset.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibDBoxOverwriteCb( formDataStruc )

hiHighlightField(
formDataStruc
'r_destLibField
'background
)

formDataStruc->r_destCellPrefixField->value =
formDataStruc->r_destLibField->value

) ;; close XIdestLibDBoxOverwriteCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibDBoxNewCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibDBoxNewCb( formDataStruc )
;;
;; Description : Destination library field dialog callback,
;; removes the error blinking form the field
;; and reset the library field to an empty
;; field.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibDBoxNewCb( formDataStruc )

hiHighlightField(
formDataStruc
'r_destLibField
'background
)

formDataStruc->r_destLibField->value = ""
formDataStruc->r_destCellPrefixField->value = ""

) ;; close XIdestLibDBoxNewCb

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIchoiceFieldCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 24 Mai, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIchoiceFieldCb( formDataStruc )
;;
;; Description : Choice field callback, enables or disables
;; top cell field entry.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIchoiceFieldCb( formDataStruc )
let( ( ( t_choice formDataStruc->r_choiceField->value ) )

case( t_choice
( "Whole library"
formDataStruc->r_srcTopCellField->editable = nil
formDataStruc->r_srcTopCellField->value = ""

)
( "Top cell"
formDataStruc->r_srcTopCellField->editable = t
)
) ;; close case

) ;; close let

) ;; close XIchoiceFieldCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcopyMonitor
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyMonitor(
;;
;; Description :
;;
;; Arguments : copyMonitorFunctionSymbol
;; copyPhase
;; fromPath
;; toPath
;; fromSpec
;; toSpec
;; numCount
;; numTotal
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyMonitor( copyMonitorFunctionSymbol
copyPhase
fromPath
toPath
fromSpec
toSpec
numCount
numTotal
"ttttggxx"
)

if( geqp( numCount 0 ) then
if( neq( fromSpec nil ) then
XIprintToOutPort(
list(
"Copy monitor: %L to %L, %d of %d files.\n"
gdmInspectSpec( fromSpec "CDBA" )
gdmInspectSpec( toSpec "CDBA" )
numCount
numTotal
)
)
) ;; close if neq
) ;; close if geqp

) ;; close XIcopyMonitor


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcopyAndRenameFormCB
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyAndRenameFormCB( formDataStruc )
;;
;; Description : Form callback function starts the copy process.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyAndRenameFormCB( formDataStruc )
let( (
b_monitorLibraryCopy
b_monitorCellCopy
t_srcLibName
t_scrTopCellName
t_destLibName
t_srcCellPrefix
t_destCellPrefix
q_srcList
q_src
q_destList
q_dest
g_oldCopyMonitor
)

when( isFile( formDataStruc->r_logFileField->value )
deleteFile( formDataStruc->r_logFileField->value )
)

l_copySkipLibList = '( "analogLib" "basic" "sample" "xigLib" "xigPcell"
"xigStdCell" )
t_srcLibName = formDataStruc->r_srcLibField->value
t_scrTopCellName = formDataStruc->r_srcTopCellField->value
t_destLibName = formDataStruc->r_destLibField->value
t_srcCellPrefix = formDataStruc->r_srcCellPrefixField->value
t_destCellPrefix = formDataStruc->r_destCellPrefixField->value

;; copy library section
q_srcList = gdmCreateSpecList( )
q_destList = gdmCreateSpecList( )

if( t_scrTopCellName != "" then
q_src = gdmCreateSpec( t_srcLibName t_scrTopCellName "" "" "CDBA" )

q_copySkipLibList = gdmCreateSpecList( )
foreach( t_copySkipLib l_copySkipLibList
q_copySkipLib = gdmCreateSpec( t_copySkipLib "" "" "" "CDBA" )
gdmAddSpecToSpecList( q_copySkipLib q_copySkipLibList )
) ;; close foreach
else
q_src = gdmCreateSpec( t_srcLibName "" "" "" "CDBA" )
) ;; close if

q_dest = gdmCreateSpec( t_destLibName "" "" "" "CDBA" )
gdmAddSpecToSpecList( q_src q_srcList )
gdmAddSpecToSpecList( q_dest q_destList )

;; register copy monitor
if( formDataStruc->r_monitorLibCopyField->value then
g_oldCopyMonitor = ccpRegMonitor( 'XIcopyMonitor )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
else
g_oldCopyMonitor = ccpRegMonitor( nil )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
)

if( t_scrTopCellName != "" then

ccpCopyDesign(
q_src ;; 1 source gdm spec
q_dest ;; 2 destination gdm spec
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
q_copySkipLibList ;; 5 gdm spec list cont. libs to exclude
nil ;; 6 view type list
nil ;; 7 view name list
"" ;; 8 reg ex for view copying
"CDBA" ;; 9 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 10 cross reference updater
;q_destList ;; 11 destination library gdm spec
)

techBindTechFile(
ddGetObj( t_destLibName )
techGetTechLibName( ddGetObj( t_srcLibName ) )
"techfile.cds"
;t
)

else

ccpCopy(
q_srcList ;; 1 source gdm spec list
q_destList ;; 2 destination gdm spec list
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
nil ;; 5 view type list
nil ;; 6 view name list
"" ;; 7 reg ex for view copying
"CDBA" ;; 8 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 9 cross reference updater
;q_destList ;; 10 destination library gdm spec
)

) ;; close if

;; rename cell section
d_libId = ddGetObj( t_destLibName )

l_cellsWithoutLibraryPrefix =
setof(
d_cell
d_libId~>cells
!rexMatchp( strcat( "^" t_srcCellPrefix ) d_cell~>name )
)

foreach( d_cell l_cellsWithoutLibraryPrefix
XIprintToOutPort(
list( "*WARNING* Cell without a library name prefix will not be renamed
and updated: (%s %s).\n"
d_cell~>lib~>name d_cell~>name )
)
) ;; close foreach


l_cellsWithLibraryPrefix =
setof(
d_cell
d_libId~>cells
rexMatchp( strcat( "^" t_srcCellPrefix ) d_cell~>name )
)

;; soultion 2 24.05 sec
q_srcList = gdmCreateSpecList( )
q_destList = gdmCreateSpecList( )

foreach( d_cell l_cellsWithLibraryPrefix

q_src = gdmCreateSpec( t_destLibName d_cell~>name "" "" "CDBA" )
gdmAddSpecToSpecList( q_src q_srcList )

if( length( parseString( d_cell~>name ) ) == 1 &&
d_cell~>name == t_srcCellPrefix then
t_destCellName = t_destCellPrefix
else
t_destCellName = buildString(
cons(
t_destCellPrefix
cdr( parseString( d_cell~>name "_" ) )
)
"_" )
)

q_dest = gdmCreateSpec( t_destLibName t_destCellName "" "" "CDBA" )
gdmAddSpecToSpecList( q_dest q_destList )

) ;; close foreach

;; register update monitor
if( formDataStruc->r_monitorCellRenameField->value then
g_oldCopyMonitor = ccpRegMonitor( 'XIcopyMonitor )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
else
g_oldCopyMonitor = ccpRegMonitor( nil )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
)

ccpCopy(
q_srcList ;; 1 source gdm spec list
q_destList ;; 2 destination gdm spec list
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
nil ;; 5 view type list
nil ;; 6 view name list
"" ;; 7 reg ex for view copying
"CDBA" ;; 8 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 9 cross reference updater
q_destList ;; 10 destination library gdm spec
)

foreach( d_cell l_cellsWithLibraryPrefix
ddDeleteObj( ddGetObj( t_destLibName d_cell~>name ) )
) ;; clsoe foreach

when( formDataStruc->r_viewLogFileField->value
view( formDataStruc->r_logFileField->value )
) ;; close when

) ;; close let

) ;; close XIcopyAndRenameFormCB


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcreateCopyAndRenameForm
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com>
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcreateCopyAndRenameForm( )
;;
;; Description : From description.
;;
;; Arguments : -
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcreateCopyAndRenameForm( )
let( (
( x_startXpos 15 )
( x_startYpos 15 )
r_srcLibField r_destLibField r_updateInstOfLibField r_sepField
r_srcCellPrefixField r_destCellPrefixFiels r_updateInstField
)

;; creating the fields

r_choiceField =
hiCreateCyclicField(
?name 'r_choiceField
?choices '( "Whole library" "Top cell" )
?prompt "Copy"
?value "Whole library"
?callback "XIchoiceFieldCb( hiGetCurrentForm( ) )"
)

r_sep1Field =
hiCreateSeparatorField(
?name 'r_sep1Field
)

r_srcLibField =
hiCreateStringField(
?name 'r_srcLibField
?prompt "Source library"
?callback "XIscrInputCb( hiGetCurrentForm( ) )"
;?callback "XIsrcLibFieldCb( hiGetCurrentForm( ) )"
?editable t
)

r_srcTopCellField =
hiCreateStringField(
?name 'r_srcTopCellField
?prompt "Source top cell"
?callback "XIscrInputCb( hiGetCurrentForm( ) )"
;?callback "XIsrcTopCellFieldCb( hiGetCurrentForm( ) )"
?editable nil
)

r_destLibField =
hiCreateStringField(
?name 'r_destLibField
?prompt "Destination library"
?callback "XIdestLibFieldCb( hiGetCurrentForm( ) )"
?editable t
)

r_updateInstOfLibField =
hiCreateBooleanButton(
?name 'r_updateInstOfLibField
?buttonText "Update instances of entire library"
?defValue t
?enabled nil
)

r_monitorLibCopyField =
hiCreateBooleanButton(
?name 'r_monitorLibCopyField
?buttonText "Monitor library copy"
?defValue nil
)

r_sep2Field =
hiCreateSeparatorField(
?name 'r_sep2Field
)

r_srcCellPrefixField =
hiCreateStringField(
?name 'r_srcCellPrefixField
?prompt "Source cell prefix"
?callback ""
?editable t
)

r_destCellPrefixField =
hiCreateStringField(
?name 'r_destCellPrefixField
?prompt "Destination cell prefix"
?callback ""
?editable t
)

r_updateInstField =
hiCreateBooleanButton(
?name 'r_updateInstField
?buttonText "Update instances after rename"
?defValue t
?enabled nil
)

r_monitorCellRenameField =
hiCreateBooleanButton(
?name 'r_monitorCellRenameField
?buttonText "Monitor cell rename"
?defValue nil
)

r_sep3Field =
hiCreateSeparatorField(
?name 'r_sep3Field
)

r_logFileField =
hiCreateStringField(
?name 'r_logFileField
?prompt "Log file"
?defValue "./copyAndRename.log"
?editable t
)

r_viewLogFileField =
hiCreateBooleanButton(
?name 'r_viewLogFileField
?buttonText "View log file"
?defValue t
)


hiCreateAppForm(
?name 'GBcopyAndRenameForm
?formTitle "Copy library and rename cell prefix"
?callback 'XIcopyAndRenameFormCB
?initialSize list( 400 670 )
?fields list(
list(
r_choiceField
x_startXpos:x_startYpos 350:25 150
)
list(
r_sep1Field
x_startXpos:x_startYpos + 45 350:0
)
list(
r_srcLibField
x_startXpos:x_startYpos + 90 350:25 150
)
list(
r_srcTopCellField
x_startXpos:x_startYpos + 135 350:25 150
)
list(
r_destLibField
x_startXpos:x_startYpos + 180 350:25 150
)
list(
r_updateInstOfLibField
x_startXpos:x_startYpos + 225 350:25 220
)
list(
r_monitorLibCopyField
x_startXpos:x_startYpos + 270 350:25 220
)
list(
r_sep2Field
x_startXpos:x_startYpos + 315 350:0
)
list(
r_srcCellPrefixField
x_startXpos:x_startYpos + 360 350:25 150
)
list(
r_destCellPrefixField
x_startXpos:x_startYpos + 405 350:25 150
)
list(
r_updateInstField
x_startXpos:x_startYpos + 450 350:25 220
)
list(
r_monitorCellRenameField
x_startXpos:x_startYpos + 495 350:25 220
)
list(
r_sep3Field
x_startXpos:x_startYpos + 540 350:0
)
list(
r_logFileField
x_startXpos:x_startYpos + 585 350:25 150
)
list(
r_viewLogFileField
x_startXpos:x_startYpos + 630 350:25 220
)
)
?unmapAfterCB t
;; positional attachments for 2 dimensional forms
;; when the form is resized the widht of the
;; dependend fields is resised too
?attachmentList list(
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
nil
nil
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
nil
nil
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
)
)

) ;; close let

) ;; close




t-t wrote:
Hi All-
I'm looking for way to copy an entire design to a new location but I
do not want to break the reference links. For example:
Now:
LibA
schematicA with some blocks instantiated from LibB
schematicB
schematicC
LibB
contains schematics referenced by schematicA

After the copy procedure:
LibA_new
schematicA with some blocks instantiated LibB_new
LibB_new
contains schematics referenced by schematicA

I think this can done via skill program but (to be honest) I'm a
beginnner at skill. If someone has something similar what I'm looking
and willing to share or has something I can starting hacking, I will
be deeply appreciated.
 
"t-t" == t-t <t-t@earthlink.net> writes:
t-t> Hi All- I'm looking for way to copy an entire design to a new
t-t> location but I do not want to break the reference links. For
I usually do this as a two step process in library Manager - 1) copy
libraries using libraryManager with Update Instances set to new
copies. 2) Edit->Rename reference library from LibB to LibB_New

Satya


--
Remove XXX and YYY to get my address
 
Satya Mishra <snmishra@XXXhotYYYpop.com> wrote in message news:<vv0wu0wulmc.fsf@quandary.nsc.com>...
"t-t" == t-t <t-t@earthlink.net> writes:

t-t> Hi All- I'm looking for way to copy an entire design to a new
t-t> location but I do not want to break the reference links. For
I usually do this as a two step process in library Manager - 1) copy
libraries using libraryManager with Update Instances set to new
copies. 2) Edit->Rename reference library from LibB to LibB_New
This is the way I do it too, but as it involves human interraction it
is error prone and difficult to justify if you are making a derivative
product. If you can have a skill script attached to a button or a menu
item in your design kit then the design review will be easier as you
can blame the script if something blows up. I corporately grew up with
the mentality that scripts can be relied, humans not. Of course,
scripts have bugs, but when all bugs are eliminated then they work
perfect. A human can perform the same error more than twice.

--
Svenn
 
Bernd Fischer <""bernd.fischer\"@xignal-A%&HY%$v#&G=.de> wrote in message news:<2m9c34FkqfreU1@uni-berlin.de>...
the code I posted here is very _ALPHA_ and not well tested,
it also does not exactly what you need and it is customized
for my companies environment, but maybe it could give you a
starting point.
For the SKILL record, the code kindly posted by Bernd does NOT
contain any Cadence undocumented unsupported SKILL functions
(aka private functions). This is good.

A quick SKILL Survey from the DFII Command Interpreter Window:
CIW: Tools->SKILL Development->SKILL Surveyor
reveals: 61 Cadence functions called
15 Customer-defined functions created

All 15 Customer-defined functions properly start with at least one
capital letter (to distinguish between Cadence-supported functions, on
sight) and a discernible prefix (XI). None of the 15 Customer-defined
functions are re-defined Cadence functions (again, this is all good).

No Customer-defined or Cadence-called function is mis-spelled
(normally we easily find mis-spelled and mis-capitalized function
calls in Customer SKILL code by running a simple one-minute survey).

Working backward by release, of the 61 Cadence functions called, all
61 are documented & supported in the latest DFII releases (including
those in development) e.g., ICOA5141, ICOA5033, IC5251, IC5141, &
IC5033USR2.

One of those 61 Cadence functions was changed in release IC5033, i.e.:
hiDisplayAppDBox (FRAMEWORK/UI/SKILL_FUNC)
But that change was marked EC (enhancemnet, compatible with most
Customer SKILL code) so that change should not negatively affect
users.

Before-and-after arguments:
rel50032(hiDisplayAppDBox:mad:key:(name:(quote:dummyDefaultDBox
Sym)):(dboxBanner:""):(dboxText:""):(help:""):(callback:""):location:(di
alogType:hicWarningDialog):(dialogStyle:(quote:modal)):(buttonLayou
t:(quote:OKCancel)):(defaultButton:1):buttons:dontPopdowns:"stttglxssxgg")
relIC5033(hiDisplayAppDBox:mad:key:(name:(quote:dummyDefaultDBo
xSym)):(dboxBanner:""):(dboxText:""):help:(callback:""):location:(dialogT
ype:hicWarningDialog):(dialogStyle:(quote:modal)):(buttonLayout:(qu
ote:OKCancel)):(defaultButton:1):buttons:dontPopdowns:"sttgglxssxgg")

Note: The SKILL Survey sent to users using product #900 color codes
the differences (in red) to make them stand out easier.

Likewise, one function was changed in release 50032:
hiCreateStringField (FRAMEWORK/UI/SKILL_FUNC)
again, it was deemed a compatible enhancement (EC).

Still working backward, one function was changed in release 500MSR3:
hiCreateStringField (FRAMEWORK/UI/SKILL_FUNC)
and, again, this change (different than the previous listing) was EC.

Working further backward, the IC500 release has 6 functions changed:
outfile FRAMEWORK/SKILLCORE/FUNDAMENTA(iain)
hiCreateStringField FRAMEWORK/UI/SKILL_FUNC
hiCreateCyclicField FRAMEWORK/UI/SKILL_FUNC
hiCreateBooleanButton FRAMEWORK/UI/SKILL_FUNC
hiCreateSeparatorField FRAMEWORK/UI/SKILL_FUNC
hiCreateAppForm FRAMEWORK/UI/SKILL_FUNC
All of which were deemed to be compatible enhancements (EC).

I don't know how far you want me to go backward, but 5 more functions
were changed in IC446, 7 more in IC445, 5 more in IC443, none in
IC442, and 12 in IC441.

Note: The actual before & after complete argument changes were emailed
to Bernd (and to anyone who runs the product 900 SKILL Survey on this
code so I won't delve further in this posting). A pie chart of
defined/undefined/redefined, etc. was also sent (for management
perusal).

The slightly bad news is that, in IC445, IC443, & IC442, one function
is not defined:
ccpRegMonitor

Worse yet, in IC441, 7 functions are not defined:
gdmInspectSpec
ccpCopy
gdmCreateSpecList
ccpCopyDesign
ccpRegMonitor
gdmAddSpecToSpecList
gdmCreateSpec

There's much more information available to anyone with Product 900 on
maintenance (SKILL Development Environment) simply by running this
code (or any code) through a SKILL Survey - but I think you get the
point.

This code, essentially, is good code syntactically for all of the
supported and in-development DFII releases based on a STATIC check of
the functions called (I didn't run a DYNAMIC SKILL Lint as I presumed
folks on this newsgroup already knew how to run SKILL Lint and Super
SKILL Lint (on thousands of files simultaneously).

Good work Bernd,
John Gianni
--
Everything I say in this USENET newsgroup is PERSONAL opinion!
 
Thanks for posting the code. It's definitely a starting point for me. Thanks again.

Bernd Fischer <""bernd.fischer\"@xignal-A%&HY%$v#&G=.de> wrote in message news:<2m9c34FkqfreU1@uni-berlin.de>...
Hi,

the code I posted here is very _ALPHA_ and not well tested,
it also does not exactly what you need and it is customized
for my companies environment, but maybe it could give you a
starting point.

Look for cdscopy in the docs.
The main functios are ccpCopy or ccpCopyDesign, to collect your design use
gdmCreateSpecList, gdmCreateSpec and gdmAddSpecToSpecList.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Disclaimer : NO WARRANTY, this SKILL function(s) is(are) released
;; without any warranty. The Author does not warrant,
;; guarantee, or make any representations regarding the
;; use, or the results of use of this SKILL function(s).
;; The entire risk of the use of this SKILL function(s)
;; is with you.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; File Name : copyAndRename.il
;;
;; Function(s) : XIcopyAndRename
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Application : Design Framework II
;;
;; SW Release : 5.0.32
;;
;; SKILL Lint : $passed$
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyAndRename( )
;;
;; Description : This is a script to copy all cells of a library
;; into a new one or copy a design hierarchical to
;; a new library. It renames the cell name prefix
;; regarding the Xignal design guidelines automatically
;; to the prefix of the new library and does an
;; automatic update of the cell references in the
;; new library.
;;
;; Arguments : -
;;
;; Return Value : -
;;
;; Example : -
;;
;; Modification : None
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyAndRename( )

unless( boundp( 'GBcopyAndRenameForm ) && hiIsFormDisplayed( GBcopyAndRenameForm )
XIcreateCopyAndRenameForm( )
)

hiDisplayForm( GBcopyAndRenameForm )

) ;; close procedure XIcopyAndRename


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIprintToOutPort
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIprintToOutPort( l_printArgument )
;;
;; Description : fprintf wrapper function.
;;
;; Arguments : l_printArgument List of print arguments
;; e.g. text string and varibables.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIprintToOutPort( printArgument )

t_logFile = hiGetCurrentForm( )->r_logFileField->value
p_outPort = outfile( t_logFile "a" )

apply( 'fprintf cons( p_outPort printArgument ) )

close( p_outPort )

) ;; close XIprintToOutPort


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrInputCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrInputCb( formDataStruc )
;;
;; Description : Source library and source top cell field callback
;; function, checks if the source library and source top
;; cell for the copy procedure exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrInputCb( formDataStruc )

unless( formDataStruc->r_srcLibField->value == ""
if( ddGetObj( formDataStruc->r_srcLibField->value ) then
hiHighlightField(
formDataStruc
'r_srcLibField
'background
)
formDataStruc->r_srcCellPrefixField->value =
formDataStruc->r_srcLibField->value

unless( formDataStruc->r_srcTopCellField->value == ""
if( ddGetObj( formDataStruc->r_srcLibField->value
formDataStruc->r_srcTopCellField->value ) then
hiHighlightField(
formDataStruc
'r_srcTopCellField
'background
)
t
else
hiHighlightField(
formDataStruc
'r_srcTopCellField
'error
)
XIsrcTopCellFieldDialog( formDataStruc )
nil
) ;; close if
) ;; close unless
t
else
hiHighlightField(
formDataStruc
'r_srcLibField
'error
)
XIsrcLibFieldDialog( formDataStruc )
nil
) ;; close if

) ;; close unless

) ;; close XIscrInputCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIsrcLibFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIsrcLibFieldDialog( formDataStruc )
;;
;; Description : Source library field dialog,
;; informs the user if the source library for the copy
;; procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIsrcLibFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_srcLibDBox )
?dboxBanner "Library Error!"
?dboxText strcat(
"Library '"
formDataStruc->r_srcLibField->value
"' does not exist.\n"
)
?buttonLayout 'UserDefined
?buttons '( "Reset" )
?callback '( "XIscrLibDBoxResetCb( hiGetCurrentForm( ) )" )
?dialogType hicErrorDialog
)

) ;; close XIsrcLibFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrLibDBoxResetCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrLibDBoxResetCb( formDataStruc )
;;
;; Description : Source library field reset callback,
;; resets the source library field if the source library
;; for the copy procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrLibDBoxResetCb( formDataStruc )
hiHighlightField(
formDataStruc
'r_srcLibField
'background
)
formDataStruc->r_srcLibField->value = ""
) ;; close XIscrLibDBoxResetCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIsrcTopCellFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIsrcTopCellFieldDialog( formDataStruc )
;;
;; Description : Source top cell field dialog,
;; informs the user if the source top cell for the copy
;; procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIsrcTopCellFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_srcTopCellDBox )
?dboxBanner "Cell Error!"
?dboxText strcat(
"Cell '"
formDataStruc->r_srcTopCellField->value
"' does not exist.\n"
)
?buttonLayout 'UserDefined
?buttons '( "Reset" )
?callback '( "XIscrTopCellDBoxResetCb( hiGetCurrentForm( ) )" )
?dialogType hicErrorDialog
)

) ;; close XIsrcTopCellFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrTopCellDBoxResetCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrTopCellDBoxResetCb( formDataStruc )
;;
;; Description : Source top cell field reset callback,
;; resets the source top cell field if the source top cell
;; for the copy procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrTopCellDBoxResetCb( formDataStruc )
hiHighlightField(
formDataStruc
'r_srcTopCellField
'background
)
formDataStruc->r_srcTopCellField->value = ""
) ;; close XIscrLibDBoxResetCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibFieldCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibFieldCb( formDataStruc )
;;
;; Description : Destination library field callback function,
;; checks if the destination library for the copy procedure
;; allready exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibFieldCb( formDataStruc )

unless( formDataStruc->r_destLibField->value == ""
if( ddGetObj( formDataStruc->r_destLibField->value ) then
hiHighlightField(
formDataStruc
'r_destLibField
'error
)
XIdestLibFieldDialog( formDataStruc )
nil
else
hiHighlightField(
formDataStruc
'r_destLibField
'background
)
formDataStruc->r_destCellPrefixField->value =
formDataStruc->r_destLibField->value
t
) ;; close if

) ;; close unless

) ;; close XIdestLibFieldCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibFieldDialog( formDataStruc )
;;
;; Description : Destination library field dialog,
;; informs the user if the destination library for the copy
;; procedure allready exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_destLibDBox )
?dboxBanner "Library Error!"
?dboxText strcat(
"Library '"
formDataStruc->r_destLibField->value
"' exist.\n"
)
?dialogType hicErrorDialog
?buttonLayout 'UserDefined
?buttons '( "Overwrite" "New" )
?callback '(
"XIdestLibDBoxOverwriteCb( hiGetCurrentForm( ) )"
"XIdestLibDBoxNewCb( hiGetCurrentForm( ) )"
)
)

) ;; close XIsrcLibFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibDBoxOverwriteCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibDBoxOverwriteCb( formDataStruc )
;;
;; Description : Destination library field dialog callback,
;; removes the error blinking form the field
;; and prevents the library name from being
;; reset.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibDBoxOverwriteCb( formDataStruc )

hiHighlightField(
formDataStruc
'r_destLibField
'background
)

formDataStruc->r_destCellPrefixField->value =
formDataStruc->r_destLibField->value

) ;; close XIdestLibDBoxOverwriteCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibDBoxNewCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibDBoxNewCb( formDataStruc )
;;
;; Description : Destination library field dialog callback,
;; removes the error blinking form the field
;; and reset the library field to an empty
;; field.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibDBoxNewCb( formDataStruc )

hiHighlightField(
formDataStruc
'r_destLibField
'background
)

formDataStruc->r_destLibField->value = ""
formDataStruc->r_destCellPrefixField->value = ""

) ;; close XIdestLibDBoxNewCb

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIchoiceFieldCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 24 Mai, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIchoiceFieldCb( formDataStruc )
;;
;; Description : Choice field callback, enables or disables
;; top cell field entry.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIchoiceFieldCb( formDataStruc )
let( ( ( t_choice formDataStruc->r_choiceField->value ) )

case( t_choice
( "Whole library"
formDataStruc->r_srcTopCellField->editable = nil
formDataStruc->r_srcTopCellField->value = ""

)
( "Top cell"
formDataStruc->r_srcTopCellField->editable = t
)
) ;; close case

) ;; close let

) ;; close XIchoiceFieldCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcopyMonitor
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyMonitor(
;;
;; Description :
;;
;; Arguments : copyMonitorFunctionSymbol
;; copyPhase
;; fromPath
;; toPath
;; fromSpec
;; toSpec
;; numCount
;; numTotal
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyMonitor( copyMonitorFunctionSymbol
copyPhase
fromPath
toPath
fromSpec
toSpec
numCount
numTotal
"ttttggxx"
)

if( geqp( numCount 0 ) then
if( neq( fromSpec nil ) then
XIprintToOutPort(
list(
"Copy monitor: %L to %L, %d of %d files.\n"
gdmInspectSpec( fromSpec "CDBA" )
gdmInspectSpec( toSpec "CDBA" )
numCount
numTotal
)
)
) ;; close if neq
) ;; close if geqp

) ;; close XIcopyMonitor


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcopyAndRenameFormCB
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyAndRenameFormCB( formDataStruc )
;;
;; Description : Form callback function starts the copy process.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyAndRenameFormCB( formDataStruc )
let( (
b_monitorLibraryCopy
b_monitorCellCopy
t_srcLibName
t_scrTopCellName
t_destLibName
t_srcCellPrefix
t_destCellPrefix
q_srcList
q_src
q_destList
q_dest
g_oldCopyMonitor
)

when( isFile( formDataStruc->r_logFileField->value )
deleteFile( formDataStruc->r_logFileField->value )
)

l_copySkipLibList = '( "analogLib" "basic" "sample" "xigLib" "xigPcell"
"xigStdCell" )
t_srcLibName = formDataStruc->r_srcLibField->value
t_scrTopCellName = formDataStruc->r_srcTopCellField->value
t_destLibName = formDataStruc->r_destLibField->value
t_srcCellPrefix = formDataStruc->r_srcCellPrefixField->value
t_destCellPrefix = formDataStruc->r_destCellPrefixField->value

;; copy library section
q_srcList = gdmCreateSpecList( )
q_destList = gdmCreateSpecList( )

if( t_scrTopCellName != "" then
q_src = gdmCreateSpec( t_srcLibName t_scrTopCellName "" "" "CDBA" )

q_copySkipLibList = gdmCreateSpecList( )
foreach( t_copySkipLib l_copySkipLibList
q_copySkipLib = gdmCreateSpec( t_copySkipLib "" "" "" "CDBA" )
gdmAddSpecToSpecList( q_copySkipLib q_copySkipLibList )
) ;; close foreach
else
q_src = gdmCreateSpec( t_srcLibName "" "" "" "CDBA" )
) ;; close if

q_dest = gdmCreateSpec( t_destLibName "" "" "" "CDBA" )
gdmAddSpecToSpecList( q_src q_srcList )
gdmAddSpecToSpecList( q_dest q_destList )

;; register copy monitor
if( formDataStruc->r_monitorLibCopyField->value then
g_oldCopyMonitor = ccpRegMonitor( 'XIcopyMonitor )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
else
g_oldCopyMonitor = ccpRegMonitor( nil )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
)

if( t_scrTopCellName != "" then

ccpCopyDesign(
q_src ;; 1 source gdm spec
q_dest ;; 2 destination gdm spec
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
q_copySkipLibList ;; 5 gdm spec list cont. libs to exclude
nil ;; 6 view type list
nil ;; 7 view name list
"" ;; 8 reg ex for view copying
"CDBA" ;; 9 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 10 cross reference updater
;q_destList ;; 11 destination library gdm spec
)

techBindTechFile(
ddGetObj( t_destLibName )
techGetTechLibName( ddGetObj( t_srcLibName ) )
"techfile.cds"
;t
)

else

ccpCopy(
q_srcList ;; 1 source gdm spec list
q_destList ;; 2 destination gdm spec list
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
nil ;; 5 view type list
nil ;; 6 view name list
"" ;; 7 reg ex for view copying
"CDBA" ;; 8 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 9 cross reference updater
;q_destList ;; 10 destination library gdm spec
)

) ;; close if

;; rename cell section
d_libId = ddGetObj( t_destLibName )

l_cellsWithoutLibraryPrefix =
setof(
d_cell
d_libId~>cells
!rexMatchp( strcat( "^" t_srcCellPrefix ) d_cell~>name )
)

foreach( d_cell l_cellsWithoutLibraryPrefix
XIprintToOutPort(
list( "*WARNING* Cell without a library name prefix will not be renamed
and updated: (%s %s).\n"
d_cell~>lib~>name d_cell~>name )
)
) ;; close foreach


l_cellsWithLibraryPrefix =
setof(
d_cell
d_libId~>cells
rexMatchp( strcat( "^" t_srcCellPrefix ) d_cell~>name )
)

;; soultion 2 24.05 sec
q_srcList = gdmCreateSpecList( )
q_destList = gdmCreateSpecList( )

foreach( d_cell l_cellsWithLibraryPrefix

q_src = gdmCreateSpec( t_destLibName d_cell~>name "" "" "CDBA" )
gdmAddSpecToSpecList( q_src q_srcList )

if( length( parseString( d_cell~>name ) ) == 1 &&
d_cell~>name == t_srcCellPrefix then
t_destCellName = t_destCellPrefix
else
t_destCellName = buildString(
cons(
t_destCellPrefix
cdr( parseString( d_cell~>name "_" ) )
)
"_" )
)

q_dest = gdmCreateSpec( t_destLibName t_destCellName "" "" "CDBA" )
gdmAddSpecToSpecList( q_dest q_destList )

) ;; close foreach

;; register update monitor
if( formDataStruc->r_monitorCellRenameField->value then
g_oldCopyMonitor = ccpRegMonitor( 'XIcopyMonitor )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
else
g_oldCopyMonitor = ccpRegMonitor( nil )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
)

ccpCopy(
q_srcList ;; 1 source gdm spec list
q_destList ;; 2 destination gdm spec list
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
nil ;; 5 view type list
nil ;; 6 view name list
"" ;; 7 reg ex for view copying
"CDBA" ;; 8 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 9 cross reference updater
q_destList ;; 10 destination library gdm spec
)

foreach( d_cell l_cellsWithLibraryPrefix
ddDeleteObj( ddGetObj( t_destLibName d_cell~>name ) )
) ;; clsoe foreach

when( formDataStruc->r_viewLogFileField->value
view( formDataStruc->r_logFileField->value )
) ;; close when

) ;; close let

) ;; close XIcopyAndRenameFormCB


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcreateCopyAndRenameForm
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcreateCopyAndRenameForm( )
;;
;; Description : From description.
;;
;; Arguments : -
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcreateCopyAndRenameForm( )
let( (
( x_startXpos 15 )
( x_startYpos 15 )
r_srcLibField r_destLibField r_updateInstOfLibField r_sepField
r_srcCellPrefixField r_destCellPrefixFiels r_updateInstField
)

;; creating the fields

r_choiceField =
hiCreateCyclicField(
?name 'r_choiceField
?choices '( "Whole library" "Top cell" )
?prompt "Copy"
?value "Whole library"
?callback "XIchoiceFieldCb( hiGetCurrentForm( ) )"
)

r_sep1Field =
hiCreateSeparatorField(
?name 'r_sep1Field
)

r_srcLibField =
hiCreateStringField(
?name 'r_srcLibField
?prompt "Source library"
?callback "XIscrInputCb( hiGetCurrentForm( ) )"
;?callback "XIsrcLibFieldCb( hiGetCurrentForm( ) )"
?editable t
)

r_srcTopCellField =
hiCreateStringField(
?name 'r_srcTopCellField
?prompt "Source top cell"
?callback "XIscrInputCb( hiGetCurrentForm( ) )"
;?callback "XIsrcTopCellFieldCb( hiGetCurrentForm( ) )"
?editable nil
)

r_destLibField =
hiCreateStringField(
?name 'r_destLibField
?prompt "Destination library"
?callback "XIdestLibFieldCb( hiGetCurrentForm( ) )"
?editable t
)

r_updateInstOfLibField =
hiCreateBooleanButton(
?name 'r_updateInstOfLibField
?buttonText "Update instances of entire library"
?defValue t
?enabled nil
)

r_monitorLibCopyField =
hiCreateBooleanButton(
?name 'r_monitorLibCopyField
?buttonText "Monitor library copy"
?defValue nil
)

r_sep2Field =
hiCreateSeparatorField(
?name 'r_sep2Field
)

r_srcCellPrefixField =
hiCreateStringField(
?name 'r_srcCellPrefixField
?prompt "Source cell prefix"
?callback ""
?editable t
)

r_destCellPrefixField =
hiCreateStringField(
?name 'r_destCellPrefixField
?prompt "Destination cell prefix"
?callback ""
?editable t
)

r_updateInstField =
hiCreateBooleanButton(
?name 'r_updateInstField
?buttonText "Update instances after rename"
?defValue t
?enabled nil
)

r_monitorCellRenameField =
hiCreateBooleanButton(
?name 'r_monitorCellRenameField
?buttonText "Monitor cell rename"
?defValue nil
)

r_sep3Field =
hiCreateSeparatorField(
?name 'r_sep3Field
)

r_logFileField =
hiCreateStringField(
?name 'r_logFileField
?prompt "Log file"
?defValue "./copyAndRename.log"
?editable t
)

r_viewLogFileField =
hiCreateBooleanButton(
?name 'r_viewLogFileField
?buttonText "View log file"
?defValue t
)


hiCreateAppForm(
?name 'GBcopyAndRenameForm
?formTitle "Copy library and rename cell prefix"
?callback 'XIcopyAndRenameFormCB
?initialSize list( 400 670 )
?fields list(
list(
r_choiceField
x_startXpos:x_startYpos 350:25 150
)
list(
r_sep1Field
x_startXpos:x_startYpos + 45 350:0
)
list(
r_srcLibField
x_startXpos:x_startYpos + 90 350:25 150
)
list(
r_srcTopCellField
x_startXpos:x_startYpos + 135 350:25 150
)
list(
r_destLibField
x_startXpos:x_startYpos + 180 350:25 150
)
list(
r_updateInstOfLibField
x_startXpos:x_startYpos + 225 350:25 220
)
list(
r_monitorLibCopyField
x_startXpos:x_startYpos + 270 350:25 220
)
list(
r_sep2Field
x_startXpos:x_startYpos + 315 350:0
)
list(
r_srcCellPrefixField
x_startXpos:x_startYpos + 360 350:25 150
)
list(
r_destCellPrefixField
x_startXpos:x_startYpos + 405 350:25 150
)
list(
r_updateInstField
x_startXpos:x_startYpos + 450 350:25 220
)
list(
r_monitorCellRenameField
x_startXpos:x_startYpos + 495 350:25 220
)
list(
r_sep3Field
x_startXpos:x_startYpos + 540 350:0
)
list(
r_logFileField
x_startXpos:x_startYpos + 585 350:25 150
)
list(
r_viewLogFileField
x_startXpos:x_startYpos + 630 350:25 220
)
)
?unmapAfterCB t
;; positional attachments for 2 dimensional forms
;; when the form is resized the widht of the
;; dependend fields is resised too
?attachmentList list(
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
nil
nil
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
nil
nil
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
)
)

) ;; close let

) ;; close




t-t wrote:
Hi All-
I'm looking for way to copy an entire design to a new location but I
do not want to break the reference links. For example:
Now:
LibA
schematicA with some blocks instantiated from LibB
schematicB
schematicC
LibB
contains schematics referenced by schematicA

After the copy procedure:
LibA_new
schematicA with some blocks instantiated LibB_new
LibB_new
contains schematics referenced by schematicA

I think this can done via skill program but (to be honest) I'm a
beginnner at skill. If someone has something similar what I'm looking
and willing to share or has something I can starting hacking, I will
be deeply appreciated.
 
Thanks for posting the code. It's definitely a starting point for me. Thanks again.

Bernd Fischer <""bernd.fischer\"@xignal-A%&HY%$v#&G=.de> wrote in message news:<2m9c34FkqfreU1@uni-berlin.de>...
Hi,

the code I posted here is very _ALPHA_ and not well tested,
it also does not exactly what you need and it is customized
for my companies environment, but maybe it could give you a
starting point.

Look for cdscopy in the docs.
The main functios are ccpCopy or ccpCopyDesign, to collect your design use
gdmCreateSpecList, gdmCreateSpec and gdmAddSpecToSpecList.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Disclaimer : NO WARRANTY, this SKILL function(s) is(are) released
;; without any warranty. The Author does not warrant,
;; guarantee, or make any representations regarding the
;; use, or the results of use of this SKILL function(s).
;; The entire risk of the use of this SKILL function(s)
;; is with you.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; File Name : copyAndRename.il
;;
;; Function(s) : XIcopyAndRename
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Application : Design Framework II
;;
;; SW Release : 5.0.32
;;
;; SKILL Lint : $passed$
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyAndRename( )
;;
;; Description : This is a script to copy all cells of a library
;; into a new one or copy a design hierarchical to
;; a new library. It renames the cell name prefix
;; regarding the Xignal design guidelines automatically
;; to the prefix of the new library and does an
;; automatic update of the cell references in the
;; new library.
;;
;; Arguments : -
;;
;; Return Value : -
;;
;; Example : -
;;
;; Modification : None
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyAndRename( )

unless( boundp( 'GBcopyAndRenameForm ) && hiIsFormDisplayed( GBcopyAndRenameForm )
XIcreateCopyAndRenameForm( )
)

hiDisplayForm( GBcopyAndRenameForm )

) ;; close procedure XIcopyAndRename


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIprintToOutPort
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIprintToOutPort( l_printArgument )
;;
;; Description : fprintf wrapper function.
;;
;; Arguments : l_printArgument List of print arguments
;; e.g. text string and varibables.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIprintToOutPort( printArgument )

t_logFile = hiGetCurrentForm( )->r_logFileField->value
p_outPort = outfile( t_logFile "a" )

apply( 'fprintf cons( p_outPort printArgument ) )

close( p_outPort )

) ;; close XIprintToOutPort


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrInputCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrInputCb( formDataStruc )
;;
;; Description : Source library and source top cell field callback
;; function, checks if the source library and source top
;; cell for the copy procedure exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrInputCb( formDataStruc )

unless( formDataStruc->r_srcLibField->value == ""
if( ddGetObj( formDataStruc->r_srcLibField->value ) then
hiHighlightField(
formDataStruc
'r_srcLibField
'background
)
formDataStruc->r_srcCellPrefixField->value =
formDataStruc->r_srcLibField->value

unless( formDataStruc->r_srcTopCellField->value == ""
if( ddGetObj( formDataStruc->r_srcLibField->value
formDataStruc->r_srcTopCellField->value ) then
hiHighlightField(
formDataStruc
'r_srcTopCellField
'background
)
t
else
hiHighlightField(
formDataStruc
'r_srcTopCellField
'error
)
XIsrcTopCellFieldDialog( formDataStruc )
nil
) ;; close if
) ;; close unless
t
else
hiHighlightField(
formDataStruc
'r_srcLibField
'error
)
XIsrcLibFieldDialog( formDataStruc )
nil
) ;; close if

) ;; close unless

) ;; close XIscrInputCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIsrcLibFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIsrcLibFieldDialog( formDataStruc )
;;
;; Description : Source library field dialog,
;; informs the user if the source library for the copy
;; procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIsrcLibFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_srcLibDBox )
?dboxBanner "Library Error!"
?dboxText strcat(
"Library '"
formDataStruc->r_srcLibField->value
"' does not exist.\n"
)
?buttonLayout 'UserDefined
?buttons '( "Reset" )
?callback '( "XIscrLibDBoxResetCb( hiGetCurrentForm( ) )" )
?dialogType hicErrorDialog
)

) ;; close XIsrcLibFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrLibDBoxResetCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrLibDBoxResetCb( formDataStruc )
;;
;; Description : Source library field reset callback,
;; resets the source library field if the source library
;; for the copy procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrLibDBoxResetCb( formDataStruc )
hiHighlightField(
formDataStruc
'r_srcLibField
'background
)
formDataStruc->r_srcLibField->value = ""
) ;; close XIscrLibDBoxResetCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIsrcTopCellFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIsrcTopCellFieldDialog( formDataStruc )
;;
;; Description : Source top cell field dialog,
;; informs the user if the source top cell for the copy
;; procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIsrcTopCellFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_srcTopCellDBox )
?dboxBanner "Cell Error!"
?dboxText strcat(
"Cell '"
formDataStruc->r_srcTopCellField->value
"' does not exist.\n"
)
?buttonLayout 'UserDefined
?buttons '( "Reset" )
?callback '( "XIscrTopCellDBoxResetCb( hiGetCurrentForm( ) )" )
?dialogType hicErrorDialog
)

) ;; close XIsrcTopCellFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIscrTopCellDBoxResetCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIscrTopCellDBoxResetCb( formDataStruc )
;;
;; Description : Source top cell field reset callback,
;; resets the source top cell field if the source top cell
;; for the copy procedure does not exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIscrTopCellDBoxResetCb( formDataStruc )
hiHighlightField(
formDataStruc
'r_srcTopCellField
'background
)
formDataStruc->r_srcTopCellField->value = ""
) ;; close XIscrLibDBoxResetCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibFieldCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibFieldCb( formDataStruc )
;;
;; Description : Destination library field callback function,
;; checks if the destination library for the copy procedure
;; allready exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibFieldCb( formDataStruc )

unless( formDataStruc->r_destLibField->value == ""
if( ddGetObj( formDataStruc->r_destLibField->value ) then
hiHighlightField(
formDataStruc
'r_destLibField
'error
)
XIdestLibFieldDialog( formDataStruc )
nil
else
hiHighlightField(
formDataStruc
'r_destLibField
'background
)
formDataStruc->r_destCellPrefixField->value =
formDataStruc->r_destLibField->value
t
) ;; close if

) ;; close unless

) ;; close XIdestLibFieldCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibFieldDialog
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibFieldDialog( formDataStruc )
;;
;; Description : Destination library field dialog,
;; informs the user if the destination library for the copy
;; procedure allready exist.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibFieldDialog( formDataStruc )

hiDisplayAppDBox(
?name gensym( 'r_destLibDBox )
?dboxBanner "Library Error!"
?dboxText strcat(
"Library '"
formDataStruc->r_destLibField->value
"' exist.\n"
)
?dialogType hicErrorDialog
?buttonLayout 'UserDefined
?buttons '( "Overwrite" "New" )
?callback '(
"XIdestLibDBoxOverwriteCb( hiGetCurrentForm( ) )"
"XIdestLibDBoxNewCb( hiGetCurrentForm( ) )"
)
)

) ;; close XIsrcLibFieldDialog


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibDBoxOverwriteCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibDBoxOverwriteCb( formDataStruc )
;;
;; Description : Destination library field dialog callback,
;; removes the error blinking form the field
;; and prevents the library name from being
;; reset.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibDBoxOverwriteCb( formDataStruc )

hiHighlightField(
formDataStruc
'r_destLibField
'background
)

formDataStruc->r_destCellPrefixField->value =
formDataStruc->r_destLibField->value

) ;; close XIdestLibDBoxOverwriteCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIdestLibDBoxNewCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIdestLibDBoxNewCb( formDataStruc )
;;
;; Description : Destination library field dialog callback,
;; removes the error blinking form the field
;; and reset the library field to an empty
;; field.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIdestLibDBoxNewCb( formDataStruc )

hiHighlightField(
formDataStruc
'r_destLibField
'background
)

formDataStruc->r_destLibField->value = ""
formDataStruc->r_destCellPrefixField->value = ""

) ;; close XIdestLibDBoxNewCb

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIchoiceFieldCb
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 24 Mai, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIchoiceFieldCb( formDataStruc )
;;
;; Description : Choice field callback, enables or disables
;; top cell field entry.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIchoiceFieldCb( formDataStruc )
let( ( ( t_choice formDataStruc->r_choiceField->value ) )

case( t_choice
( "Whole library"
formDataStruc->r_srcTopCellField->editable = nil
formDataStruc->r_srcTopCellField->value = ""

)
( "Top cell"
formDataStruc->r_srcTopCellField->editable = t
)
) ;; close case

) ;; close let

) ;; close XIchoiceFieldCb


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcopyMonitor
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyMonitor(
;;
;; Description :
;;
;; Arguments : copyMonitorFunctionSymbol
;; copyPhase
;; fromPath
;; toPath
;; fromSpec
;; toSpec
;; numCount
;; numTotal
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyMonitor( copyMonitorFunctionSymbol
copyPhase
fromPath
toPath
fromSpec
toSpec
numCount
numTotal
"ttttggxx"
)

if( geqp( numCount 0 ) then
if( neq( fromSpec nil ) then
XIprintToOutPort(
list(
"Copy monitor: %L to %L, %d of %d files.\n"
gdmInspectSpec( fromSpec "CDBA" )
gdmInspectSpec( toSpec "CDBA" )
numCount
numTotal
)
)
) ;; close if neq
) ;; close if geqp

) ;; close XIcopyMonitor


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcopyAndRenameFormCB
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcopyAndRenameFormCB( formDataStruc )
;;
;; Description : Form callback function starts the copy process.
;;
;; Arguments : formDataStruc Form data structure.
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcopyAndRenameFormCB( formDataStruc )
let( (
b_monitorLibraryCopy
b_monitorCellCopy
t_srcLibName
t_scrTopCellName
t_destLibName
t_srcCellPrefix
t_destCellPrefix
q_srcList
q_src
q_destList
q_dest
g_oldCopyMonitor
)

when( isFile( formDataStruc->r_logFileField->value )
deleteFile( formDataStruc->r_logFileField->value )
)

l_copySkipLibList = '( "analogLib" "basic" "sample" "xigLib" "xigPcell"
"xigStdCell" )
t_srcLibName = formDataStruc->r_srcLibField->value
t_scrTopCellName = formDataStruc->r_srcTopCellField->value
t_destLibName = formDataStruc->r_destLibField->value
t_srcCellPrefix = formDataStruc->r_srcCellPrefixField->value
t_destCellPrefix = formDataStruc->r_destCellPrefixField->value

;; copy library section
q_srcList = gdmCreateSpecList( )
q_destList = gdmCreateSpecList( )

if( t_scrTopCellName != "" then
q_src = gdmCreateSpec( t_srcLibName t_scrTopCellName "" "" "CDBA" )

q_copySkipLibList = gdmCreateSpecList( )
foreach( t_copySkipLib l_copySkipLibList
q_copySkipLib = gdmCreateSpec( t_copySkipLib "" "" "" "CDBA" )
gdmAddSpecToSpecList( q_copySkipLib q_copySkipLibList )
) ;; close foreach
else
q_src = gdmCreateSpec( t_srcLibName "" "" "" "CDBA" )
) ;; close if

q_dest = gdmCreateSpec( t_destLibName "" "" "" "CDBA" )
gdmAddSpecToSpecList( q_src q_srcList )
gdmAddSpecToSpecList( q_dest q_destList )

;; register copy monitor
if( formDataStruc->r_monitorLibCopyField->value then
g_oldCopyMonitor = ccpRegMonitor( 'XIcopyMonitor )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
else
g_oldCopyMonitor = ccpRegMonitor( nil )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
)

if( t_scrTopCellName != "" then

ccpCopyDesign(
q_src ;; 1 source gdm spec
q_dest ;; 2 destination gdm spec
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
q_copySkipLibList ;; 5 gdm spec list cont. libs to exclude
nil ;; 6 view type list
nil ;; 7 view name list
"" ;; 8 reg ex for view copying
"CDBA" ;; 9 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 10 cross reference updater
;q_destList ;; 11 destination library gdm spec
)

techBindTechFile(
ddGetObj( t_destLibName )
techGetTechLibName( ddGetObj( t_srcLibName ) )
"techfile.cds"
;t
)

else

ccpCopy(
q_srcList ;; 1 source gdm spec list
q_destList ;; 2 destination gdm spec list
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
nil ;; 5 view type list
nil ;; 6 view name list
"" ;; 7 reg ex for view copying
"CDBA" ;; 8 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 9 cross reference updater
;q_destList ;; 10 destination library gdm spec
)

) ;; close if

;; rename cell section
d_libId = ddGetObj( t_destLibName )

l_cellsWithoutLibraryPrefix =
setof(
d_cell
d_libId~>cells
!rexMatchp( strcat( "^" t_srcCellPrefix ) d_cell~>name )
)

foreach( d_cell l_cellsWithoutLibraryPrefix
XIprintToOutPort(
list( "*WARNING* Cell without a library name prefix will not be renamed
and updated: (%s %s).\n"
d_cell~>lib~>name d_cell~>name )
)
) ;; close foreach


l_cellsWithLibraryPrefix =
setof(
d_cell
d_libId~>cells
rexMatchp( strcat( "^" t_srcCellPrefix ) d_cell~>name )
)

;; soultion 2 24.05 sec
q_srcList = gdmCreateSpecList( )
q_destList = gdmCreateSpecList( )

foreach( d_cell l_cellsWithLibraryPrefix

q_src = gdmCreateSpec( t_destLibName d_cell~>name "" "" "CDBA" )
gdmAddSpecToSpecList( q_src q_srcList )

if( length( parseString( d_cell~>name ) ) == 1 &&
d_cell~>name == t_srcCellPrefix then
t_destCellName = t_destCellPrefix
else
t_destCellName = buildString(
cons(
t_destCellPrefix
cdr( parseString( d_cell~>name "_" ) )
)
"_" )
)

q_dest = gdmCreateSpec( t_destLibName t_destCellName "" "" "CDBA" )
gdmAddSpecToSpecList( q_dest q_destList )

) ;; close foreach

;; register update monitor
if( formDataStruc->r_monitorCellRenameField->value then
g_oldCopyMonitor = ccpRegMonitor( 'XIcopyMonitor )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
else
g_oldCopyMonitor = ccpRegMonitor( nil )
printf( "ccpRegMonitor( 'symbol ) returned '%L'\n" g_oldCopyMonitor )
)

ccpCopy(
q_srcList ;; 1 source gdm spec list
q_destList ;; 2 destination gdm spec list
nil ;; 3 overwrite t/nil
'CCP_EXPAND_ALL ;; 4 expand option, expands the directory
nil ;; 5 view type list
nil ;; 6 view name list
"" ;; 7 reg ex for view copying
"CDBA" ;; 8 name space
'CCP_UPDATE_DESTLIB_ONLY ;; 9 cross reference updater
q_destList ;; 10 destination library gdm spec
)

foreach( d_cell l_cellsWithLibraryPrefix
ddDeleteObj( ddGetObj( t_destLibName d_cell~>name ) )
) ;; clsoe foreach

when( formDataStruc->r_viewLogFileField->value
view( formDataStruc->r_logFileField->value )
) ;; close when

) ;; close let

) ;; close XIcopyAndRenameFormCB


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Function : XIcreateCopyAndRenameForm
;;
;; Author : Bernd Fischer <bernd.fischer@xignal.com
;;
;; Date : Tuesday, 27 April, 2004
;;
;; Version : 1.0
;;
;; Global Variable(s) : $globals$
;;
;; Synopsis : XIcreateCopyAndRenameForm( )
;;
;; Description : From description.
;;
;; Arguments : -
;;
;; Return Value : -
;;
;; Modification : -
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

procedure( XIcreateCopyAndRenameForm( )
let( (
( x_startXpos 15 )
( x_startYpos 15 )
r_srcLibField r_destLibField r_updateInstOfLibField r_sepField
r_srcCellPrefixField r_destCellPrefixFiels r_updateInstField
)

;; creating the fields

r_choiceField =
hiCreateCyclicField(
?name 'r_choiceField
?choices '( "Whole library" "Top cell" )
?prompt "Copy"
?value "Whole library"
?callback "XIchoiceFieldCb( hiGetCurrentForm( ) )"
)

r_sep1Field =
hiCreateSeparatorField(
?name 'r_sep1Field
)

r_srcLibField =
hiCreateStringField(
?name 'r_srcLibField
?prompt "Source library"
?callback "XIscrInputCb( hiGetCurrentForm( ) )"
;?callback "XIsrcLibFieldCb( hiGetCurrentForm( ) )"
?editable t
)

r_srcTopCellField =
hiCreateStringField(
?name 'r_srcTopCellField
?prompt "Source top cell"
?callback "XIscrInputCb( hiGetCurrentForm( ) )"
;?callback "XIsrcTopCellFieldCb( hiGetCurrentForm( ) )"
?editable nil
)

r_destLibField =
hiCreateStringField(
?name 'r_destLibField
?prompt "Destination library"
?callback "XIdestLibFieldCb( hiGetCurrentForm( ) )"
?editable t
)

r_updateInstOfLibField =
hiCreateBooleanButton(
?name 'r_updateInstOfLibField
?buttonText "Update instances of entire library"
?defValue t
?enabled nil
)

r_monitorLibCopyField =
hiCreateBooleanButton(
?name 'r_monitorLibCopyField
?buttonText "Monitor library copy"
?defValue nil
)

r_sep2Field =
hiCreateSeparatorField(
?name 'r_sep2Field
)

r_srcCellPrefixField =
hiCreateStringField(
?name 'r_srcCellPrefixField
?prompt "Source cell prefix"
?callback ""
?editable t
)

r_destCellPrefixField =
hiCreateStringField(
?name 'r_destCellPrefixField
?prompt "Destination cell prefix"
?callback ""
?editable t
)

r_updateInstField =
hiCreateBooleanButton(
?name 'r_updateInstField
?buttonText "Update instances after rename"
?defValue t
?enabled nil
)

r_monitorCellRenameField =
hiCreateBooleanButton(
?name 'r_monitorCellRenameField
?buttonText "Monitor cell rename"
?defValue nil
)

r_sep3Field =
hiCreateSeparatorField(
?name 'r_sep3Field
)

r_logFileField =
hiCreateStringField(
?name 'r_logFileField
?prompt "Log file"
?defValue "./copyAndRename.log"
?editable t
)

r_viewLogFileField =
hiCreateBooleanButton(
?name 'r_viewLogFileField
?buttonText "View log file"
?defValue t
)


hiCreateAppForm(
?name 'GBcopyAndRenameForm
?formTitle "Copy library and rename cell prefix"
?callback 'XIcopyAndRenameFormCB
?initialSize list( 400 670 )
?fields list(
list(
r_choiceField
x_startXpos:x_startYpos 350:25 150
)
list(
r_sep1Field
x_startXpos:x_startYpos + 45 350:0
)
list(
r_srcLibField
x_startXpos:x_startYpos + 90 350:25 150
)
list(
r_srcTopCellField
x_startXpos:x_startYpos + 135 350:25 150
)
list(
r_destLibField
x_startXpos:x_startYpos + 180 350:25 150
)
list(
r_updateInstOfLibField
x_startXpos:x_startYpos + 225 350:25 220
)
list(
r_monitorLibCopyField
x_startXpos:x_startYpos + 270 350:25 220
)
list(
r_sep2Field
x_startXpos:x_startYpos + 315 350:0
)
list(
r_srcCellPrefixField
x_startXpos:x_startYpos + 360 350:25 150
)
list(
r_destCellPrefixField
x_startXpos:x_startYpos + 405 350:25 150
)
list(
r_updateInstField
x_startXpos:x_startYpos + 450 350:25 220
)
list(
r_monitorCellRenameField
x_startXpos:x_startYpos + 495 350:25 220
)
list(
r_sep3Field
x_startXpos:x_startYpos + 540 350:0
)
list(
r_logFileField
x_startXpos:x_startYpos + 585 350:25 150
)
list(
r_viewLogFileField
x_startXpos:x_startYpos + 630 350:25 220
)
)
?unmapAfterCB t
;; positional attachments for 2 dimensional forms
;; when the form is resized the widht of the
;; dependend fields is resised too
?attachmentList list(
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
nil
nil
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
nil
nil
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
( hicLeftPositionSet|
hicRightPositionSet
)
)
)

) ;; close let

) ;; close




t-t wrote:
Hi All-
I'm looking for way to copy an entire design to a new location but I
do not want to break the reference links. For example:
Now:
LibA
schematicA with some blocks instantiated from LibB
schematicB
schematicC
LibB
contains schematics referenced by schematicA

After the copy procedure:
LibA_new
schematicA with some blocks instantiated LibB_new
LibB_new
contains schematics referenced by schematicA

I think this can done via skill program but (to be honest) I'm a
beginnner at skill. If someone has something similar what I'm looking
and willing to share or has something I can starting hacking, I will
be deeply appreciated.
 

Welcome to EDABoard.com

Sponsor

Back
Top