Library copy also adding global cellname prefix?

Guest
I'm using 5.1.4.1 and want to copy all cells and views from one
library, to another library.
Whilst doing this, I'd like every cellname to have a prefix added to
it.

Can anyone suggest how to do this in a quick and easy manner because I
can't see anything in the copy wizard that will do this for me.

thanks in advance.
 
You may use the following code as a staring point
Bernd

procedure( DBcopyCellToPrefix( t_libName t_prefix "tt" )
let( ( d_libId g_srcList g_destList G_src G_dest )

d_libId = ddGetObj( t_libName )

g_srcList = gdmCreateSpecList( )
g_destList = gdmCreateSpecList( )

foreach( d_cell d_libId~>cells


printf(
"-- DBcopyCellToPrefix -- Copying cell %s to %s\n"
d_cell~>name strcat( t_prefix d_cell~>name )
)
G_src = gdmCreateSpec( t_libName d_cell~>name "functional" ""
"Verilog" )
gdmAddSpecToSpecList( G_src g_srcList )
G_dest = gdmCreateSpec( t_libName strcat( t_prefix d_cell~>name )
"functional" "" "Verilog" )
gdmAddSpecToSpecList( G_dest g_destList )


) ;; close foreach

ccpCopy(
g_srcList
g_destList
nil
'CCP_EXPAND_ALL
)

) ;; close let

) ;; close procedure
 
Hi !

This is a quick attempt, you might need to test it and also tailor it
for your needs.
Please bear in mind that the code as below does not rename any lib/
cell references. I can make this bit if needed although I'm pretty
much sure there is already something available in this forum.
Anyway, just try the following code with something like:
RKcopyLibWithPrefix("rkWorkLib" "rkTestLib" "myPrefix_")

; Skill Starts here
procedure( RKcopyLibWithPrefix(srcLib destLib prefix @optional
(overWrite t))
let((libId)
libId=ddGetObj(srcLib)
foreach(cell libId~>cells~>name
RKcopyCellWithPrefix(srcLib cell destLib prefix overWrite)
) ;foreach
ddReleaseObj(libId)
t
) ;let
)
procedure( RKcopyCellWithPrefix(srcLib srcCell destLib prefix
@optional (overWrite t))
let((destCell srcSpecList srcSpec
dstSpecList dstSpec)
destCell=strcat(prefix srcCell)
srcSpecList = gdmCreateSpecList()
srcSpec = gdmCreateSpec(srcLib srcCell nil nil "CDBA")
gdmAddSpecToSpecList( srcSpec srcSpecList)
dstSpecList = gdmCreateSpecList()
dstSpec = gdmCreateSpec(destLib destCell nil nil "CDBA")
gdmAddSpecToSpecList( dstSpec dstSpecList)
ccpCopy(srcSpecList dstSpecList overWrite 'CCP_EXPAND_ALL )
gdmResetSpecList(srcSpecList)
gdmResetSpecList(dstSpecList)
if(ddGetObj(destLib destCell)
printf("Cell %s:%s has been succesfully copied to %s:%s\n"
srcLib srcCell destLib destCell)
error("CellView %s:%s failed to be copied to %s:%s\n" srcLib
srcCell destLib destCell )
)
t
) ;let
)
; Skill Ends here

Cheers,
Riad.
 

Welcome to EDABoard.com

Sponsor

Back
Top