I've written a skill code that is supposed to change one of the pin names of a given cell from an old value to a new one in the schematic and symbol views. It works well on the surface but gives a warning that I have to fix: the pin name gets changed as wanted in both views but there's a warning that the pin list of the symbol does not match the pins on the symbol. In other words, although the pin on the symbol is changed, the pin name in the pin list is unchanged and I'm stumped as to how to reconcile the two.
Here's the code and if anyone has any insights on this issue, please let me know:
/* To be run on a single cell; the cell will have to be checked out first; lib and cell will be provided as argument*/
procedure(cellChangePinName(myLib myCell oldName newName)
let( ( myInstList myInstances myInst mycv myListOfNets myNet)
;cv=geGetEditCellView()
if(!dbOpenCellViewByType(myLib myCell "schematic" "schematic" "a" )==t then
printf("\nCell is unwritable, make sure it's checked out and try again\n")
else
mycv = dbOpenCellViewByType(myLib myCell "schematic" "schematic" "a" )
;mycv = dbOpenCellViewByType("temp_brou" mycv~>cellName "schematic" "schematic" "a" )
myInstList=nil
myInstList = setof( myInstances mycv~>instances myInstances~>pin~>term~>name == oldName )
;myInstList = setof( myInstances mycv~>instances myInstances~>pin~>term~>name == "VDD" )
if(length(myInstList)==0 then
printf("\nThere are no pin names of that name in the schematic of this cell:\n%s......%s/%s\n" oldName myLib myCell)
else
foreach(myInst myInstList
myInst~>pin~>term~>name = newName
;myInst~>pin~>term~>name = "VDD_brou"
myListOfNets=setof(myNets mycv~>nets myNets~>name==oldName)
foreach(myNet myListOfNets
dbMergeNet(dbMakeNet(myNet~>cellView newName) myNet~>term~>net)
myNet~>name=newName
);foreach
);foreach
schVIC(mycv)
;dbSave(mycv)
dbClose(mycv)
);if
);if
if(!dbOpenCellViewByType(myLib myCell "symbol" nil "a" )==t then
printf("\nCell is unwritable, make sure it's checked out and try again\n")
else
mycvS = dbOpenCellViewByType(myLib myCell "symbol" nil "a" )
myInstList=nil
myInstList = setof( myInstances mycvS~>shapes myInstances~>pin~>term~>name == oldName )
if(length(myInstList)==0 then
printf("\nThere are no pin names of that name in the symbol of this cell:\n%s......%s/%s\n" oldName myLib myCell)
else
foreach(myInst myInstList
myInst~>pin~>term~>name = newName
;myInst~>pin~>term~>name = "VDD_brou"
myListOfNets=setof(myNets mycv~>nets myNets~>name==oldName)
foreach(myNet myListOfNets
dbMergeNet(dbMakeNet(myNet~>cellView newName) myNet~>term~>net)
myNet~>name=newName
);foreach
);foreach
schVIC(mycvS)
;dbSave(mycvS)
dbClose(mycvS)
);if
);if
);let
) ;proc