EDAboard.com | EDAboard.de | EDAboard.co.uk | WTWH Media

Help needed for form creation.

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Cadence - Help needed for form creation.


Guest

Mon Jun 20, 2016 10:02 am   



Hi ,

I need some help with form creation.
; here is my code . Sorry if this looks messy.
;--------------------------
procedure(xiPGForm(@key (_rows 0) (_cols 0) )
let((frm flds purps metals
widthBut widthFld posBut posFld addBut delBut modBut defsFld
layFld pitchBut pitchFld defBut nameFld nukeBut purpFld viaStyleFld
nukTBut _sepFld _abutBut copyFBut copyLFld loadBut saveBut
pulBLBut pulBLFld pulTRBut pulTRFld changeBut grabBut viaLbl copyTBut
spulBLBut spulBLFld spulTRBut spulTRFld spltFld trkLbl opsLbl
sliceBut _botf _topf
)

trkLbl = hiCreateLabel(
?name 'trkLbl
?labelText "============ Track spec ============")
widthBut = hiCreateButton(
?name 'widthBut
?buttonText "Width"
?callback "xiLePwrGridGetWidth()")
widthFld = hiCreateFloatField(
?name 'widthFld ?value 1.0)
posBut = hiCreateButton(
?name 'posBut
?buttonText "Offset"
?callback "xiLePwrGridGetPos()")
posFld = hiCreateFloatField(
?name 'posFld
?value 0.0)
nameFld = hiCreateStringField(
?name 'nameFld
?value ""
?prompt "Net name"
?defValue "VSS")
pcWFld = hiCreateFloatField(
?name 'pcWFld
?value 2.6
?prompt "pCell X period")
pcHFld = hiCreateFloatField(
?name 'pcHFld
?value 2.6
?prompt "pCell Y Period")
pulBLBut = hiCreateLabel(
?name 'pulBLLbl
?labelText "B/L Pullback")
pulBLFld = hiCreateFloatField(
?name 'pulBLFld
?value 0.0)
pulTRBut = hiCreateLabel(
?name 'pulTRLbl
?labelText "T/R Pullback")
pulTRFld = hiCreateFloatField(
?name 'pulTRFld
?value 0.0)
spltFld = hiCreateBooleanButton(
?name 'split
?buttonText "Allow split rail"
?defValue nil)
strchBLFld = hiCreateBooleanButton(
?name 'stretchBL
?buttonText "Stretchable?"
?defValue t)
strchTRFld = hiCreateBooleanButton(
?name 'stretchTR
?buttonText "Stretchable?"
?defValue t)
gapFld = hiCreateFloatField(
?name 'gapFld
?value 0.0
?prompt "Stretched Gap")
purpFld = hiCreateRadioField(
?name 'purpFld
?prompt "Layer purpose"
?choices list("drawing" "track")
?defValue "drawing"
?callback list("sampleLePwrGridDirChange()"))
colorFld = hiCreateRadioField(
?name 'colorFld
?prompt "Color"
?choices list("N/A" "A" "B")
?defValue "N/A"
?callback list("sampleLePwrGridColorChange()"))
addBut = hiCreateButton(
?name 'addBut
?buttonText "Add"
?callback "sampleLePwrGridAddCB()")
delBut = hiCreateButton(
?name 'delBut
?buttonText "Delete"
?callback "xiListEditorCB(hiGetCurrentForm() 'Delete)")
modBut = hiCreateButton(
?name 'modBut
?buttonText "Modify"
?callback "sampleLePwrGridModCB()")
grabBut = hiCreateButton(
?name 'grabBut
?buttonText "Grab"
?callback "sampleLePwrGridGrab()")
nukeBut = hiCreateButton(
?name 'nukeBt
?buttonText "rm All"
?callback "sampleLePwrGridNukeCB()")
nukTBut = hiCreateButton(
?name 'nukTBt
?buttonText "rm Tracks"
?callback "sampleLePwrGridNukeTracksCB()")
defBut = hiCreateButton(
?name 'defBut
?buttonText "Default"
?callback "sampleLePwrGridDefCB()")
defsFldList = list(
"Net=VSS Lpp=M1:drawing Dir=V W=1.0 Offset=0.0 PullbackBL=0.0 PullbackTR=0.0"
"Net=VDD Lpp=M1:drawing Dir=V W=1.0 Offset=2.0 PullbackBL=0.0 PullbackTR=0.0 "
"Net=VSS Lpp=M2:drawing Dir=H W=1.0 Offset=0.0 PullbackBL=0.0 PullbackTR=0.0"
"Net=VDD Lpp=M2:drawing Dir=H W=1.0 Offset=2.0 PullbackBL=0.0 PullbackTR=0.0 "
"Via=tsmcN7:M2_M1 Style=rect orient=R0 Rows=1 Cols=1 RowP=0.5 ColP=0.5 TLayLREnc=0.002 BLayLREnc=0.002 TLayTBEnc=0.002 BLayTBEnc=0.002"
"...")
defsFld = hiCreateListBoxField(
?name 'defsFld
?choices defsFldList
?valueByPosition t
?CBOnReselect t
?multipleSelect t
?changeCB "CCSlistBoxCB(CCSlistBoxForm 'lb1)")
_sepFld = hiCreateSeparatorField(
?name 'sepFld)
viaLbl = hiCreateLabel(
?name 'viaLbl
?labelText "============ Via spec ============")
vmodeFld = hiCreateRadioField(
?name 'vmodeFld
?prompt "Via mode"
?choices list("auto" "manual")
?defValue "auto")
metals = xifetchMetalLayers("pcell_lib")
dirFld = hiCreateRadioField(
?name 'dirFld
?prompt "Metal direction"
?choices list("H" "V")
?defValue "H" ?callback list(""))
viaList = xifetchValidVias("pcell_lib")
cellNameFld = hiCreateCyclicField(
?name 'cellNameFld
?prompt "Cell name"
?defValue "M2_M1"
?choices viaList )
layFld = hiCreateCyclicField(
?name 'metalFld
?prompt "Metal Layer"
?choices metals
?defValue car(metals)
?callback "xiSetLayerDirection(hiGetCurrentForm() \"pcell_lib\")")
libNameFld = hiCreateStringField(
?name 'libNameFld
?value "tsmcN7"
?prompt "Lib name")
viaList = xifetchValidVias("pcell_lib")
cellNameFld = hiCreateCyclicField(
?name 'cellNameFld
?prompt "Cell name"
?defValue "M2_M1"
?choices viaList )
viaStyleFld = hiCreateCyclicField(
?name 'vsas
?prompt "Via Style"
?value "rect"
?defValue "rect"
?choices list("rect" "square")
;?callback list("sampleLePwrGridViaStyleCB()" "sampleLePwrGridViaStyleCB()")
)
viaPosFld = hiCreateFloatField(
?name 'viaPolFld
?value 0.5
?prompt " Via Pos")
viaColFld = hiCreateStringField(
?name 'viaColFld
?value "1"
?prompt " Cols")
viaRowFld = hiCreateStringField(
?name 'viaRowFld
?value "1"
?prompt " Rows")
viaR0Fld = hiCreateRadioField(
?name 'ViaR0Fld
?prompt "Orient"
?choices list("R0" "R90")
?defValue "R0"
?callback list("sampleLeViaOrientChange()"))
viaRowPitchFld = hiCreateFloatField(
?name 'viaRowPitchFld
?value 0.5
?prompt "Row Pitch")
viaColPitchFld = hiCreateFloatField(
?name 'viaColPitchFld
?value 0.5
?prompt "Col Pitch")
viaTopXEncFld = hiCreateFloatField(
?name 'viaTopXEncFld
?value 0.002
?prompt "TLay LR Enc")
viaBotXEncFld = hiCreateFloatField(
?name 'viaBotXEncFld
?value 0.002
?prompt "BLay LR Enc")
viaTopYEncFld = hiCreateFloatField(
?name 'viaTopYEncFld
?value 0.002
?prompt "TLay TB Enc")
viaBotYEncFld = hiCreateFloatField(
?name 'viaBotYEncFld
?value 0.002
?prompt "BLay TB Enc")
pitchBut = hiCreateLabel(
?name 'pitchLbl
?labelText "Pitch")
pitchFld = hiCreateFloatField(
?name 'pitchFld
?value 0.0
?callback "sampleLePwrGridPitchCB()")
spulBLBut = hiCreateLabel(
?name 'spulBLLbl
?labelText "B/L Pullback")
spulBLFld = hiCreateFloatField(
?name 'spulBLFld
?value 0.0)
spulTRBut = hiCreateLabel(
?name 'spulTRLbl
?labelText "T/R Pullback")
spulTRFld = hiCreateFloatField(
?name 'spulTRFld
?value 0.0)
opsLbl = hiCreateLabel(
?name 'opsLbl
?labelText "Global operations")
copyTBut = hiCreateButton(
?name 'copyTBut
?buttonText "Copy To"
?callback "sampleLePwrGridCopyTo()")
copyFBut = hiCreateButton(
?name 'copyFBut
?buttonText "Copy From"
?callback "sampleLePwrGridCopyFrom()")
_abutBut = hiCreateButton(
?name 'abutBut
?buttonText "Abut To"
?callback "sampleLePwrGridAbutTo()")
sliceBut = hiCreateButton(
?name 'sliceBut
?buttonText "Slice Grid"
?callback "sampleLePwrGridSlice()")
loadBut = hiCreateButton(
?name 'loadBut
?buttonText "Load from File"
?callback "sampleLePwrGridLoad()")
saveBut = hiCreateButton(
?name 'saveBut
?buttonText "Save to File"
?callback "sampleLePwrGridSave()")
changeBut = hiCreateButton(
?name 'changeBut
?buttonText "Apply Changes"
?callback "sampleLePwrGridSel()")
copyLFld = hiCreateRadioField(
?name 'copyL
?enabled t
?choices list("All" "V only" "H only")
?defValue "All")
_botf = hiCreateCyclicField(
?prompt "Bottom Metal"
?name 'bot
?choices metals
?callback "sampleLePwrGridDrawFormCB()" )
_topf = hiCreateCyclicField(
?prompt "Top Metal"
?name 'top
?choices metals
?defValue car(last(metals) )
?callback "sampleLePwrGridDrawFormCB()")

flds = list(list(trkLbl 0:10 480:20)
list(widthBut 0:30 80:2Cool
list(widthFld 80:30 80:2Cool
list(posBut 160:30 80:2Cool
list(posFld 240:30 80:2Cool
list(nameFld 320:30 160:28 55)
list(pulBLBut 0:60 80:2Cool
list(pulBLFld 80:60 80:2Cool
list(pulTRBut 240:60 80:2Cool
list(pulTRFld 320:60 80:2Cool
list(layFld 0:90 120:28 80)
list(dirFld 140:90 240:28 85)
list(purpFld 310:90 160:28 85)
list(viaLbl 0:120 240:10)
list(libNameFld 0:135 160:28 60)
list(cellNameFld 160:135 160:28 60)
list(viaStyleFld 0:163 160:28 60)
list(viaR0Fld 200:163 160:28 40)
list(viaRowFld 0:185 160:28 70)
list(viaColFld 160:185 160:28 70)
list(viaRowPitchFld 320:185 160:28 70)
list(viaColPitchFld 480:185 160:28 70)
list(viaTopXEncFld 0:215 160:28 70)
list(viaBotXEncFld 160:215 160:28 70)
list(viaTopYEncFld 320:215 160:28 70)
list(viaBotYEncFld 480:215 160:28 70)
list(addBut 0:245 50:2Cool
list(modBut 50:245 50:2Cool
list(delBut 100:245 50:2Cool
list(grabBut 150:245 50:2Cool
list(nukeBut 320:245 80:2Cool
list(defBut 400:245 80:2Cool
list(defsFld 0:280 1000:200)
list(opsLbl 0:480 480:20)
list(pcWFld 0:500 160:28 90)
list(pcHFld 160:500 160:28 90)
list(sliceBut 330:500 80:2Cool
list(loadBut 420:500 100:2Cool
list(saveBut 520:500 80:2Cool
list(copyLFld 0:540 300:2Cool
list(changeBut 300:540 180:2Cool
)

frm = hiCreateAppForm(
?name 'sampleLePwrGridFrm
?fields flds
?initialSize list(999 999)
?formTitle "Sample Power Grid Form"
?unmapAfterCB t
?buttonLayout 'Close
?callback "samplePwrGridHilight(nil)"
?attachmentList list(hicLeftPositionSet |hicTopPositionSet|hicRightPercentSet|hicBottomPercentSet hicLeftPercentSet|
hicTopPositionSet | hicRightPercentSet |hicBottomPercentSet)
)
hiDisplayForm('frm)
);let
);procedure xiPGForm

procedure(xifetchMetalLayers(lib)
let((tf layerFun metLayerFun)
tf = techGetTechFile(ddGetObj(lib))
layerFun = techGetLayerFunctions( tf)
metLayerFun = mapcar('car setof(layer layerFun cadr(layer)=="metal"))
printf("Metal Layers of techLib %s are:\n%L" lib metLayerFun)
metLayerFun
);let
);procedure xifetchMetalLayers

procedure(xifetchValidVias(lib)
let((tf layerFun metLayerFun)
tf = techGetTechFile(ddGetObj(lib))
vaildViaFun = tf~>viaDefs~>name
printf("Valid Vias of techLib %s are:\n%L" lib vaildViaFun)
vaildViaFun
);let
);procedure xifetchValidVias

procedure(xiSetLayerDirection(theForm lib)
let((metal metallist vialist via direction tf )
metal = theForm->metalFld->value
tf = techGetTechFile(ddGetObj(lib))
;Setting Metal direaction
direction = techGetLayerRoutingGrid( tf metal)
if( direction == "horizontal" then
theForm->dirFld->value = "H"
else
theForm->dirFld->value = "V"
)
; Setting Via type
metallist = theForm->metalFld->choices
vialist = theForm->cellNameFld->choices
via = strcat(metal "_" nth(lindex(metallist metal)-2 metallist) )
if(member(via vialist) then
theForm->cellNameFld->value=via
)
;Setting via cutclass

);
)

procedure( xiListEditorCB( sampleLePwrGridFrm theAction )
prog( ( selectedItem choices )
selectedItem = car( sampleLePwrGridFrm->defsFld->value )
when( !selectedItem
printf( "You haven't selected an item yet\n" )
return( nil )
) ; when
;Fetching all the field value
Width = sprintf(str,"%L" car(sampleLePwrGridFrm->defsFld->value))
Offset = sprintf(str,"%L" sampleLePwrGridFrm->posFld->value)
Net = sampleLePwrGridFrm->nameFld->value
BLpull = sprintf(str,"%L" sampleLePwrGridFrm->pulBLFld->value)
TRpull = sprintf(str,"%L" sampleLePwrGridFrm->pulTRFld->value)
Metal = sampleLePwrGridFrm->metalFld->value
Mdirection = sampleLePwrGridFrm->dirFld->value
lpp = sampleLePwrGridFrm->purpFld->value
vialib = sampleLePwrGridFrm->libNameFld->value
via = sampleLePwrGridFrm->cellNameFld->value
viaStyle = sampleLePwrGridFrm->vsas->value
viaOrient = sampleLePwrGridFrm->ViaR0Fld->value
viaRow = sampleLePwrGridFrm->viaRowFld->value
viaCol = sampleLePwrGridFrm->viaColFld->value
viaRowPitch = sampleLePwrGridFrm->viaRowPitchFld->value
viaColPitch = sampleLePwrGridFrm->viaColPitchFld->value
viaTopXLyrEnc = sampleLePwrGridFrm->viaTopXEncFld->value
viaBotXLyrEnc = sampleLePwrGridFrm->viaBotXEncFld->value
viaTopYLyrEnc = sampleLePwrGridFrm->viaTopYEncFld->value
viaBotYLyrEnc = sampleLePwrGridFrm->viaBotYEncFld->value



if( lpp == "drawing" then
value = strcat("Net=" Net " lpp=" Metal ":" lpp " Dir=" Mdirection " W=" Width " Offset=" Offset
" PullBackBL=" BLpull " PullbackTL=" TRpull)
printf("\n Contain :- %L " value)
)


case( theAction

( Delete
printf("\nI am in delete \n")
sampleLePwrGridFrm->defsFld->choices = remove(
selectedItem ;;; selected element
choices ;;; from list of items
) ; remove
;;; no selection
) ; Delete

( t
error( "Unsupported action: %L" theAction )
) ; t
) ; case
) ; let
) ; procedure

procedure(CCSlistBoxCB(form field)
;; a simple case statement to select the same numbered field
;; in another list box as was selected in this list box
caseq(field
(lb1
putpropq(getq(form lb2) getq(get(form field) value) value)
)
(lb2
putpropq(getq(form lb1) getq(get(form field) value) value)
)
); case
); procedure CCSlistBoxCB


-------------------------

I am struggling to have add,modify,Delete.button working. Basically it should add,Modify entries based based on top keys. Any help on this is highly appreciation.

I can get more information if needed. This is something I have just started to work and it's in early stage and most of things are not ready yet.

Thanks,
Sandeep


Guest

Mon Jun 20, 2016 10:10 am   



I am still working on code and will probably will have better one by tomorrow. Thanks in advance for looking at it or if it's looking very messy bear will me till I send updated code.


On Monday, June 20, 2016 at 1:32:12 PM UTC+5:30, sandeep...@gmail.com wrote:
Quote:
Hi ,

I need some help with form creation.
; here is my code . Sorry if this looks messy.
;--------------------------
procedure(xiPGForm(@key (_rows 0) (_cols 0) )
let((frm flds purps metals
widthBut widthFld posBut posFld addBut delBut modBut defsFld
layFld pitchBut pitchFld defBut nameFld nukeBut purpFld viaStyleFld
nukTBut _sepFld _abutBut copyFBut copyLFld loadBut saveBut
pulBLBut pulBLFld pulTRBut pulTRFld changeBut grabBut viaLbl copyTBut
spulBLBut spulBLFld spulTRBut spulTRFld spltFld trkLbl opsLbl
sliceBut _botf _topf
)

trkLbl = hiCreateLabel(
?name 'trkLbl
?labelText "============ Track spec ============")
widthBut = hiCreateButton(
?name 'widthBut
?buttonText "Width"
?callback "xiLePwrGridGetWidth()")
widthFld = hiCreateFloatField(
?name 'widthFld ?value 1.0)
posBut = hiCreateButton(
?name 'posBut
?buttonText "Offset"
?callback "xiLePwrGridGetPos()")
posFld = hiCreateFloatField(
?name 'posFld
?value 0.0)
nameFld = hiCreateStringField(
?name 'nameFld
?value ""
?prompt "Net name"
?defValue "VSS")
pcWFld = hiCreateFloatField(
?name 'pcWFld
?value 2.6
?prompt "pCell X period")
pcHFld = hiCreateFloatField(
?name 'pcHFld
?value 2.6
?prompt "pCell Y Period")
pulBLBut = hiCreateLabel(
?name 'pulBLLbl
?labelText "B/L Pullback")
pulBLFld = hiCreateFloatField(
?name 'pulBLFld
?value 0.0)
pulTRBut = hiCreateLabel(
?name 'pulTRLbl
?labelText "T/R Pullback")
pulTRFld = hiCreateFloatField(
?name 'pulTRFld
?value 0.0)
spltFld = hiCreateBooleanButton(
?name 'split
?buttonText "Allow split rail"
?defValue nil)
strchBLFld = hiCreateBooleanButton(
?name 'stretchBL
?buttonText "Stretchable?"
?defValue t)
strchTRFld = hiCreateBooleanButton(
?name 'stretchTR
?buttonText "Stretchable?"
?defValue t)
gapFld = hiCreateFloatField(
?name 'gapFld
?value 0.0
?prompt "Stretched Gap")
purpFld = hiCreateRadioField(
?name 'purpFld
?prompt "Layer purpose"
?choices list("drawing" "track")
?defValue "drawing"
?callback list("sampleLePwrGridDirChange()"))
colorFld = hiCreateRadioField(
?name 'colorFld
?prompt "Color"
?choices list("N/A" "A" "B")
?defValue "N/A"
?callback list("sampleLePwrGridColorChange()"))
addBut = hiCreateButton(
?name 'addBut
?buttonText "Add"
?callback "sampleLePwrGridAddCB()")
delBut = hiCreateButton(
?name 'delBut
?buttonText "Delete"
?callback "xiListEditorCB(hiGetCurrentForm() 'Delete)")
modBut = hiCreateButton(
?name 'modBut
?buttonText "Modify"
?callback "sampleLePwrGridModCB()")
grabBut = hiCreateButton(
?name 'grabBut
?buttonText "Grab"
?callback "sampleLePwrGridGrab()")
nukeBut = hiCreateButton(
?name 'nukeBt
?buttonText "rm All"
?callback "sampleLePwrGridNukeCB()")
nukTBut = hiCreateButton(
?name 'nukTBt
?buttonText "rm Tracks"
?callback "sampleLePwrGridNukeTracksCB()")
defBut = hiCreateButton(
?name 'defBut
?buttonText "Default"
?callback "sampleLePwrGridDefCB()")
defsFldList = list(
"Net=VSS Lpp=M1:drawing Dir=V W=1.0 Offset=0.0 PullbackBL=0.0 PullbackTR=0.0"
"Net=VDD Lpp=M1:drawing Dir=V W=1.0 Offset=2.0 PullbackBL=0.0 PullbackTR=0.0 "
"Net=VSS Lpp=M2:drawing Dir=H W=1.0 Offset=0.0 PullbackBL=0.0 PullbackTR=0.0"
"Net=VDD Lpp=M2:drawing Dir=H W=1.0 Offset=2.0 PullbackBL=0.0 PullbackTR=0.0 "
"Via=tsmcN7:M2_M1 Style=rect orient=R0 Rows=1 Cols=1 RowP=0.5 ColP=0.5 TLayLREnc=0.002 BLayLREnc=0.002 TLayTBEnc=0.002 BLayTBEnc=0.002"
"...")
defsFld = hiCreateListBoxField(
?name 'defsFld
?choices defsFldList
?valueByPosition t
?CBOnReselect t
?multipleSelect t
?changeCB "CCSlistBoxCB(CCSlistBoxForm 'lb1)")
_sepFld = hiCreateSeparatorField(
?name 'sepFld)
viaLbl = hiCreateLabel(
?name 'viaLbl
?labelText "============ Via spec ============")
vmodeFld = hiCreateRadioField(
?name 'vmodeFld
?prompt "Via mode"
?choices list("auto" "manual")
?defValue "auto")
metals = xifetchMetalLayers("pcell_lib")
dirFld = hiCreateRadioField(
?name 'dirFld
?prompt "Metal direction"
?choices list("H" "V")
?defValue "H" ?callback list(""))
viaList = xifetchValidVias("pcell_lib")
cellNameFld = hiCreateCyclicField(
?name 'cellNameFld
?prompt "Cell name"
?defValue "M2_M1"
?choices viaList )
layFld = hiCreateCyclicField(
?name 'metalFld
?prompt "Metal Layer"
?choices metals
?defValue car(metals)
?callback "xiSetLayerDirection(hiGetCurrentForm() \"pcell_lib\")")
libNameFld = hiCreateStringField(
?name 'libNameFld
?value "tsmcN7"
?prompt "Lib name")
viaList = xifetchValidVias("pcell_lib")
cellNameFld = hiCreateCyclicField(
?name 'cellNameFld
?prompt "Cell name"
?defValue "M2_M1"
?choices viaList )
viaStyleFld = hiCreateCyclicField(
?name 'vsas
?prompt "Via Style"
?value "rect"
?defValue "rect"
?choices list("rect" "square")
;?callback list("sampleLePwrGridViaStyleCB()" "sampleLePwrGridViaStyleCB()")
)
viaPosFld = hiCreateFloatField(
?name 'viaPolFld
?value 0.5
?prompt " Via Pos")
viaColFld = hiCreateStringField(
?name 'viaColFld
?value "1"
?prompt " Cols")
viaRowFld = hiCreateStringField(
?name 'viaRowFld
?value "1"
?prompt " Rows")
viaR0Fld = hiCreateRadioField(
?name 'ViaR0Fld
?prompt "Orient"
?choices list("R0" "R90")
?defValue "R0"
?callback list("sampleLeViaOrientChange()"))
viaRowPitchFld = hiCreateFloatField(
?name 'viaRowPitchFld
?value 0.5
?prompt "Row Pitch")
viaColPitchFld = hiCreateFloatField(
?name 'viaColPitchFld
?value 0.5
?prompt "Col Pitch")
viaTopXEncFld = hiCreateFloatField(
?name 'viaTopXEncFld
?value 0.002
?prompt "TLay LR Enc")
viaBotXEncFld = hiCreateFloatField(
?name 'viaBotXEncFld
?value 0.002
?prompt "BLay LR Enc")
viaTopYEncFld = hiCreateFloatField(
?name 'viaTopYEncFld
?value 0.002
?prompt "TLay TB Enc")
viaBotYEncFld = hiCreateFloatField(
?name 'viaBotYEncFld
?value 0.002
?prompt "BLay TB Enc")
pitchBut = hiCreateLabel(
?name 'pitchLbl
?labelText "Pitch")
pitchFld = hiCreateFloatField(
?name 'pitchFld
?value 0.0
?callback "sampleLePwrGridPitchCB()")
spulBLBut = hiCreateLabel(
?name 'spulBLLbl
?labelText "B/L Pullback")
spulBLFld = hiCreateFloatField(
?name 'spulBLFld
?value 0.0)
spulTRBut = hiCreateLabel(
?name 'spulTRLbl
?labelText "T/R Pullback")
spulTRFld = hiCreateFloatField(
?name 'spulTRFld
?value 0.0)
opsLbl = hiCreateLabel(
?name 'opsLbl
?labelText "Global operations")
copyTBut = hiCreateButton(
?name 'copyTBut
?buttonText "Copy To"
?callback "sampleLePwrGridCopyTo()")
copyFBut = hiCreateButton(
?name 'copyFBut
?buttonText "Copy From"
?callback "sampleLePwrGridCopyFrom()")
_abutBut = hiCreateButton(
?name 'abutBut
?buttonText "Abut To"
?callback "sampleLePwrGridAbutTo()")
sliceBut = hiCreateButton(
?name 'sliceBut
?buttonText "Slice Grid"
?callback "sampleLePwrGridSlice()")
loadBut = hiCreateButton(
?name 'loadBut
?buttonText "Load from File"
?callback "sampleLePwrGridLoad()")
saveBut = hiCreateButton(
?name 'saveBut
?buttonText "Save to File"
?callback "sampleLePwrGridSave()")
changeBut = hiCreateButton(
?name 'changeBut
?buttonText "Apply Changes"
?callback "sampleLePwrGridSel()")
copyLFld = hiCreateRadioField(
?name 'copyL
?enabled t
?choices list("All" "V only" "H only")
?defValue "All")
_botf = hiCreateCyclicField(
?prompt "Bottom Metal"
?name 'bot
?choices metals
?callback "sampleLePwrGridDrawFormCB()" )
_topf = hiCreateCyclicField(
?prompt "Top Metal"
?name 'top
?choices metals
?defValue car(last(metals) )
?callback "sampleLePwrGridDrawFormCB()")

flds = list(list(trkLbl 0:10 480:20)
list(widthBut 0:30 80:2Cool
list(widthFld 80:30 80:2Cool
list(posBut 160:30 80:2Cool
list(posFld 240:30 80:2Cool
list(nameFld 320:30 160:28 55)
list(pulBLBut 0:60 80:2Cool
list(pulBLFld 80:60 80:2Cool
list(pulTRBut 240:60 80:2Cool
list(pulTRFld 320:60 80:2Cool
list(layFld 0:90 120:28 80)
list(dirFld 140:90 240:28 85)
list(purpFld 310:90 160:28 85)
list(viaLbl 0:120 240:10)
list(libNameFld 0:135 160:28 60)
list(cellNameFld 160:135 160:28 60)
list(viaStyleFld 0:163 160:28 60)
list(viaR0Fld 200:163 160:28 40)
list(viaRowFld 0:185 160:28 70)
list(viaColFld 160:185 160:28 70)
list(viaRowPitchFld 320:185 160:28 70)
list(viaColPitchFld 480:185 160:28 70)
list(viaTopXEncFld 0:215 160:28 70)
list(viaBotXEncFld 160:215 160:28 70)
list(viaTopYEncFld 320:215 160:28 70)
list(viaBotYEncFld 480:215 160:28 70)
list(addBut 0:245 50:2Cool
list(modBut 50:245 50:2Cool
list(delBut 100:245 50:2Cool
list(grabBut 150:245 50:2Cool
list(nukeBut 320:245 80:2Cool
list(defBut 400:245 80:2Cool
list(defsFld 0:280 1000:200)
list(opsLbl 0:480 480:20)
list(pcWFld 0:500 160:28 90)
list(pcHFld 160:500 160:28 90)
list(sliceBut 330:500 80:2Cool
list(loadBut 420:500 100:2Cool
list(saveBut 520:500 80:2Cool
list(copyLFld 0:540 300:2Cool
list(changeBut 300:540 180:2Cool
)

frm = hiCreateAppForm(
?name 'sampleLePwrGridFrm
?fields flds
?initialSize list(999 999)
?formTitle "Sample Power Grid Form"
?unmapAfterCB t
?buttonLayout 'Close
?callback "samplePwrGridHilight(nil)"
?attachmentList list(hicLeftPositionSet |hicTopPositionSet|hicRightPercentSet|hicBottomPercentSet hicLeftPercentSet|
hicTopPositionSet | hicRightPercentSet |hicBottomPercentSet)
)
hiDisplayForm('frm)
);let
);procedure xiPGForm

procedure(xifetchMetalLayers(lib)
let((tf layerFun metLayerFun)
tf = techGetTechFile(ddGetObj(lib))
layerFun = techGetLayerFunctions( tf)
metLayerFun = mapcar('car setof(layer layerFun cadr(layer)=="metal"))
printf("Metal Layers of techLib %s are:\n%L" lib metLayerFun)
metLayerFun
);let
);procedure xifetchMetalLayers

procedure(xifetchValidVias(lib)
let((tf layerFun metLayerFun)
tf = techGetTechFile(ddGetObj(lib))
vaildViaFun = tf~>viaDefs~>name
printf("Valid Vias of techLib %s are:\n%L" lib vaildViaFun)
vaildViaFun
);let
);procedure xifetchValidVias

procedure(xiSetLayerDirection(theForm lib)
let((metal metallist vialist via direction tf )
metal = theForm->metalFld->value
tf = techGetTechFile(ddGetObj(lib))
;Setting Metal direaction
direction = techGetLayerRoutingGrid( tf metal)
if( direction == "horizontal" then
theForm->dirFld->value = "H"
else
theForm->dirFld->value = "V"
)
; Setting Via type
metallist = theForm->metalFld->choices
vialist = theForm->cellNameFld->choices
via = strcat(metal "_" nth(lindex(metallist metal)-2 metallist) )
if(member(via vialist) then
theForm->cellNameFld->value=via
)
;Setting via cutclass

);
)

procedure( xiListEditorCB( sampleLePwrGridFrm theAction )
prog( ( selectedItem choices )
selectedItem = car( sampleLePwrGridFrm->defsFld->value )
when( !selectedItem
printf( "You haven't selected an item yet\n" )
return( nil )
) ; when
;Fetching all the field value
Width = sprintf(str,"%L" car(sampleLePwrGridFrm->defsFld->value))
Offset = sprintf(str,"%L" sampleLePwrGridFrm->posFld->value)
Net = sampleLePwrGridFrm->nameFld->value
BLpull = sprintf(str,"%L" sampleLePwrGridFrm->pulBLFld->value)
TRpull = sprintf(str,"%L" sampleLePwrGridFrm->pulTRFld->value)
Metal = sampleLePwrGridFrm->metalFld->value
Mdirection = sampleLePwrGridFrm->dirFld->value
lpp = sampleLePwrGridFrm->purpFld->value
vialib = sampleLePwrGridFrm->libNameFld->value
via = sampleLePwrGridFrm->cellNameFld->value
viaStyle = sampleLePwrGridFrm->vsas->value
viaOrient = sampleLePwrGridFrm->ViaR0Fld->value
viaRow = sampleLePwrGridFrm->viaRowFld->value
viaCol = sampleLePwrGridFrm->viaColFld->value
viaRowPitch = sampleLePwrGridFrm->viaRowPitchFld->value
viaColPitch = sampleLePwrGridFrm->viaColPitchFld->value
viaTopXLyrEnc = sampleLePwrGridFrm->viaTopXEncFld->value
viaBotXLyrEnc = sampleLePwrGridFrm->viaBotXEncFld->value
viaTopYLyrEnc = sampleLePwrGridFrm->viaTopYEncFld->value
viaBotYLyrEnc = sampleLePwrGridFrm->viaBotYEncFld->value



if( lpp == "drawing" then
value = strcat("Net=" Net " lpp=" Metal ":" lpp " Dir=" Mdirection " W=" Width " Offset=" Offset
" PullBackBL=" BLpull " PullbackTL=" TRpull)
printf("\n Contain :- %L " value)
)


case( theAction

( Delete
printf("\nI am in delete \n")
sampleLePwrGridFrm->defsFld->choices = remove(
selectedItem ;;; selected element
choices ;;; from list of items
) ; remove
;;; no selection
) ; Delete

( t
error( "Unsupported action: %L" theAction )
) ; t
) ; case
) ; let
) ; procedure

procedure(CCSlistBoxCB(form field)
;; a simple case statement to select the same numbered field
;; in another list box as was selected in this list box
caseq(field
(lb1
putpropq(getq(form lb2) getq(get(form field) value) value)
)
(lb2
putpropq(getq(form lb1) getq(get(form field) value) value)
)
); case
); procedure CCSlistBoxCB


-------------------------

I am struggling to have add,modify,Delete.button working. Basically it should add,Modify entries based based on top keys. Any help on this is highly appreciation.

I can get more information if needed. This is something I have just started to work and it's in early stage and most of things are not ready yet.

Thanks,
Sandeep


elektroda.net NewsGroups Forum Index - Cadence - Help needed for form creation.

Ask a question - edaboard.com

Arabic version Bulgarian version Catalan version Czech version Danish version German version Greek version English version Spanish version Finnish version French version Hindi version Croatian version Indonesian version Italian version Hebrew version Japanese version Korean version Lithuanian version Latvian version Dutch version Norwegian version Polish version Portuguese version Romanian version Russian version Slovak version Slovenian version Serbian version Swedish version Tagalog version Ukrainian version Vietnamese version Chinese version Turkish version
EDAboard.com map