%include "ilap_inc" %externalroutine stack(%string(31) name,%integer bits,words, %integername controlx,controly,pushcony,popcony, phi1x,phi2x,phi3x,phi4x,%integerarrayname pushy,popy) %routinespec stackcellcon(%integer offset) %routinespec controlcon %routinespec positioncell(%string(13) cell,ground, %integer cellypitch,cellxpitch,gndypitch, %integer %name xcur,ycur) %integer stackcellxpitch,stackcellypitch,conypitch,stackcellgndypitch %integer i,j,curx,cury,stackcellpushy,stackcellpopy,controlypitch %integer stackcellaxpitch, stackx, stacky %if symbol exists("stackcell")=true %then ->gen symbol("stackcell") %if Buried contacts = true %start layer(poly) box(15,4,17,8) ; box(41,21,43,25) pdbw(16,3) ; pdbe(42,26) %finish %else %start pdms(15,5) ; pdmn(43,24) %finish layer(metal) dm(16,23) ; pm(16,18) pm(42,11) ; dm(42,6) box(0,0,4,28) ; box(7,0,10,28) ; box(21,0,24,28) box(27,0,31,28) ; box(34,0,37,28) ; box(48,0,51,28) box(54,0,58,28) ; box(14,20,18,21) ; box(40,8,44,9) layer(diffusion) box(0,2,18,4) ; box(24,2,45,4) ; box(51,2,58,4) box(0,25,7,27) ; box(13,25,34,27) ; box(40,25,58,27) box(9,4,11,10) ; box(20,10,27,12) box(47,19,49,25) box(31,17,38,19) etpy("lpd",6,8,6) dtdx("lpu",12,10,6) etdx("trr",20,2,2) etdx("shr",9,25,2) etpy("rpd",50,15,6) dtdx("rpu",40,17,6) etdx("trl",36,25,2) etdx("shl",47,2,2) layer(poly) box(6,16,14,18) ; box(44,11,52,13) dm(2,11) ; dm(29,11) ; dm(29,18) ; dm(56,18) pm(9,22) ; pm(22,7) ; pm(36,22) ; pm(49,7) endsymbol symbol("stackcellnull") layer(metal) box(0,0,4,28) ; box(27,0,31,28) ; box(54,0,58,28) layer(diffusion) box(0,2,58,4) ; box(0,25,58,27) endsymbol symbol("stackcellgnd") layer(metal) box(0,0,58,4) ; box(27,4,31,8) endsymbol symbol("stackcontrolleft") %if Buried contacts = true %start layer(diffusion) pdbw(52,37) box(45,35,47,48) ; box(47,36,49,38) %finish %else %start layer(diffusion) pdmw(48,36) ; box(45,38,47,48) layer(poly) box(51,35,53,38) %finish etpy("pdr3",47,25,4) etpy("pdr4",51,25,4) etpy("pdl1",5,2,4) ; dx(10) ; dy(2) etpy("pdr1",51,2,4) ; dx(-10) ; dy(2) dtpy("pul1",21,1,4) dtpy("pur1",35,1,4) etpy("pdl2",15,11,4) etpy("pdr2",41,11,4) dtdy("pul2",22,16,4) dtdy("pur2",34,16,4) etpy("pdl3",5,27,2) dtdx("pul3",18,27,8) dtdx("pur3",32,27,8) etpx("pul4",9,35,8) etpy("pul5",24,41,4) etpy("psr",42,35,2) layer(poly) box(15,17,17,20) ; box(41,17,43,20) box(24,6,28,10) ; box(30,6,34,10) box(26,10,28,18) ; box(30,10,32,18) box(17,22,20,24) ; box(38,22,41,24) box(18,24,20,25) ; box(38,24,40,25) box(1,31,7,33) ; box(1,33,3,44) box(3,42,11,44) ; box(9,44,11,48) box(42,39,44,48) box(24,47,26,48) box(42,30,49,32) ; box(42,32,44,33) box(51,31,53,35) layer(diffusion) box(25,1,27,5) ; box(31,1,33,5) box(4,11,13,15) box(45,11,54,15) box(22,21,27,23) ; box(31,21,36,23) box(9,27,13,29) ; box(13,29,17,33) box(13,39,17,45) ; box(24,35,40,37) box(17,41,22,45) box(27,24,31,25) box(19,11,20,15) ; box(38,11,39,15) layer(metal) box(0,0,4,45) ; box(27,0,31,29) box(4,41,56,45) dm(29,27) ; dm(2,27) ; dm(29,43) dm(29,22) ; dm(2,5) ; dm(29,3) ; dm(2,13) pm(20,36) ; dm(25,36) dm(22,13) ; dm(36,13) ; pm(22,8) ; pm(36,8) dm(15,27) ; pm(15,22) ; dm(43,27) ; pm(43,22) box(20,10,24,11) ; box(34,10,38,11) box(13,24,17,25) ; box(41,24,45,25) box(22,34,23,38) endsymbol symbol("stackcontrolgnd") dm(2,27) layer(metal) box(0,0,4,41) dm(2,5) ; dm(2,13) endsymbol symbol("stackcontroltop") layer(poly) box(9,0,11,6) ; box(24,0,26,6) ; box(42,0,44,12) box(68,0,70,12) ; box(86,0,88,6) layer(metal) pm(10,8) ; box(8,10,12,24) pm(25,8) ; box(27,6,85,9) ; pm(87,8) ; box(85,10,89,24) pm(42,14) ; box(44,12,68,15) ; pm(70,14) ; box(68,16,72,24) pm(102,2) ; box(16,0,100,3) ; box(16,3,20,24) layer(diffusion) box(45,0,47,19) ; box(0,17,45,19) box(65,0,67,24) ; box(0,22,65,24) endsymbol symbol("stackcontrol") layer(diffusion) box(17,0,19,3) ; box(71,0,73,3) dm(42,2) ; dm(96,2) draw("stackcontrolleft",0,0) draw("stackcontrolgnd",54,0) drawmx("stackcontrolleft",112,0) draw("stackcontroltop",0,48) endsymbol symbol("stackcontrolcon1") controlcon stackcellcon(0) layer(diffusion) box(11,3,41,5) ; box(17,9,20,12) box(38,15,88,17) ; dm(90,16) ; box(51,21,73,23) endsymbol symbol("stackcontrolcon2") controlcon stackcellcon(0) stackcellcon(54) layer(diffusion) box(11,3,61,5) ; box(17,9,20,12) ; box(24,9,74,11) box(38,15,88,17) ; box(51,21,101,23) endsymbol symbol("stackcontrolconn") controlcon stackcellcon(0) stackcellcon(54) layer(diffusion) box(11,3,112,5) ; box(17,9,20,12) ; box(24,9,112,11) box(38,15,112,17) ; box(51,21,112,23) endsymbol symbol("stackcellcon") stackcellcon(0) layer(diffusion) box(0,3,58,5) ; box(0,9,58,11) box(0,15,58,17) ; box(0,21,58,23) layer(metal) box(4,30,54,34) ; box(54,0,58,34) endsymbol symbol("stackcellconlast") stackcellcon(0) layer(diffusion) box(0,3,7,5) ; box(0,9,20,11) box(0,15,34,17) ; box(0,21,47,23) layer(metal) box(4,30,54,34) ; box(54,0,58,34) endsymbol gen:! all symbols defined stackcellpushy=25 stackcellpopy=2 stackcellxpitch=54 stackcellaxpitch=48 stackcellypitch=28 stackcellgndypitch=8 conypitch=26 controlypitch=72 symbol(name) curx=0 %for i = 1,1,words %cycle positioncell("stackcell","stackcellgnd",stackcellypitch, stackcellxpitch,stackcellgndypitch,curx,cury) %repeat %if words=1 %then %start draw("stackcellgnd",curx,0) cury=stackcellgndypitch %for j=1,1,bits %cycle draw("stackcellnull",curx,cury) cury=cury+stackcellypitch %repeat curx=curx+stackcellxpitch draw("stackcontrolcon1",0,cury) %finish %else %c %if words=2 %then draw("stackcontrolcon2",0,cury) %else %start draw("stackcontrolconn",0,cury) curx=2*stackcellxpitch %for i=3,1,words-1 %cycle draw("stackcellcon",curx,cury) curx=curx+stackcellxpitch %repeat draw("stackcellconlast",curx,cury) curx=curx+stackcellxpitch %finish cury=cury+conypitch draw("stackcontrol",0,cury) endsymbol stackx=curx+4 stacky=cury+controlypitch controlx=2*stackcellxpitch+4 controly=controlypitch-8 pushcony=stacky-7 popcony=stacky-2 phi1x=8 phi2x=16 phi3x=68 phi4x=85 cury=stackcellgndypitch %for i=1,1,bits %cycle pushy(i)=cury+stackcellpushy popy(i)=cury+stackcellpopy cury=cury+stackcellypitch %repeat %return !------------------------------------------------------------------------------- %routine stackcellcon(%integer offset) layer(metal) box(offset+7,0,offset+10,2) ; dm(offset+9,4) box(offset+21,0,offset+24,8) ; dm(offset+22,10) box(offset+34,0,offset+37,14) ; dm(offset+36,16) box(offset+48,0,offset+51,20) ; dm(offset+49,22) %end !------------------------------------------------------------------------------- %routine controlcon layer(metal) box(0,0,4,26) box(27,0,31,26) ; box(54,0,58,26) box(81,0,85,26) ; box(108,0,112,26) dm(43,4) ; box(41,6,44,26) box(92,15,95,18) ; box(95,15,98,26) layer(diffusion) box(17,11,19,26) ; box(71,23,73,26) %end !------------------------------------------------------------------------------- %routine positioncell(%string(13) cell,ground, %integer cellypitch,cellxpitch,gndypitch, %integer %name xcur,ycur) %integer j draw(ground,xcur,0) ycur = gndypitch %for j = 1,1,bits %cycle draw(cell,xcur,ycur) ycur = ycur + cellypitch %repeat xcur = xcur + cellxpitch %end %end %endoffile