I am looking for a way to move some components through hiearchy in layout. For example, i have drawn some metal 1 path in the first level of hiearchy, and would like to 'pop' it out to the second level of hiearchy. Is there any default feature in Cadence that does this? If someone could kindly guide me to setting this up i would appreciate it. Basically i want something close to the YANK command, but CUT instead of copy.
I am using Cadence: Virtuoso: 6.1.4
There are many factors that come into play when you want to do this type of operation.
Here is some basic code to allow you to move a shape up the hierarchy. It doesn't handle mosaics and only moves the objects for one placement of an instance. In the code below, I used dbCopyFig to copy the data instead of dbMoveFig. This will let you see what is going on without being destructive to the source cellview. If you change it to do a move, you'll need to save the source cellview. I already have the code making the source cellview editable.
To use this, load the code in your CIW. Edit in place down the hierarchy to your lower level cell. Select the shapes you want to move. Press the ctrl-b bindkey. Choose the level you want to return to. You should have a copy of those shapes at the new level.
procedure(myGetItemsToMove(@optional (win hiGetCurrentWindow())) let((transList items sourceCv) transList = reverse(mapcar('lambda((x) car(x)~>transform) geGetHierMemInst(win))) items = geGetSelSet() sourceCv = geGetEditCellView() list(nil 'transList transList 'items items 'sourceCv sourceCv 'win win) ) ;let) ;proc
procedure(myMoveItemsHierarchically(data) let((newLevel destCv transList transform) newLevel = deGetEditLevel(data->win) destCv = geGetEditCellView() if(newLevel==0 transList=data->transList transList=reverse(nthcdr(newLevel reverse(data->transList))) ) transform = myConcatTransforms(transList) dbReopen(data->sourceCv "a") dbReopen(destCv "a") foreach(item data->items ;use dbMoveFig to move the items dbCopyFig(item destCv transform) ) ;dbSave(data->sourceCv) ) ;let) ;proc
procedure(myConcatTransforms(transList) let((newTrans trans) newTrans=list('(0.0 0.0) "R0" 1.0) ;transList is in order from bottom of hierarchy to top foreach(trans transList newTrans=dbConcatTransform(newTrans trans) ) newTrans ))
hiSetBindKey("Layout" "Ctrl<Key>b" "let((data) data=myGetItemsToMove() geReturnToLevel() myMoveItemsHierarchically(data))")