/** * Method to call a series of routines which convert the hierarchical network description into a * flattened database representation. The actual simulation must take place on the flattened * network. Returns true on error. */ boolean flattenNetwork(Cell cell) { /* * create a "dummy" level to use as a mixed signal destination for plotting and * screen display. This level should be bypassed for structure checking and general * simulation, however, so in the following code, references to "als.cellRoot" * have been changed to als.cellRoot.next (pointing to mainCell). * Peter Gallant July 16, 1990 */ als.cellRoot = new ALS.Connect(); als.cellRoot.instName = "[MIXED_SIGNAL_LEVEL]"; als.cellRoot.modelName = als.cellRoot.instName; als.cellRoot.exList = new ArrayList<ALS.ALSExport>(); als.cellRoot.parent = null; als.cellRoot.child = null; als.cellRoot.next = null; ALS.Connect tempRoot = als.cellRoot; // get upper-case version of main proto String mainName = cell.getName().toUpperCase(); als.cellRoot = new ALS.Connect(); als.cellRoot.instName = mainName; als.cellRoot.modelName = als.cellRoot.instName; als.cellRoot.exList = new ArrayList<ALS.ALSExport>(); als.cellRoot.parent = null; als.cellRoot.child = null; als.cellRoot.next = null; // these lines link the mixed level as the head followed by mainCell PJG tempRoot.next = als.cellRoot; // shouldn't this be null? ... smr tempRoot.child = als.cellRoot; als.cellRoot = tempRoot; // this code checks to see if model mainCell is present in the netlist PJG ALS.Model modHead = findModel(mainName); if (modHead == null) return true; for (ALS.ALSExport exHead : modHead.exList) { findXRefEntry(als.cellRoot.next, (String) exHead.nodeName); } if (flattenModel(als.cellRoot.next)) return true; for (ALS.Node nodeHead : als.nodeList) { if (nodeHead.load < 1) nodeHead.load = 1; } return false; }
/** Method to parse the arc cell in "np" and return an ArcInfo object that describes it. */ static ArcInfo parseCell(Cell np) { // create and initialize the GRAPHICS structure ArcInfo aIn = new ArcInfo(); aIn.name = np.getName().substring(4); // look at all nodes in the arc description cell for (Iterator<NodeInst> it = np.getNodes(); it.hasNext(); ) { NodeInst ni = it.next(); Variable var = ni.getVar(OPTION_KEY); if (var == null) continue; String str = getValueOnNode(ni); switch (((Integer) var.getObject()).intValue()) { case ARCFUNCTION: aIn.func = ArcProto.Function.UNKNOWN; List<ArcProto.Function> allFuncs = ArcProto.Function.getFunctions(); for (ArcProto.Function fun : allFuncs) { if (fun.toString().equalsIgnoreCase(str)) { aIn.func = fun; break; } } break; case ARCINC: aIn.angInc = TextUtils.atoi(str); break; case ARCFIXANG: aIn.fixAng = str.equalsIgnoreCase("yes"); break; case ARCWIPESPINS: aIn.wipes = str.equalsIgnoreCase("yes"); break; case ARCNOEXTEND: aIn.noExtend = str.equalsIgnoreCase("no"); break; case ARCANTENNARATIO: aIn.antennaRatio = TextUtils.atof(str); break; case ARCWIDTHOFFSET: aIn.widthOffset = TextUtils.atof(str); break; } } return aIn; }