📄 romgenerator.java
字号:
apport1 = decnout[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = rompln; apport2 = rompin[i]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); } /////// connect rompgnd to invgnd if (folds > 1) { for (int i=0; i<romarray.length/folds; i++) { ap1 = invpln; apport1 = invgnd[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = rompln; apport2 = rompgnd[i*folds/2]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2,apport2,appos2[0], appos2[1]); } } else { for (int i=0; i<romarray.length/(2*folds); i++) { ap1 = invpln; apport1 = invgnd[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = rompln; apport2 = rompgnd[i]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2,apport2,appos2[0], appos2[1]); } } /////// connect top ininv1 to ininv2 for (int i=0; i<bits; i++) { ap1 = ininvtop1; apport1 = ivttop[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = ininvtop2; apport2 = ivttop[i]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); } /////// connect top ininv1 to ndecoder for (int i=0; i<bits; i++) { ap1 = ininvtop1; apport1 = ivtbot[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = pplane; apport2 = decpbit[i*2]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); ap1 = ininvtop1; apport1 = ivtbar[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = pplane; apport2 = decpbit[(i*2)+1]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); } /////// connect top ininv2 to pdecoder for (int i=0; i<bits; i++) { ap1 = ininvtop2; apport1 = ivtbot[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = nplane; apport2 = decnbit[i*2]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); ap1 = ininvtop2; apport1 = ivtbar[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = nplane; apport2 = decnbit[(i*2)+1]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); } //////// connect two top decoder inverterplanes and decoder together (vdd) ap1 = ininvtop1; apport1 = ivtvdd; appos1 = getCStylePortPosition(ap1, apport1); ap2 = ininvtop2; apport2 = ivtvdd; appos2 = getCStylePortPosition(ap2, apport2); ap3 = pplane; apport3 = decpvdd; appos3 = getCStylePortPosition(ap3, apport3); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap3, apport3, appos3[0], appos3[1]); //////// connect two top decoder inverterplanes and romplane together (gnd) ap1 = ininvtop1; apport1 = ivtgnd; appos1 = getCStylePortPosition(ap1, apport1); ap2 = ininvtop2; apport2 = ivtgnd; appos2 = getCStylePortPosition(ap2, apport2); ap3 = rompln; apport3 = rompgndc; appos3 = getCStylePortPosition(ap3, apport3); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); makeCStyleArcInst(m1arc, 4*lambda, ap2, apport2, appos2[0], appos2[1], ap3, apport3, appos3[0], appos3[1]); makeCStyleExport(rom, ap2, apport2, "gnd", PortCharacteristic.GND); //////// connect decoder inverter vdd to rom vdd ap1 = ininvtop2; apport1 = ivtvdd; appos1 = getCStylePortPosition(ap1, apport1); ap2 = rompln; apport2 = rompvdd; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); // begin (folds > 1) if (folds > 1) { decoderpmos(destLib, lambda, foldbits, dpm, bot); decodernmos(destLib, lambda, foldbits, dnm, bot); ininverterplane(destLib, lambda, foldbits, invb, bot, bits); muxplane(destLib, lambda, folds, romarray.length, mp); ////////////// decodernmosmux Cell decpmux = destLib.findNodeProto(dpm+"{lay}"); Rectangle2D decpmuxBounds = decpmux.getBounds(); PortProto[] decpmuxin = new PortProto[folds]; PortProto[] decpmuxout = new PortProto[folds]; PortProto[] decpmuxbit = new PortProto[2*foldbits]; PortProto decpmuxvdd = decpmux.findPortProto("vdd"); PortProto decpmuxvddb = decpmux.findPortProto("vddb"); for (int i=0; i<folds; i++) { decpmuxin[i] = decpmux.findPortProto("wordin"+i); decpmuxout[i] = decpmux.findPortProto("word"+i); } for (int i=0; i<foldbits; i++) { decpmuxbit[2*i] = decpmux.findPortProto("bot_in"+i); decpmuxbit[(2*i)+1] = decpmux.findPortProto("bot_in"+i+"_b"); } ////////////// decoderpmosmux Cell decnmux = destLib.findNodeProto(dnm+"{lay}"); Rectangle2D decnmuxBounds = decnmux.getBounds(); PortProto[] decnmuxout = new PortProto[folds]; PortProto[] decnmuxin = new PortProto[folds]; PortProto[] decnmuxbit = new PortProto[2*foldbits]; for (int i=0; i<folds; i++) { decnmuxin[i] = decnmux.findPortProto("mid"+i); decnmuxout[i] = decnmux.findPortProto("word"+i); } for (int i=0; i<foldbits; i++) { decnmuxbit[2*i] = decnmux.findPortProto("bot_in"+i); decnmuxbit[(2*i)+1] = decnmux.findPortProto("bot_in"+i+"_b"); } ////////////////////// muxplane Cell muxp = destLib.findNodeProto(mp+"{lay}"); Rectangle2D muxpBounds = muxp.getBounds(); PortProto[] muxin = new PortProto[romarray.length]; PortProto[] muxout = new PortProto[romarray.length/folds]; PortProto[] muxsel = new PortProto[folds]; for (int i=0; i<romarray.length; i++) { muxin[i] = muxp.findPortProto("muxin"+i); } for (int i=0; i<romarray.length/folds; i++) { muxout[i] = muxp.findPortProto("muxout"+i); } for (int i=0; i<folds; i++) { muxsel[i] = muxp.findPortProto("sel"+i); } ////////////////////// ininverterplane bottom Cell ininvbp = destLib.findNodeProto(invb+"{lay}"); Rectangle2D ininvbpBounds = ininvbp.getBounds(); PortProto[] ivbtop = new PortProto[foldbits]; PortProto[] ivbbot = new PortProto[foldbits]; PortProto[] ivbbar = new PortProto[foldbits]; PortProto ivbvdd = ininvbp.findPortProto("vdd"); PortProto ivbgnd = ininvbp.findPortProto("gnd"); for (int i=0; i<foldbits; i++) { ivbtop[i] = ininvbp.findPortProto("in_top"+i); ivbbot[i] = ininvbp.findPortProto("in_bot"+i); ivbbar[i] = ininvbp.findPortProto("in_b"+i); } NodeInst muxpln = makeCStyleNodeInst(muxp, muxpBounds.getMinX()+rompoffset, muxpBounds.getMaxX()+rompoffset, muxpBounds.getMinY()+muxpoffsety, muxpBounds.getMaxY()+muxpoffsety, 0, 2700, rom); NodeInst pplnmx = makeCStyleNodeInst(decpmux, decpmuxBounds.getMinX()+foldoffsetx, decpmuxBounds.getMaxX()+foldoffsetx, decpmuxBounds.getMinY()+muxpoffsety+foldoffsety, decpmuxBounds.getMaxY()+muxpoffsety+foldoffsety, 0, 0, rom); NodeInst nplnmx = makeCStyleNodeInst(decnmux, decnmuxBounds.getMinX()+foldoffsetx+offset, decnmuxBounds.getMaxX()+foldoffsetx+offset, decnmuxBounds.getMinY()+muxpoffsety+foldoffsety, decnmuxBounds.getMaxY()+muxpoffsety+foldoffsety, 0, 0, rom); NodeInst ininvbot1 = makeCStyleNodeInst(ininvbp,ininvbpBounds.getMinX()+foldoffsetx, ininvbpBounds.getMaxX()+foldoffsetx, ininvbpBounds.getMinY()+invpoffsety, ininvbpBounds.getMaxY()+invpoffsety, 0, 0, rom); NodeInst ininvbot2 = makeCStyleNodeInst(ininvbp, ininvbpBounds.getMinX()+foldoffsetx+offset, ininvbpBounds.getMaxX()+foldoffsetx+offset, ininvbpBounds.getMinY()+invpoffsety, ininvbpBounds.getMaxY()+invpoffsety, 0, 0, rom); for (int i=0; i<foldbits; i++) { ap1 = ininvbot1; apport1 = ivbbot[i]; makeCStyleExport(rom, ap1, apport1, "colsel"+i, PortCharacteristic.IN); } ap1 = nplane; apport1 = decn.findPortProto("gnd"); appos1 = getCStylePortPosition(ap1, apport1); ap3 = pplnmx; apport3 = decpmuxvdd; appos3 = getCStylePortPosition(ap3, apport3); ap4 = pplane; apport4 = decpvddb; appos4 = getCStylePortPosition(ap4, apport4); makeCStyleArcInst(m1arc, 4*lambda, ap4, apport4, appos4[0], appos4[1], ap3, apport3, appos3[0], appos3[1]); ap3 = nplnmx; apport3 = decnmux.findPortProto("gnd"); appos3 = getCStylePortPosition(ap3, apport3); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap3, apport3, appos3[0], appos3[1]); // decnmuxout, decpmuxin for (int i=0; i<folds; i++) { ap1 = pplnmx; apport1 = decpmuxout[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = nplnmx; apport2 = decnmuxin[i]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1,appos1[0], appos1[1],ap2,apport2,appos2[0], appos2[1]); } for (int i=0; i<folds; i++) { ap1 = nplnmx; apport1 = decnmuxout[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = muxpln; apport2 = muxsel[i]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1,appos1[0], appos1[1],ap2,apport2,appos2[0], appos2[1]); } ///////connect rompout to muxin for (int i=0; i<romarray.length; i++) { ap1 = rompln; apport1 = rompout[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = muxpln; apport2 = muxin[i]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1,appos1[0], appos1[1],ap2,apport2,appos2[0], appos2[1]); } /////// connect muxout to invin for (int i=0; i<romarray.length/folds; i++) { ap1 = invpln; apport1 = invin[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = muxpln; apport2 = muxout[i]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1,appos1[0], appos1[1],ap2,apport2,appos2[0], appos2[1]); } /////// connect bot ininv1 to ininv2 for (int i=0; i<foldbits; i++) { ap1 = ininvbot1; apport1 = ivbbot[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = ininvbot2; apport2 = ivbbot[i]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1,appos1[0], appos1[1],ap2,apport2,appos2[0], appos2[1]); } /////// connect bot ininv1 to nmuxdecoder for (int i=0; i<foldbits; i++) { ap1 = ininvbot1; apport1 = ivbtop[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = pplnmx; apport2 = decpmuxbit[i*2]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); ap1 = ininvbot1; apport1 = ivbbar[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = pplnmx; apport2 = decpmuxbit[(i*2)+1]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); } /////// connect bot ininv2 to pmuxdecoder for (int i=0; i<foldbits; i++) { ap1 = ininvbot2; apport1 = ivbtop[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = nplnmx; apport2 = decnmuxbit[i*2]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); ap1 = ininvbot2; apport1 = ivbbar[i]; appos1 = getCStylePortPosition(ap1, apport1); ap2 = nplnmx; apport2 = decnmuxbit[(i*2)+1]; appos2 = getCStylePortPosition(ap2, apport2); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); } //////// connect two mux decoder inverterplanes and mux decoder together (vdd) ap1 = ininvbot1; apport1 = ivbvdd; appos1 = getCStylePortPosition(ap1, apport1); ap2 = ininvbot2; apport2 = ivbvdd; appos2 = getCStylePortPosition(ap2, apport2); ap3 = pplnmx; apport3 = decpmuxvddb; appos3 = getCStylePortPosition(ap3, apport3); makeCStyleArcInst(m2arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap2, apport2, appos2[0], appos2[1]); makeCStyleArcInst(m1arc, 4*lambda, ap1, apport1, appos1[0], appos1[1], ap3, apport3, appos3[0], appos3[1]); //////// connect two mux decoder inverterplanes and inverterplane together (gnd) ap1 = ininvbot1; apport1 = ivbgnd; appos1 = getCStylePortPosition(ap1, apport1); ap2 = ininvbot2; apport2 = ivbgnd; appos2 = getCStylePortPosition(ap2, apport2); ap3 = invpln; apport3 = invgndc;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -