⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tap_mpp.il

📁 用于画IC版图的skill程序
💻 IL
字号:
/*The procedure is used to create NPap/PTap with Mutipath path, open the layout first,  then load the file, press "Ctrl+t" to run the procedure. */procedure(DefineTapMPPTemplate() let((EncSubPathL SubRectList EncSubPath_M1 EncSubPath_Imp EncSubPath_NW CT_N SubRectListN) ;define encSubPath list  EncSubPath_M1 = list(		?layer	 	 M1LPP		?enclosure	 AAEncCT-M1EncCT		?choppable	 ChoppableM1		?beginOffset	 M1BeginOffset		?endOffset	 M1EndOffset		)  EncSubPath_Imp = list(		?layer	 	 ImpLPP		?enclosure	 -1*ImpEncAA		?choppable	 ChoppableImp		?beginOffset	 ImpBeginOffset		?endOffset	 ImpEndOffset		)			  EncSubPathL = cons( EncSubPath_M1 EncSubPathL )  EncSubPathL = cons( EncSubPath_Imp EncSubPathL )  when(TapType == "NTap"    EncSubPath_NW = list(		?layer	 	 NWLPP		?enclosure	 -1*NWEncAA		?choppable	 ChoppableNW		?beginOffset	 NWBeginOffset		?endOffset	 NWEndOffset		)			    EncSubPathL = cons( EncSubPath_NW  EncSubPathL )   );when   ;define subRect listCT_N = CT_Numwhile(CT_N > 0  SubRectListN = list(		?layer	 	CTLPP		?width	 	CTWidth		?length	 	CTWidth		?choppable	ChoppableCT		?sep	 	-1*(AAEncCT+CT_N*CTWidth+(CT_N-1)*CTSpace)		?justification	"left"		?space	 	CTSpace		?beginOffset	CTBeginOffset		?endOffset	CTEndOffset		?beginSegOffset	0.000		?endSegOffset	0.000		?gap	 	CTGapType		)  SubRectList = cons( SubRectListN SubRectList )  CT_N--);end while	;The template name is : NTap/PTapleDefineMPPTemplate(	?techId	 	Tech	?name	 	TapName	?layer	 	AALPP	?width	 	CT_Num*CTWidth+(CT_Num-1)*CTSpace+2*AAEncCT	?choppable	ChoppableAA	?endType	"flush"	?beginExt	0.000	?endExt	 	0.000	?justification	"center"	?offset	 	0.000	?encSubPath	EncSubPathL	?subRect	SubRectList   ) ; end leDefineMPPTemplate     );end let 	);end procedure;;;form & field callback procedureprocedure( CreateTapFormCB()let((TapName CTLPP AALPP M1LPP ImpLPP NWLPP CTWidth CTSpace AAEncCT ImpEncAA NWEncAA CTGapType     Choppable ChoppableAA ChoppableImp ChoppableNW ChoppableM1 ChoppableCT M1BeginOffset     M1EndOffset ImpBeginOffset ImpEndOffset NWBeginOffset NWEndOffset CTBeginOffset CTEndOffset          )  TapName = CreateTapForm->TapNameField->value  CTLPP  = parseString( car(last(CreateTapForm->CTLPPField->value)) " ()" )  AALPP  = parseString( car(last(CreateTapForm->AALPPField->value)) " ()" )  M1LPP  = parseString( car(last(CreateTapForm->M1LPPField->value)) " ()" )   ImpLPP = parseString( car(last(CreateTapForm->ImpLPPField->value)) " ()" )  ;NWLPP = parseString( car(last(CreateTapForm->NWLPPField->value)) " ()" )  CT_Num = CreateTapForm->CT_NumField->value  CTWidth = CreateTapForm->CTWidthField->value  CTSpace = CreateTapForm->CTSpaceField->value  AAEncCT = CreateTapForm->AAEncCTField->value  M1EncCT = CreateTapForm->M1EncCTField->value  ImpEncAA = CreateTapForm->ImpEncAAField->value  ;NWEncAA  = CreateTapForm->NWEncAAField->value  CTGapType = CreateTapForm->CTGapTypeField->value    case( CreateTapForm->ChoppableField->value    ("M1&CT choppable"       ChoppableAA=ChoppableImp=ChoppableNW=nil      ChoppableM1=ChoppableCT=t )    ("All choppable"       ChoppableAA=ChoppableImp=ChoppableNW=ChoppableM1=ChoppableCT=t )    ("None choppable"      ChoppableAA=ChoppableImp=ChoppableNW=ChoppableM1=ChoppableCT=nil )   );case    ;;;a>=b ? a : b, used for chop Tap DRC check when M1EncCT > AAEncCT  CTBeginOffset  = CTEndOffset  = -1*((M1EncCT>=AAEncCT&&M1EncCT)||(M1EncCT<AAEncCT&&AAEncCT))  if( CreateTapForm->RingPField->value == nil then    M1BeginOffset  = M1EndOffset  = M1EncCT-AAEncCT    ImpBeginOffset = ImpEndOffset = ImpEncAA    when(TapType=="NTap"          NWLPP  = parseString( car(last(CreateTapForm->NWLPPField->value)) " ()" )      NWEncAA  = CreateTapForm->NWEncAAField->value      NWBeginOffset = NWEndOffset = NWEncAA     );when  else    M1BeginOffset  = M1EncCT-AAEncCT    M1EndOffset  = -1*(M1EncCT-AAEncCT)    ImpBeginOffset = ImpEncAA		ImpEndOffset = -1*ImpEncAA    ;when(-CTBeginOffset<CTSpace/2  	CTBeginOffset  = CTEndOffset = -CTSpace/2 )    ;used for CT space DRC check when AAEncCT + (-CTEndOffset) < CTSpace    when(-CTEndOffset<CTSpace-AAEncCT   CTEndOffset = AAEncCT-CTSpace )    when(TapType=="NTap"            NWLPP  = parseString( car(last(CreateTapForm->NWLPPField->value)) " ()" )      NWEncAA  = CreateTapForm->NWEncAAField->value      NWBeginOffset  = NWEncAA  NWEndOffset  = -1*NWEncAA     );when  );if   DefineTapMPPTemplate() );let);procedureprocedure(TapTypeFieldCB()  TapType = CreateTapForm->TapTypeField->value   CT_Num = CreateTapForm->CT_NumField->value   if(CreateTapForm->RingPField->value == t then       CreateTapForm->TapNameField->value = get_pname( concat(TapType "_" CT_Num "CT" "_Ring") )    else      CreateTapForm->TapNameField->value = get_pname( concat(TapType "_" CT_Num "CT") )   );if    if(TapType == "PTap" then      hiDeleteFields(CreateTapForm list('NWLPPField 'NWEncAAField) )    else      hiAddFields(CreateTapForm            list(list( NWLPPField	460:85	160:30	75 )             list( NWEncAAField	460:180	210:25	150 )            )       )    );if);end procedure --- TapTypeFieldCBprocedure(RingPFieldCB()  TapType = CreateTapForm->TapTypeField->value   CT_Num = CreateTapForm->CT_NumField->value   if( CreateTapForm->RingPField->value == nil then    CreateTapForm->TapNameField->value = get_pname( concat(TapType "_" CT_Num "CT" ) )  else     CreateTapForm->TapNameField->value = get_pname( concat(TapType "_" CT_Num "CT" "_Ring") )  );if );end RingPFieldCB/********** procedure to create Guard ring form*******************************/procedure( CreateTap()let((CT_Num InitLayerList AllLayerList SelectLayerList   TapTypeField TapNameField CTLPPField AALPPField M1LPPField ImpLPPField      CT_NumField CTWidthField CTSpaceField AAEncCTField M1EncCTField ImpEncAAField                 ChoppableField CTGapTypeField RingPField MyLabelField ;NWEncAAField NWLPPField   );init the SelectLayerList list or all layer in the tech file will be displayed.InitLayerList = list(	list("M1" "drawing")		list("ACT" "drawing")	list("AA" "drawing")		list("CT" "drawing")	list("CON" "drawing")	list("PP" "drawing")	list("SP" "drawing") 		list("NP" "drawing")	list("SN" "drawing") 	list("NW" "drawing")	)AllLayerList = 	leGetValidLayerList(Tech)SelectLayerList = setof(ALayer InitLayerList 		    member(ALayer AllLayerList) 		  )when( length(SelectLayerList) != 6  SelectLayerList = AllLayerList );;; create Radio field for TapType value.TapTypeField = hiCreateRadioField(	?name 		'TapTypeField	?prompt		"Select the Tap Type:"	?choices	list( "NTap" "PTap" )	?value 		"NTap"	?defValue 	"NTap"	?callback 	'( "TapTypeFieldCB()" ));;; create String field for TapName value.TapNameField = hiCreateStringField(	?name 		'TapNameField	?prompt 	"Tap template name:"	?value     	"NTap"	?defValue 	"PTap"	;?callback 	"TapName = CreateTapForm->TapNameField->value "	?editable 	t);;; create Layer cyclic field for CTLPP, AALPP, M1LPP, ImpLPP, NWLPP value.CTLPPField = hiCreateLayerCyclicField(	Tech 	"CT layer:" 	;t_callback	"CTLPP=parseString( car(last(CreateTapForm->CTLPPField->value)) \" ()\" ) " 	SelectLayerList 	nil	'CTLPPField) AALPPField = hiCreateLayerCyclicField(	Tech 	"AA layer:" 	"AALPP=parseString( car(last(CreateTapForm->AALPPField->value)) \" ()\" ) "      	SelectLayerList 	nil	'AALPPField)M1LPPField = hiCreateLayerCyclicField(	Tech 	"M1 layer:" 	"M1LPP=parseString( car(last(CreateTapForm->M1LPPField->value)) \" ()\" ) "      	SelectLayerList 	nil	'M1LPPField)ImpLPPField = hiCreateLayerCyclicField(	Tech 	"Imp layer:" 	"ImpLPP=parseString( car(last(CreateTapForm->ImpLPPField->value)) \" ()\" ) "      	SelectLayerList 	nil	'ImpLPPField)NWLPPField = hiCreateLayerCyclicField(	Tech 	"NW layer:" 	"NWLPP=parseString( car(last(CreateTapForm->NWLPPField->value)) \" ()\" ) "    	SelectLayerList 	nil	'NWLPPField);;; create int field for tap width--CT_Num value.CT_NumField = hiCreateIntField(        ?name 		'CT_NumField        ?prompt 	"CT Number for Tap Width:"        ?range 		'(1 1000)          ?value 		1        ?defValue	2        ?callback 	"CT_Num = CreateTapForm->CT_NumField->value ");;; create float field for CTWidth, CTSpace, AAEncCT, M1EncCT, ImpEncAA, NWEncAA value.CTWidthField = hiCreateFloatField(        ?name 		'CTWidthField        ?prompt 	"CT Width(um):"        ?range 		'(0.001 1000.0)        ?value 		0.4        ?defValue 	0.3        ;?callback 	"CTWidth = CreateTapForm->CTWidthField->value ")CTSpaceField = hiCreateFloatField(        ?name 		'CTSpaceField        ?prompt 	"CT Space(um):"        ?range 		'(0.001 1000.0)        ?value 		0.4        ?defValue 	0.3        ;?callback 	"CTSpace = CreateTapForm->CTSpaceField->value ")AAEncCTField = hiCreateFloatField(        ?name 		'AAEncCTField        ?prompt 	"AA Enclosure CT (um):"        ?range 		'(0.001 1000.0)        ?value 		0.15        ?defValue 	0.15        ;?callback 	"AAEncCT = CreateTapForm->AAEncCTField->value ")M1EncCTField = hiCreateFloatField(        ?name 		'M1EncCTField        ?prompt 	"M1 Enclosure CT (um):"        ?range 		'(0.001 1000.0)        ?value 		0.2        ?defValue 	0.15        ;?callback 	"M1EncCT = CreateTapForm->M1EncCTField->value ")ImpEncAAField = hiCreateFloatField(        ?name 		'ImpEncAAField        ?prompt 	"Imp Enclosure AA (um):"        ?range 		'(0.001 1000.0)        ?value 		0.25        ?defValue 	0.04        ;?callback 	"ImpEncAA = CreateTapForm->ImpEncAAField->value ")NWEncAAField = hiCreateFloatField(	?name 		'NWEncAAField	?prompt 	"NW Enclosure AA (um):"	?range 		'(0.001 1000.0)	?value 		0.2	?defValue 	0.15	;?callback 	"NWEncAA = CreateTapForm->NWEncAAField->value ");;; create Cyclic field for Choppable, CTGapType value.ChoppableField = hiCreateCyclicField(	?name     	'ChoppableField	?prompt  	"Choppable: "	?choices  	list("M1&CT choppable" "All choppable" "None choppable")	?value   	"M1&CT choppable"	?defValue 	"All choppable"	;?callback 	"ChoppableFieldCB() ")CTGapTypeField = hiCreateCyclicField(	?name     	'CTGapTypeField	?prompt  	"CT rect GapType: "	?choices  	list("distribute" "minimum" )	?value   	"distribute"	?defValue 	"minimum"	;?callback 	"CTGapType = CreateTapForm->CTGapTypeField->value ");;; create Boolean field for Ring Tap subpath offset .RingPField = hiCreateBooleanButton(	?name 'RingPField	?buttonText "Tap is a Ring? "	?value nil	?defValue t	?buttonLocation 'right	?callback "RingPFieldCB()");;; create the label fieldMyLabelField = hiCreateLabel(	?name 		'MyLabelField	?labelText 	"Create by wanyb"	?justification 	'right	?enabled 	nil	;?font		"roman"		;?invisible	 t)LayerSelectLabelField = hiCreateLabel(	?name 		'LayerSelectLabelField	?labelText 	"Select the proper layer: "	?justification 	'left	?enabled 	 nil	;?invisible	 t)DesingRuleLabelField = hiCreateLabel(	?name 		'DesingRuleLabelField	?labelText 	"Define following rules: "	?justification 	'left	?enabled 	nil	;?invisible	t);;; create the formCreateTapForm = hiCreateAppForm(      ?name 		'CreateTapForm      ?formTitle 	"Create Tap with Multipart Path"      ?callback 	"CreateTapFormCB()"      ?fields		list(         list( TapTypeField	20:5	360:25	160 )         list( TapNameField	20:30	300:25	140 )                  list( LayerSelectLabelField	20:65	360:20 )         list( M1LPPField	20:85	160:30	75 )	         list( AALPPField	240:85	160:30	75 )         list( NWLPPField	460:85	160:30	75 )         list( CTLPPField	20:120	160:30	75 )         list( ImpLPPField	240:120	160:30	75 )                  list( DesingRuleLabelField	20:165	360:20 )         list( CTWidthField	20:180	160:25	100 )         list( CTSpaceField	20:210	160:25	100 )         list( CT_NumField	20:240	210:25	160 )         list( AAEncCTField	240:180	210:25	150 )         list( M1EncCTField	240:210	210:25	150 )         list( ImpEncAAField	240:240	210:25	150 )	         list( NWEncAAField	460:180	210:25	150 )                  list( ChoppableField	20:280	210:25	75 )         list( CTGapTypeField	240:280	220:25	120 )         list( RingPField	470:280	120:25	90 )                  list( MyLabelField	460:320 220:20 )         	)            ;?buttonLayout	'OKCancelDefLast      ?unmapAfterCB 	 t      ;?formType?	'options      ;?help		"hehe,enjoy it!"      ) ; hiCreateAppForm;hiDisplayForm( CreateTapForm ));let);procedure ;the current value diplayed in the form is the last value you input. procedure(DisplayCreateTapForm()  if(boundp('CreateTapForm)==nil || CreateTapForm==nil then    CreateTap()   )   hiDisplayForm(CreateTapForm));;; init the techfile then set the binkkey.Tech = techGetTechFile(geGetEditRep())if(boundp('Tech)==nil || Tech==nil then  error("Can't read the techfile! Open the Layout First!")else  hiSetBindKey("Layout" "Ctrl<Key>t" "{DisplayCreateTapForm() leHiCreateMPP()}"));if  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -