;;; This procedure is used to trigger custom code whenever something is selected in a layout editor window. ;;; Currently only one custom procedure is executed, but more may be added in the future. procedure( SCLLeMouseSingleSelectPt() let( ( ( selection nil ) ) ;;; Use the original selection function mouseSingleSelectPt() selection = geGetSelectedSet() ;;; Put any custom code that should be triggered by selecting anything in a lay-out editor window below... when( isCallable( 'SCLLeSetLSWEntryLayerByShape ) SCLLeSetLSWEntryLayerByShape( selection ) ) when( isCallable( 'SCLLeHighLightSchNetOnSel ) SCLLeHighLightSchNetOnSel( hiGetCurrentWindow() selection ) ) ) ;;; end of let ) ;;; end of procedure SCLLeMouseSingleSelectPt ;;; Re-define the bindkey. I suggest to check the bindkey override ;;; from CIW -> Options -> Bindkeys; or with SKILL using: ;;; hiGetBindKey("Layout" "None") hiSetBindKey("Layout" "None" "SCLLeMouseSingleSelectPt()") ;;; This procedure is called from SCLLeMouseSingleSelectPt() ;;; This procedure sets the entry layer depending on lpp of the shape selected. ;;; This functionality is standard in Mentor Pyxis, and ported to Virtuoso using this procedure and bind-key re-mapping. procedure( SCLLeSetLSWEntryLayerByShape( selection ) let( ( ( cvId nil ) ( tfId nil ) ( objId nil ) ( lpp nil ) ( proceed t ) ) ;;; If the selection has multiple items, then all object types have to be the same. ;;; This is to get this script to work with wires. A wire is a special type of path. ;;; A wire may consist of multiple segments, which will result in "selection" being ;;; a list of more then 1 item. With the 'setof' part all items NOT equal to the first ;;; item will be listed, thus signaling that not all items are from the same object type. ;;; This works when only one object has been selected too. when( selection if( setof( item selection nequal( item~>objType car( selection )~>objType ) ) then ;;; Different object types have been selected (like rectangles/paths/instances) proceed = nil else foreach( item selection when( proceed cond( ;;; The item must be a shape AND it must have an lpp. ;;; If it doesn't comply to this, no use to proceed... ;;; For instance: an instance does not have an lpp... ( not( and( item~>isShape item~>lpp ) ) proceed = nil ) ;;; It is a valid item (it did not past the first conditional test), ;;; now see if the lpp has already been set: if not, this is the first item, thus set lpp. ( not( lpp ) lpp = item~>lpp ) ;;; It is a valid item, and the lpp has already been set, thus it is not the first item. ;;; Chech whether or not the LPP different, if it is, no need to proceed: which lpp ;;; should be used? ( nequal( lpp item~>lpp ) proceed = nil ) ) ;;; end of cond ) ;;; end of when ) ;;; end of foreach item ) ;;; end of if when( proceed objId = car( selection ) cvId = objId~>cellView tfId = techGetTechFile( cvId ) when( leIsLayerValid( lpp tfId ) unless( leIsLayerVisible( lpp tfId ) leSetLayerVisible( lpp t tfId ) ) ;;; end of unless leSetEntryLayer( lpp tfId ) ) ;;; end of when ) ;;; end of when ) ;;; end of when ) ;;; end of let ) ;;; end of procedure SCLLeSetLSWEntryLayerByShape /* This procedure is called from SCLLeMouseSingleSelectPt() This procedure highlights the net which is selected in a layout window in the schematic window. If multiple nets are selected, all will be highlighted in the schematic window. This functionality is standard in Mentor Pyxis, and ported to Virtuoso using this procedure and bind-key re-mapping. Flow of actions (some actions might be combined into one action/check): 1. Check whether or not the schematic is opened in a window. Yes: proceed to 2 No: stop Hint: use the procedure geGetCellViewWindow(cvId) 2. Is anything selected? Yes: proceed to 3 No: De-highlight any highlighted net in the schematic window and stop Hint: use the procedure geDeleteAllProbe(windowId t) 3. What type(s) of object(s) is (are) selected? Shape/via: filter the list of selected object to only contain shapes (path/wire/polygon) or vias and proceed to 4. Anything else (like instance/ruler/etc.): De-highlight any highlighted net in the schematic window and stop 4. A valid object has been selected, now check whether or not it has connectivity information (i.e. a net) Yes: proceed to 5 No: De-highlight any highlighted net in the schematic window and stop 5. Is the selected net available in the schematic? Yes: proceed to 6 No: De-highlight any highlighted net in the schematic window and stop 6. All should be checked (have I missed anything?), now highlight the net(s) in the schematic window First de-highlight all existing high-lights. Hint: use procedure geAddNetProbe() geAddNetProbe() needs as input the windowId, a layer-purpose-pair and a set of coordinates (x and y) of the net to highlight. To find the coordinates: if the net is named using a label (in schematic) , get the coordinates of that label and use it for geAddNetProbe(). If no label is used, use the first coordinate of the the first section of the wire. If the same net is selected more than once in the layout, obviously highlight it only once in schematic. */ procedure( SCLLeHighLightSchNetOnSel( wIdLe selection ) let( ( ( cvIdLe nil ) ( cvIdSch nil ) ( wIdSch nil ) ( lib nil ) ( cell nil ) ( view nil ) ( validObjects nil ) ( validObjectIds nil ) ( highLight t ) ( deHighLight nil ) ( hlLPPs nil ) ( hlLayNum 1 ) ( hlLPP nil ) ( hlNetName nil ) ( hlNetNames nil ) ( hlNetId nil ) ( hlNetFigs nil ) ( hlNetXY nil ) ) ;;; First some house keeping... validObjects = list( "path" "pathSeg" "polygon" "stdVia" "customVia" ) hlLPPs = list( list( "hilite" "drawing1" ) list( "hilite" "drawing2" ) list( "hilite" "drawing3" ) list( "hilite" "drawing4" ) list( "hilite" "drawing5" ) list( "hilite" "drawing6" ) list( "hilite" "drawing7" ) list( "hilite" "drawing8" ) list( "hilite" "drawing9" ) ) ;;; Derive information from the supplied arguments... cvIdLe = wIdLe->cellView lib = cvIdLe->libName cell = cvIdLe->cellName view = cvIdLe->viewName cvIdSch = dbOpenCellViewByType( lib cell "schematic" ) wIdSch = geGetCellViewWindow( cvIdSch ) ;;; Now filter the list of selected objects: ;;; - Is it a valid object? ;;; - Does it have connectivity information? ;;; - If it has connectivity, does the net exist in the schematic? validObjectIds = setof( objId selection member( objId->objType validObjects ) ) validObjectIds = setof( objId validObjectIds objId~>net~>name ) validObjectIds = setof( objId validObjectIds member( objId~>net~>name cvIdSch~>nets~>name ) ) cond( ( !wIdSch deHighLight = nil highLight = nil ) ( !selection deHighLight = t highLight = nil ) ( !validObjectIds deHighLight = t highLight = nil ) ( t deHighLight = t highLight = t ) ) ;;; end of cond when( deHighLight geDeleteAllProbe( wIdSch t ) ) ;;; end of when when( highLight foreach( obj validObjectIds when( hlLayNum > length( hlLPPs ) hlLayNum = 1 ) ;;; end of when hlNetName = obj~>net~>name hlNetId = car( setof( net cvIdSch~>nets equal( hlNetName net~>name ) ) ) hlNetFigs = hlNetId~>figs unless( hlNetXY = car( setof( fig hlNetFigs equal( fig~>objType "label" ) ) )~>xy hlNetXY = caar( hlNetFigs~>points ) ) ;;; end of unless unless( member( hlNetName hlNetNames ) hlLPP = nthelem( hlLayNum hlLPPs ) geAddNetProbe( wIdSch hlLPP hlNetXY ) hlNetNames = append1( hlNetNames hlNetName ) hlLayNum++ ) ;;; end of unless ) ;;; end of foreach obj ) ;;; end of when ) ;;; end of let ) ;;; end of procedure SCLLeHighLightSchNetOnSel