Metal transition

S

sesi

Guest
Hello all,
I got this code from one of the posts of Eric ,
I have got few problems here I could able to change from metal 2 to
metal1 and metal 1 to poly1 , when I press Alt1 and Alt0.
But the current layer is metal2 and press Alt3 its giving an error as
*WARNING* hiMakeLPChoiceList: Invalid layer/purpose - ("metal3"
"drawing")
same thing for met3 to met2 change when the current layer is metal3
and press Alt2 its giving an error as *WARNING* hiMakeLPChoiceList:
Invalid layer/purpose - ("metal2"drawing").
And also how can I add two vias instaed of one and 0.0 microns fixed
metal width instaed of minimum forall the layers.

procedure(ABlayerChange(layer)
le0PathForm->changePathLayer->value =
car(
hiMakeLPChoiceList(
techGetTechFile(geGetEditCellView())
list(list(layer "drawing"))
)
)
)

procedure(m3trans()
ABlayerChange("metal3")
)

procedure(m2trans()
ABlayerChange("metal2")
)

procedure(m1trans()
ABlayerChange("metal1")
)

procedure(m0trans()
ABlayerChange("poly1")
)

hiSetBindKeys( "Layout" list(
list("Alt<Key>0" "m0trans()");
list("Alt<Key>1" "m1trans()");
list("Alt<Key>2" "m2trans()");
list("Alt<Key>3" "m3trans()");
))

Regards,
Sesi.
 
Hello all,
I got this code from one of the posts of Eric ,
I have got few problems here I could able to change from metal 2 to
metal1 and metal 1 to poly1 , when I press Alt1 and Alt0.
But the current layer is metal2 and press Alt3 its giving an error as
*WARNING* hiMakeLPChoiceList: Invalid layer/purpose - ("metal3"
"drawing")
same thing for met3 to met2 change when the current layer is metal3
and press Alt2 its giving an error as *WARNING* hiMakeLPChoiceList:
Invalid layer/purpose - ("metal2"drawing").
And also how can I add two vias instaed of one and 0.9 microns fixed
metal width instaed of minimum forall the layers.

procedure(ABlayerChange(layer)
le0PathForm->changePathLayer->value =
car(
hiMakeLPChoiceList(
techGetTechFile(geGetEditCellView())
list(list(layer "drawing"))
)
)
)

procedure(m3trans()
ABlayerChange("metal3")
)

procedure(m2trans()
ABlayerChange("metal2")
)

procedure(m1trans()
ABlayerChange("metal1")
)

procedure(m0trans()
ABlayerChange("poly1")
)

hiSetBindKeys( "Layout" list(
list("Alt<Key>0" "m0trans()");
list("Alt<Key>1" "m1trans()");
list("Alt<Key>2" "m2trans()");
list("Alt<Key>3" "m3trans()");
))

Regards,
Sesi.
 
On Sep 27, 2:43 am, sesi <sesikala...@gmail.com> wrote:
 Hello all,
  I got this code from one of the posts of Eric ,
I have got few problems here I could able to change from metal 2 to
metal1 and metal 1 to poly1 , when I press Alt1 and Alt0.
But the current layer is metal2 and press Alt3 its giving an error as
*WARNING* hiMakeLPChoiceList: Invalid layer/purpose - ("metal3"
"drawing")
same thing for met3 to met2 change when the current layer is metal3
and press Alt2 its giving an error as *WARNING* hiMakeLPChoiceList:
Invalid layer/purpose - ("metal2"drawing").
And also how can I add two vias instaed of one and 0.9 microns fixed
metal width instaed of minimum forall the layers.

procedure(ABlayerChange(layer)
   le0PathForm->changePathLayer->value >      car(
       hiMakeLPChoiceList(
         techGetTechFile(geGetEditCellView())
         list(list(layer "drawing"))
       )
     )
)

procedure(m3trans()
   ABlayerChange("metal3")
)

procedure(m2trans()
   ABlayerChange("metal2")
)

procedure(m1trans()
   ABlayerChange("metal1")
)

procedure(m0trans()
   ABlayerChange("poly1")
)

hiSetBindKeys( "Layout" list(
list("Alt<Key>0"                "m0trans()");
list("Alt<Key>1"                "m1trans()");
list("Alt<Key>2"                "m2trans()");
list("Alt<Key>3"                "m3trans()");
))

Regards,
Sesi.

Hi Sesi,

I hadn't been writing Skill code for very long when I wrote most of
this, Andrew Beckett helped alot with this. The idea of the script
is "if path hasn't started, then keys will start path biased to the
metal user wants to start, else user wants to change metal layers".

I am not looking at the tech file or other scheme to get the proper
metal layers, they are hard coded which isn't very elegent. So it is
very PDK specific. It sounds like you need to write one specific for
your PDK.

The easiest thing to do I think is draw a path from the lowest level
to the highest level metal and click on the metal and do a
leHiEditProp() (should be q on the bindkey) and record the name of
that metal layer for your PDK. Take this info and change the metal
layer info to your pdk(you may have more or less layers).

For example here is one written for another PDK..... Notice instead
of "metal1" and so on the metals are called "met1" and so on.

procedure(m5bias()
leSetEntryLayer('("met5" "drawing")) leHiCreatePath()
)

procedure(m4bias()
leSetEntryLayer('("met4" "drawing")) leHiCreatePath()
)

procedure(m3bias()
leSetEntryLayer('("met3" "drawing")) leHiCreatePath()
)

procedure(m2bias()
leSetEntryLayer('("met2" "drawing")) leHiCreatePath()
)

procedure(m1bias()
leSetEntryLayer('("met1" "drawing")) leHiCreatePath()
)

procedure(ABlayerChange(layer)
hiGetCurrentForm()->changePathLayer->value car(
hiMakeLPChoiceList(
techGetTechFile(geGetEditCellView())
list(list(layer "drawing"))
)
)
)

procedure(m5trans()
ABlayerChange("met5")
)

procedure(m4trans()
ABlayerChange("met4")
)

procedure(m3trans()
ABlayerChange("met3")
)

procedure(m2trans()
ABlayerChange("met2")
)

procedure(m1trans()
ABlayerChange("met1")
)
procedure(ABPathOrTransitionM1()
if(hiGetCurrentCmd(hiGetCurrentWindow()) == "Path"
then m1trans()
else m1bias()
);if then
);procedure

procedure(ABPathOrTransitionM2()
if(hiGetCurrentCmd(hiGetCurrentWindow()) == "Path"
then m2trans()
else m2bias()
);if then
);procedure


procedure(ABPathOrTransitionM3()
if(hiGetCurrentCmd(hiGetCurrentWindow()) == "Path"
then m3trans()
else m3bias()
);if then
);procedure

procedure(ABPathOrTransitionM4()
if(hiGetCurrentCmd(hiGetCurrentWindow()) == "Path"
then m4trans()
else m4bias()
);if then
);procedure

procedure(ABPathOrTransitionM5()
if(hiGetCurrentCmd(hiGetCurrentWindow()) == "Path"
then m5trans()
else m5bias()
);if then
);procedure

hiSetBindKeys( "Layout" list(
list("Ctrl<Key>1" "ABPathOrTransitionM1()");
list("Ctrl<Key>2" "ABPathOrTransitionM2()");
list("Ctrl<Key>3" "ABPathOrTransitionM3()");
list("Ctrl<Key>4" "ABPathOrTransitionM4()");
list("Ctrl<Key>5" "ABPathOrTransitionM5()");
))


For your via question, there is no easy answer that I have found. The
information used during the Path Command is from the tech file, so you
would have to convince your PDK group(at least that is what it is at
my work) to make the vias in the tech file double vias. This wasn't
a good solution for our group.

Here is a solution where you can go back and select one or more vias
and use the "scroll" on your mouse to change the via counts.


Andrew wrote the two procedures, I attached them to the scroll. This
should work on IC5.1, I am not using IC6 yet(although will be this
week for the first time, ya!!) but I think vias are handled
differently.


procedure(RowAddRoll(incr)
foreach(selObj geGetSelSet()
when(leIsContact(selObj)
selObj~>row=max((selObj~>row||1)+incr 1)
)
)
);
procedure(ColumnAddRoll(incr)
foreach(selObj geGetSelSet()
when(leIsContact(selObj)
selObj~>column=max((selObj~>column||1)+incr 1)
)
)
);

hiSetBindKeys( "Layout" list(
list("Shift Alt<Btn4Down>" "RowAddRoll(1)");
list("Shift Alt<Btn5Down>" "RowAddRoll(-1)");
list("Ctrl Alt<Btn4Down>" "ColumnAddRoll(1)");
list("Ctrl Alt<Btn5Down>" "ColumnAddRoll(-1)");
))

The above code is very popular since you can select on via or a
thousand(tho this would be pretty slow) and it works.

Good luck and don't give up ;)
Eric
 
Hello Eric and Andrew,

Sorry for the delayed reply , actually I was trying to modify this
code.

The problem with the above code is that we cannot increase the via
count to 2 no , since it uses the tech file.
I have tried used create contact function so that I can increase the
Via no more than one.

Please execute the following code by copying it to a file say
drawcusbus.il , and also open a layout window-

loadi("drawcusbus.il")

After loading the file a form opens -

You can see a prompt Enter first point of bus in the layout window.
Enter your points , if you want bend click on want bend1 and select
your layer in the drop down menu and finally click Apply.
Selection of points need not be perfectly horizontal (in the
horizontal side )or vertical (in the vertical side ) as there is
correction loop in the code to adjust the path , reference to the
first point.
For now for reset purpose please click on want bend1 .

Now the issue is -

Here I am taking the coordinates from the user and drawing the path
with the vias ( 2no).

But How can I modify this code such a way that
When the user starts the path command - switching from one layer to
another has to be done using a bindkey ( which can be done easily )
and a Via has to placed automatically ( 2 nos) while this switching is
done .
VIA1 with two nos while switching from m1 to m2 OR m2 to m1.
VIA2 with two nos while switching from m2 to m3 OR m3 to m2.
VIA1+VIA2 with 2 nos while switching from m1 to m3 OR m3 to m1.

May be Andrew or yourself should help me on this .

I know that there is a code in cadence CCSchangePathLayer.il . But
this code uses techfile to generate the via where we cannot increase
the no of vias to 2 (I suppose) , and also path width is minimum ( I
think wecan change this.)






; **************************Starts Here ******************************
procedure(RG_drawcusbus()
let((pointori pointcor width nop sp b x y fpx fpy lpx lpy firpx firpy
laspx laspy xdel ydel templist coor1 coor2 viarow viacol viatype
viacoor)
declare(pointori[50]) pointcor=list() templist=list()
declare(pointemp[50]) declare(x[50]) declare(y[50])
setarray(pointori 1 generatecusbus->coorfix1->value)
setarray(pointori 2 generatecusbus->coorfix2->value)
;Layer="MET1" purpose="drawing"
width=generatecusbus->width->value
nop=generatecusbus->num_paths->value
sp=generatecusbus->spacing->value
for(a 1 length(coorcb) setarray(pointori a+2 coorcb[a+1]->value))
for(a 1 length(coorcb)+2 templist=append1(templist pointori[a]))
foreach(a textcb dbDeleteObject(textcb[a]) remove(a textcb))
;dbCreatePath(geGetWindowCellView() list("text" "drawing") templist
width)
pointcor=append1(pointcor pointori[1])
for(a 1 length(coorcb)+1
xdel=abs(xCoord(pointori[a])-xCoord(pointori[a+1]))
ydel=abs(yCoord(pointori[a])-yCoord(pointori[a+1]))
if(xdel<ydel then
pointcor=append1(pointcor list(xCoord(pointori[a])
yCoord(pointori[a+1])))
else
pointcor=append1(pointcor list(xCoord(pointori[a+1])
yCoord(pointori[a])))
)
)
y[1]=pointcor
b=length(pointcor)
for(a 1 b setarray(x a car(pointcor)) pointcor=cdr(pointcor))
for(a 1 nop-1;************Loop for getting points of each individual
path******
for(c 1 b ;************Loop for getting each individual point of
path*******
if((c==1)
then
fpx=xCoord(x[c]) fpy=yCoord(x[c]) lpx=xCoord(x[c+1])
lpy=yCoord(x[c+1])
;********condition for first point**************
if((b==2)
then
if((fpx==lpx) then fpx=fpx+((width+sp)*a) fpy=fpy y[a
+1]=tconc(nil fpx:fpy)
else fpx=fpx fpy=fpy+((width+sp)*a) y[a+1]=tconc(nil
fpx:fpy)
)
else
laspx=xCoord(x[c+2]) laspy=yCoord(x[c+2])
if((fpx==lpx)&&(fpy<lpy)&&(lpx>laspx) then fpx=fpx-((width
+sp)*a) fpy=fpy y[a+1]=tconc(nil fpx:fpy))
if((fpx==lpx)&&(fpy<lpy)&&(lpx<laspx) then fpx=fpx-((width
+sp)*a) fpy=fpy y[a+1]=tconc(nil fpx:fpy))
if((fpx==lpx)&&(fpy>lpy)&&(lpx>laspx) then fpx=fpx+((width
+sp)*a) fpy=fpy y[a+1]=tconc(nil fpx:fpy))
if((fpx==lpx)&&(fpy>lpy)&&(lpx<laspx) then fpx=fpx+((width
+sp)*a) fpy=fpy y[a+1]=tconc(nil fpx:fpy))
if((fpy==lpy)&&(fpx<lpx)&&(lpy<laspy) then fpx=fpx fpy=fpy+
((width+sp)*a) y[a+1]=tconc(nil fpx:fpy))
if((fpy==lpy)&&(fpx<lpx)&&(lpy>laspy) then fpx=fpx fpy=fpy+
((width+sp)*a) y[a+1]=tconc(nil fpx:fpy))
if((fpy==lpy)&&(fpx>lpx)&&(lpy<laspy) then fpx=fpx fpy=fpy-
((width+sp)*a) y[a+1]=tconc(nil fpx:fpy))
if((fpy==lpy)&&(fpx>lpx)&&(lpy>laspy) then fpx=fpx fpy=fpy-
((width+sp)*a) y[a+1]=tconc(nil fpx:fpy))
)
;************end of condition for first point************
else
if((c==b)
then
fpx=xCoord(x[c]) fpy=yCoord(x[c]) lpx=xCoord(x[c-1])
lpy=yCoord(x[c-1])
;***************condition for last point*****************
if((b==2)
then
if((fpx==lpx) then fpx=fpx+((width+sp)*a) fpy=fpy y[a
+1]=tconc(y[a+1] fpx:fpy)
else fpx=fpx fpy=fpy+((width+sp)*a) y[a+1]=tconc(y[a+1]
fpx:fpy)
)
else
laspx=xCoord(x[c-2]) laspy=yCoord(x[c-2])
if((laspx==lpx)&&(laspy<lpy)&&(lpx>fpx) then fpx=fpx
fpy=fpy-((width+sp)*a) y[a+1]=tconc(y[a+1] fpx:fpy))
if((laspx==lpx)&&(laspy<lpy)&&(fpx>lpx) then fpx=fpx
fpy=fpy+((width+sp)*a) y[a+1]=tconc(y[a+1] fpx:fpy))
if((laspx==lpx)&&(laspy>lpy)&&(lpx>fpx) then fpx=fpx
fpy=fpy-((width+sp)*a) y[a+1]=tconc(y[a+1] fpx:fpy))
if((laspx==lpx)&&(laspy>lpy)&&(lpx<fpx) then fpx=fpx
fpy=fpy+((width+sp)*a) y[a+1]=tconc(y[a+1] fpx:fpy))
if((laspy==lpy)&&(laspx<lpx)&&(lpy<fpy) then fpx=fpx-
((width+sp)*a) fpy=fpy y[a+1]=tconc(y[a+1] fpx:fpy))
if((laspy==lpy)&&(laspx<lpx)&&(lpy>fpy) then fpx=fpx+
((width+sp)*a) fpy=fpy y[a+1]=tconc(y[a+1] fpx:fpy))
if((laspy==lpy)&&(laspx>lpx)&&(fpy>lpy) then fpx=fpx-
((width+sp)*a) fpy=fpy y[a+1]=tconc(y[a+1] fpx:fpy))
if((laspy==lpy)&&(laspx>lpx)&&(fpy<lpy) then fpx=fpx+
((width+sp)*a) fpy=fpy y[a+1]=tconc(y[a+1] fpx:fpy))
)
;**************end of condition for last point***********
else
fpx=xCoord(x[c]) fpy=yCoord(x[c]) lpx=xCoord(x[c+1])
lpy=yCoord(x[c+1]) firpx=xCoord(x[c-1]) firpy=yCoord(x[c-1])
;**************conditions for between points*************
if((fpx==firpx)&&(firpy<fpy)&&(fpy==lpy)&&(fpx>lpx) then
fpx=fpx-((width+sp)*a) fpy=fpy-((width+sp)*a) tconc(y[a+1] fpx:fpy))
if((fpx==firpx)&&(firpy<fpy)&&(fpy==lpy)&&(fpx<lpx) then
fpx=fpx-((width+sp)*a) fpy=fpy+((width+sp)*a) tconc(y[a+1] fpx:fpy))
if((fpx==firpx)&&(firpy>fpy)&&(fpy==lpy)&&(fpx>lpx) then
fpx=fpx+((width+sp)*a) fpy=fpy-((width+sp)*a) tconc(y[a+1] fpx:fpy))
if((fpx==firpx)&&(firpy>fpy)&&(fpy==lpy)&&(fpx<lpx) then
fpx=fpx+((width+sp)*a) fpy=fpy+((width+sp)*a) tconc(y[a+1] fpx:fpy))
if((fpy==firpy)&&(firpx<fpx)&&(fpx==lpx)&&(fpy<lpy) then
fpx=fpx-((width+sp)*a) fpy=fpy+((width+sp)*a) tconc(y[a+1] fpx:fpy))
if((fpy==firpy)&&(firpx<fpx)&&(fpx==lpx)&&(fpy>lpy) then
fpx=fpx+((width+sp)*a) fpy=fpy+((width+sp)*a) tconc(y[a+1] fpx:fpy))
if((fpy==firpy)&&(firpx>fpx)&&(fpx==lpx)&&(fpy<lpy) then
fpx=fpx-((width+sp)*a) fpy=fpy-((width+sp)*a) tconc(y[a+1] fpx:fpy))
if((fpy==firpy)&&(firpx>fpx)&&(fpx==lpx)&&(fpy>lpy) then
fpx=fpx+((width+sp)*a) fpy=fpy-((width+sp)*a) tconc(y[a+1] fpx:fpy))
;**********end of conditions for between points***********
)
)
;printf("%L-->%L coor\n" y[a] c)
)
y[a+1]=car(y[a+1])
;printf("%L\n" y[a])
)

;******************for finding via rows and columns**************
if(0.0<width && width<1.9 then viarow=2 viacol=1
else
if(eval(width-fix(width))<0.89999 then viarow=fix(width)
viacol=fix(width)
else viarow=fix(width)+1 viacol=fix(width)+1
)
) ;printf("%L rows %L columns\n" viarow viacol)

;**for drawing path with metal orientation and offset correction**
for(a 1 nop ;outer for loop
for(c 1 length(y[a])-1 ;inner for loop
coor1=nthelem(c y[a]) coor2=nthelem(c+1 y[a])
;dbCreatePath(geGetWindowCellView() list(layercb[c]->value
"drawing") list(nthelem(c y[a]) nthelem(c+1 y[a])) width)
if(xCoord(coor1)==xCoord(coor2)
then
if(yCoord(coor1)>yCoord(coor2)
then
coor1=list(xCoord(coor1) yCoord(coor1)+(width/2.0))
coor2=list(xCoord(coor2) yCoord(coor2)-(width/2.0))
else
coor1=list(xCoord(coor1) yCoord(coor1)-(width/2.0))
coor2=list(xCoord(coor2) yCoord(coor2)+(width/2.0))
)
dbCreatePath(geGetWindowCellView() list(layercb[c]->value
"drawing") list(coor1 coor2) width)
)
if(yCoord(nthelem(c y[a]))==yCoord(nthelem(c+1 y[a]))
then
if(xCoord(coor1)>xCoord(coor2)
then
coor1=list(xCoord(coor1)+(width/2.0) yCoord(coor1))
coor2=list(xCoord(coor2)-(width/2.0) yCoord(coor2))
else
coor1=list(xCoord(coor1)-(width/2.0) yCoord(coor1))
coor2=list(xCoord(coor2)+(width/2.0) yCoord(coor2))
)
dbCreatePath(geGetWindowCellView() list(layercb[c]->value
"drawing") list(coor1 coor2) width)
)
if(c!=1
then
if(layercb[c]->value != layercb[c-1]->value
then
if((layercb[c]->value=="MET1"||layercb[c-1]-
-
value=="MET2")
then viatype=list("VIA1_C")
)
if((layercb[c]->value=="MET2"||layercb[c-1]-
-
value=="MET3")
then viatype=list("VIA2_C")
)
if((layercb[c]->value=="MET1"||layercb[c-1]-
-
value=="MET3")
then viatype=list("VIA1_C" "VIA2_C")
)
;printf("%L-->via %L-->coor\n" viatype nthelem(c y[a]))
;printf("%L-->c %L-->clayer %L-->c-1layer\n" c layercb[c]-
->value)
if(0.0<width && width<1.9
then
if(yCoord(nthelem(c y[a]))>yCoord(nthelem(c+1 y[a]))
then
viacoor=list(xCoord(nthelem(c y[a]))
yCoord(nthelem(c y[a]))-abs((width/2.0)-(1.9/2.0)))
)
if(yCoord(nthelem(c y[a]))<yCoord(nthelem(c+1 y[a]))
then
viacoor=list(xCoord(nthelem(c y[a]))
yCoord(nthelem(c y[a]))+abs((width/2.0)-(1.9/2.0)))
)
if(yCoord(nthelem(c y[a]))==yCoord(nthelem(c+1 y[a]))
then
if(yCoord(nthelem(c y[a]))>yCoord(nthelem(c-1 y[a]))
then
viacoor=list(xCoord(nthelem(c y[a]))
yCoord(nthelem(c y[a]))-abs((width/2.0)-(1.9/2.0)))
else
viacoor=list(xCoord(nthelem(c y[a]))
yCoord(nthelem(c y[a]))+abs((width/2.0)-(1.9/2.0)))
)
)
foreach(via viatype
leCreateContact(geGetWindowCellView() via
viacoor "R0" 0.5 0.5 viarow viacol 0.95 0.95 "center" "center")
)
else
foreach(via viatype
leCreateContact(geGetWindowCellView() via
nthelem(c y[a]) "R0" 0.5 0.5 viarow viacol 0.95 0.95 "center"
"center")
)
)
)
;printf("via creation failed\n")
)
) ;end of inner for loop
) ;end of outer for loop
);end of let
t
);end of procedure RG_drawcusbus





; ******************************* Main Form
*******************************'




procedure(RG_menu()
addbendcb=makeTable("addbend")
layercb=makeTable("layer")
coorcb=makeTable("coor")
sepcb=makeTable("sep") textcb=makeTable("text")
generatecusbus=nil
let((coor1 coor2 spacing width num_paths seperator)
if(geGetWindowCellView()->viewName=="layout"
then
layercb[1]=hiCreateCyclicField(?name 'layer
?prompt "Type of layer"
?choices list("MET1" "MET2" "MET3")
?defValue "MET1"
)
coor1=hiCreatePointField(?name 'coorfix1
?prompt "Enter first point"
?value list(0.0 0.0)
)
coor2=hiCreatePointField(?name 'coorfix2
?prompt "Enter second point"
?value list(0.0 0.0)
)
spacing=hiCreateFloatField(?name 'spacing
?prompt "Spacing between paths"
?value 0.9
)
width=hiCreateFloatField(?name 'width
?prompt "Width of each path"
?value 0.9
)
num_paths=hiCreateIntField(?name 'num_paths
?prompt "Number of paths to be drawn"
?defValue 1
?range
1:50
)
addbendcb[1]=hiCreateBooleanButton(?name 'bend1
?buttonText "Want bend1"
?enabled nil
;?defValue nil
?callback "RG_decmenu()"
;?editable nil
)
seperator=hiCreateSeparatorField(?name 'seperator)
generatecusbus=hiCreateAppForm(?name 'generatecusbus
?formTitle "enter the paths details"
?fields list(list(spacing (0:5)
(230:20) 180)
list(width (280:5)
(170:20) 120)
list(num_paths (0:40)
(230:20) 180)
list(layercb[1] (280:40)
(170:20) 120)
list(coor1 (0:75) (230:20)
140)
list(coor2 (280:75)
(210:20) 120)
list(addbendcb[1]
(360:110) (150:20) 80)
list(seperator (1:130)
(500:0) 0)
)
?dontBlock t
?buttonLayout list('Close
list('OK
"hiFormDone(generatecusbus) RG_drawcusbus()")
list('Apply
"RG_drawcusbus()")
)
)
hiDisplayForm(generatecusbus list(400 200))
generatecusbus->coorfix1->value=enterPoint(?prompts list("Enter first
point of bus") )
generatecusbus->coorfix1->editable=nil
textcb[1]=dbCreateLabel(geGetWindowCellView() list("text" "drawing")
generatecusbus->coorfix1->value sprintf(nil "First point: %L"
generatecusbus->coorfix1->value)
"upperLeft" "R0" "stick" 6)
generatecusbus->coorfix2->value=enterPoint(?prompts list("Enter
second point of bus") )
generatecusbus->coorfix2->editable=nil
textcb[2]=dbCreateLabel(geGetWindowCellView() list("text" "drawing")
generatecusbus->coorfix2->value sprintf(nil "Second point: %L"
generatecusbus->coorfix1->value)
"upperLeft" "R0" "stick" 6)
addbendcb[1]->enabled=t
hiDeleteField(generatecusbus addbendcb[1]->hiFieldSym)
hiAddField(generatecusbus list(addbendcb[1] (360:110) (150:20) 80))
else
hiDisplayAppDBox(?name 'Errorview
?dboxBanner "Error message"
?dboxText sprintf(nil "Open a proper layout view
\n")
?help ""
)
);if
);let
);procedure

procedure(RG_decmenu()
let((countbend)
countbend=0
foreach(temp addbendcb
if(addbendcb[temp]->value==t then countbend++)
)
if(countbend==length(addbendcb)
then
RG_addtomenu()
else
foreach(temp addbendcb
if(addbendcb[temp]->value==nil then
RG_delfrmmenu(addbendcb[temp]))
)
);if
);let
);procedure RG_decmenu

procedure(RG_addtomenu()
let((countbend)
countbend=0
foreach(field generatecusbus~>fieldList
if(rexMatchp("^bend*" field)
then
countbend=countbend+1
);if
);foreach
coorcb[countbend+1]=hiCreatePointField(?name makeSymbol(strcat("coor"
sprintf(nil "%L" countbend+1)))
?prompt "Enter bend coor"
?value list(0.0 0.0)
)
layercb[countbend+1]=hiCreateCyclicField(?name
makeSymbol(strcat("layer" sprintf(nil "%L" countbend+1)))
?prompt "Layer"
?choices list("MET1" "MET2"
"MET3")
?defValue "MET1"
)
addbendcb[countbend+1]=hiCreateBooleanButton(?name
makeSymbol(strcat("bend" sprintf(nil "%L" countbend+1)))
?buttonText strcat("Want
bend" sprintf(nil "%L" countbend+1))
?enabled nil
;?defValue nil
?callback "RG_decmenu()"
)
sepcb[countbend+1]=hiCreateSeparatorField(?name
makeSymbol(strcat("sep" sprintf(nil "%L" countbend+1))))
hiAddFields(generatecusbus
list(
list(coorcb[countbend+1] (0:(countbend*35)+104)
(200:20) 110)
list(addbendcb[countbend+1] (360:(countbend*35)+110)
(150:20) 80)
list(layercb[countbend+1] (210:(countbend*35)+110)
(150:20) 50)
list(sepcb[countbend+1] (1:(countbend*35)+135) (500:0)
0)
)
)
if(countbend>=1 then
coorcb[countbend+1]->value=enterPoint(?prompts list(sprintf(nil
"Enter coordinates for bend%L" countbend)))
coorcb[countbend+1]->editable=nil
addbendcb[countbend+1]->enabled=t
textcb[countbend+2]=dbCreateLabel(geGetWindowCellView()
list("text" "drawing") coorcb[countbend+1]->value sprintf(nil "bend%L
coordinate: %L" countbend coorcb[countbend+1]->value)
"upperLeft" "R0" "stick" 6)
hiDeleteFields(generatecusbus list(coorcb[countbend+1]->hiFieldSym
addbendcb[countbend+1]-
hiFieldSym
)
)
hiAddFields(generatecusbus list(list(coorcb[countbend+1] (0:
((countbend+1)*35)+69) (200:20) 110)
list(addbendcb[countbend+1] (360:
((countbend+1)*35)+75) (150:20) 80)
)
)
)
);let
t
);procedure RG_addtomenu

procedure(RG_delfrmmenu(bendid)
let((coor1 coor2)
for(temp evalstring(substring(bendid->prompt 10))+1 length(addbendcb)
hiDeleteFields(generatecusbus
list(coorcb[temp]->hiFieldSym
addbendcb[temp]->hiFieldSym
layercb[temp]->hiFieldSym
sepcb[temp]->hiFieldSym
)
)
remove(temp coorcb) remove(temp addbendcb) remove(temp layercb)
remove(temp sepcb)
if(length(textcb)!=0
then
dbDeleteObject(textcb[temp+1]) remove(temp+1 textcb)
)
)
if(bendid->prompt=="Want bend1"
then
hiDeleteFields(generatecusbus list(generatecusbus->coorfix1-
hiFieldSym
generatecusbus->coorfix2-
hiFieldSym
addbendcb[1]->hiFieldSym
)
)
if(length(textcb)!=0
then
foreach(temp textcb dbDeleteObject(textcb[temp]) remove(temp
textcb))
)
coor1=hiCreatePointField(?name 'coorfix1
?prompt "Enter first point"
?value list(0.0 0.0)
)
coor2=hiCreatePointField(?name 'coorfix2
?prompt "Enter second point"
?value list(0.0 0.0)
)
addbendcb[1]=hiCreateBooleanButton(?name 'bend1
?buttonText "Want bend1"
?enabled nil
;?defValue nil
?callback "RG_decmenu()"
;?editable nil
)
hiAddFields(generatecusbus list(list(coor1 (0:75) (230:20) 140)
list(coor2 (280:75) (210:20) 120)
list(addbendcb[1] (360:110) (150:20)
80)
)
)
generatecusbus->coorfix1->value=enterPoint(?prompts list("Enter
first point of bus") )
generatecusbus->coorfix1->editable=nil
textcb[1]=dbCreateLabel(geGetWindowCellView() list("text" "drawing")
generatecusbus->coorfix1->value sprintf(nil "First point: %L"
generatecusbus->coorfix1->value)
"upperLeft" "R0" "stick" 6)
generatecusbus->coorfix2->value=enterPoint(?prompts list("Enter
second point of bus") )
generatecusbus->coorfix2->editable=nil
textcb[2]=dbCreateLabel(geGetWindowCellView() list("text" "drawing")
generatecusbus->coorfix2->value sprintf(nil "Second point: %L"
generatecusbus->coorfix1->value)
"upperLeft" "R0" "stick" 6)
addbendcb[1]->enabled=t
hiDeleteField(generatecusbus addbendcb[1]->hiFieldSym)
hiAddField(generatecusbus list(addbendcb[1] (360:110) (150:20) 80))
)
);let
t
);procedure RG_delfrmmenu


; Automatically opens the Main form
RG_menu()


;********************************************Ends Here
****************************************
 

Welcome to EDABoard.com

Sponsor

Back
Top