⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maker.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
						} else						{							pList.ports = powerPort;						}						if (nextPort != null)						{							nextPort.last = powerPort;						}					}					// add ground ports					for (GetNetlist.SCNiPort iPort = place.cell.ground; iPort != null; iPort = iPort.next)					{						MakerPowerPort powerPort = new MakerPowerPort();						powerPort.inst = mInst;						powerPort.port = iPort;						if ((mRow.number % 2) != 0)						{							powerPort.xPos = mInst.xPos + mInst.xSize - iPort.xPos;						} else						{							powerPort.xPos = mInst.xPos + iPort.xPos;						}						powerPort.next = null;						powerPort.last = null;						double portYPos = mInst.yPos + SilComp.leafPortYPos((Export)iPort.port);						MakerPower pList;						for (pList = data.ground; pList != null; pList = pList.next)						{							if (pList.yPos == portYPos) break;						}						if (pList == null)						{							pList = new MakerPower();							pList.ports = null;							pList.yPos = portYPos;							MakerPower lastPList = null;							MakerPower nextPList;							for (nextPList = data.ground; nextPList != null; nextPList = nextPList.next)							{								if (portYPos < nextPList.yPos) break;								lastPList = nextPList;							}							pList.next = nextPList;							pList.last = lastPList;							if (lastPList != null)							{								lastPList.next = pList;							} else							{								data.ground = pList;							}							if (nextPList != null)							{								nextPList.last = pList;							}						}						MakerPowerPort lastPort = null;						MakerPowerPort nextPort;						for (nextPort = pList.ports; nextPort != null; nextPort = nextPort.next)						{							if (powerPort.xPos < nextPort.xPos) break;							lastPort = nextPort;						}						powerPort.next = nextPort;						powerPort.last = lastPort;						if (lastPort != null)						{							lastPort.next = powerPort;						} else						{							pList.ports = powerPort;						}						if (nextPort != null)						{							nextPort.last = powerPort;						}					}				} else if (place.cell.type == GetNetlist.FEEDCELL)				{					mInst.ySize = bOffset;				} else if (place.cell.type == GetNetlist.LATERALFEED)				{					Route.RoutePort rPort = (Route.RoutePort)place.cell.ports.port;					mInst.ySize = SilComp.leafPortYPos((Export)rPort.port.port);				} else				{					System.out.println("ERROR - unknown cell type in maker set up");					mInst.ySize = 0;				}				mInst.instance = null;				mInst.flags = 0;				place.cell.tp = mInst;				mInst.next = null;				if (lastMInst != null)				{					lastMInst.next = mInst;				} else				{					mRow.members = mInst;				}				lastMInst = mInst;				// set limits of row				mRow.minX = Math.min(mRow.minX, mInst.xPos);				mRow.maxX = Math.max(mRow.maxX, mInst.xPos + mInst.xSize);				mRow.minY = Math.min(mRow.minY, mInst.yPos);				mRow.maxY = Math.max(mRow.maxY, mInst.yPos + mInst.ySize);			}			data.minX = Math.min(data.minX, mRow.minX);			data.maxX = Math.max(data.maxX, mRow.maxX);			data.minY = Math.min(data.minY, mRow.minY);			data.maxY = Math.max(data.maxY, mRow.maxY);			yPos += tOffset;			mChan = mChan.next;			mChan.minY = yPos;			yPos += mChan.ySize;		}		// create via list for all tracks		for (mChan = data.channels; mChan != null; mChan = mChan.next)		{			// get bottom track and work up			MakerTrack mTrack;			for (mTrack = mChan.tracks; mTrack != null; mTrack = mTrack.next)			{				if (mTrack.next == null) break;			}			for ( ; mTrack != null; mTrack = mTrack.last)			{				yPos = mChan.minY + (mChan.ySize - mTrack.yPos);				mTrack.yPos = yPos;				for (Route.RouteTrackMem mem = mTrack.track.nodes; mem != null; mem = mem.next)				{					MakerNode mNode = new MakerNode();					mNode.vias = null;					mNode.next = mTrack.nodes;					mTrack.nodes = mNode;					MakerVia lastVia = null;					for (Route.RouteChPort chPort = mem.node.firstPort; chPort != null; chPort = chPort.next)					{						MakerVia mVia = new MakerVia();						mVia.xPos = chPort.xPos;						mVia.chPort = chPort;						mVia.instance = null;						mVia.flags = 0;						mVia.xPort = null;						mVia.next = null;						if (lastVia != null)						{							lastVia.next = mVia;						} else						{							mNode.vias = mVia;						}						lastVia = mVia;						// check for power port						if (mVia.chPort.port.place.cell.type == GetNetlist.LEAFCELL)						{							int type = GetNetlist.getLeafPortType((Export)mVia.chPort.port.port.port);							if (type == GetNetlist.PWRPORT || type == GetNetlist.GNDPORT)								mVia.flags |= VIAPOWER;						}						// check for export						for (Route.RouteExport xPort = data.cell.route.exports; xPort != null; xPort = xPort.next)						{							if (xPort.chPort == mVia.chPort)							{								mVia.flags |= VIAEXPORT;								mVia.xPort = xPort;								break;							}						}						data.minX = Math.min(data.minX, chPort.xPos);						data.maxX = Math.max(data.maxX, chPort.xPos);						data.minY = Math.min(data.minY, chPort.xPos);						data.maxY = Math.max(data.maxY, chPort.xPos);					}				}			}		}		return data;	}	/**	 * Method to create the actual layout in the associated VLSI layout tool using	 * the passed layout data.     * @param destLib destination library.	 * @param data pointer to layout data.	 */	private Object createLayout(Library destLib, MakerData data)	{		double rowToTrack = (SilComp.getViaSize() / 2) + SilComp.getMinMetalSpacing();		double trackToTtrack = SilComp.getViaSize() + SilComp.getMinMetalSpacing();		String err = setupForMaker();		if (err != null) return err;		// create new cell		Cell bCell = Cell.makeInstance(destLib, data.cell.name + "{lay}");		if (bCell == null) return "Cannot create leaf cell '" + data.cell.name + "{lay}' in MAKER";		// create instances for cell		for (MakerRow row = data.rows; row != null; row = row.next)		{			boolean flipX = false;			if ((row.number % 2) != 0) flipX = true;			for (MakerInst inst = row.members; inst != null; inst = inst.next)			{				GetNetlist.SCNiTree node = inst.place.cell;				if (node.type == GetNetlist.LEAFCELL)				{					Cell subCell = (Cell)node.np;					Rectangle2D bounds = subCell.getBounds();                    Orientation orient = Orientation.IDENT;//					double wid = inst.xSize;					double hEdge = -bounds.getMinX();					if (flipX)					{                        orient = Orientation.X;//						wid = -wid;						hEdge = bounds.getMaxX();					}					Point2D ctr = new Point2D.Double(inst.xPos + hEdge, inst.yPos - bounds.getMinY());					inst.instance = NodeInst.makeInstance(subCell, ctr, inst.xSize, inst.ySize, bCell, orient, node.name, 0);//					inst.instance = NodeInst.makeInstance(subCell, ctr, wid, inst.ySize, bCell, 0, node.name, 0);					if (inst.instance == null)						return "Cannot create leaf instance '" + node.name+ "' in MAKER";				} else if (node.type == GetNetlist.FEEDCELL)				{					// feed through node					Point2D ctr = new Point2D.Double(inst.xPos + (inst.xSize / 2), inst.yPos + inst.ySize + SilComp.getVertArcWidth() / 2);					inst.instance = NodeInst.makeInstance(layer2Proto, ctr, SilComp.getVertArcWidth(), SilComp.getVertArcWidth(), bCell);					if (inst.instance == null)						return "Cannot create leaf feed in MAKER";				} else if (node.type == GetNetlist.LATERALFEED)				{					// lateral feed node					Point2D ctr = new Point2D.Double(inst.xPos + (inst.xSize / 2), inst.yPos + inst.ySize);					inst.instance = NodeInst.makeInstance(viaProto, ctr, viaProto.getDefWidth(), viaProto.getDefHeight(), bCell);					if (inst.instance == null)						return "Cannot create via in MAKER";				}			}		}		// create vias and vertical tracks		for (MakerChannel chan = data.channels; chan != null; chan = chan.next)		{			for (MakerTrack track = chan.tracks; track != null; track = track.next)			{				for (MakerNode mNode = track.nodes; mNode != null; mNode = mNode.next)				{					for (MakerVia via = mNode.vias; via != null; via = via.next)					{						if ((via.flags & VIAPOWER) != 0)						{							via.instance = NodeInst.makeInstance(layer1Proto, new Point2D.Double(via.xPos, track.yPos),								SilComp.getHorizArcWidth(), SilComp.getHorizArcWidth(), bCell);							if (via.instance == null)								return "Cannot create via in MAKER";							// create vertical power track							MakerInst inst = (MakerInst)via.chPort.port.place.cell.tp;							if (trackLayer1(inst.instance, (PortProto)via.chPort.port.port.port,								via.instance, null, SilComp.getHorizArcWidth(), bCell) == null)							{								return "Cannot create layer2 track in MAKER";							}							continue;						}						// create a via if next via (if it exists) is farther						// than the track to track spacing, else create a layer2 node						if (via.next != null && (via.next.flags & VIAPOWER) == 0)						{							if (Math.abs(via.next.xPos - via.xPos) < trackToTtrack)							{								if ((via.flags & VIAEXPORT) != 0)								{									via.next.flags |= VIASPECIAL;								} else								{									via.flags |= VIASPECIAL;								}							}						}						if ((via.flags & VIASPECIAL) != 0)						{							via.instance = NodeInst.makeInstance(layer2Proto, new Point2D.Double(via.xPos, track.yPos),								SilComp.getVertArcWidth(), SilComp.getVertArcWidth(), bCell);							if (via.instance == null)								return "Cannot create leaf feed in MAKER";						} else						{							via.instance = NodeInst.makeInstance(viaProto, new Point2D.Double(via.xPos, track.yPos),								viaProto.getDefWidth(), viaProto.getDefHeight(), bCell);							if (via.instance == null)								return "Cannot create via in MAKER";						}						// create vertical track						GetNetlist.SCNiTree node = via.chPort.port.place.cell;						if (node.type == GetNetlist.LEAFCELL)						{							MakerInst inst = (MakerInst)node.tp;							if (trackLayer2(inst.instance, (PortProto)via.chPort.port.port.port,								via.instance, null, SilComp.getVertArcWidth(), bCell) == null)							{								return "Cannot create layer2 track in MAKER";							}						} else if (node.type == GetNetlist.FEEDCELL ||							node.type == GetNetlist.LATERALFEED)						{							MakerInst inst = (MakerInst)node.tp;							if (trackLayer2(inst.instance, null,								via.instance, null, SilComp.getVertArcWidth(), bCell) == null)							{								return "Cannot create layer2 track in MAKER";							}						}					}				}			}		}		// create horizontal tracks		for (MakerChannel chan = data.channels; chan != null; chan = chan.next)		{			for (MakerTrack track = chan.tracks; track != null; track = track.next)			{				for (MakerNode mNode = track.nodes; mNode != null; mNode = mNode.next)				{					for (MakerVia via = mNode.vias; via != null; via = via.next)					{						if (via.next != null)						{							if ((via.flags & VIASPECIAL) != 0)							{								if (Math.abs(via.next.xPos - via.xPos) < trackToTtrack)								{									if (trackLayer2(via.instance, null,										via.next.instance, null, SilComp.getVertArcWidth(), bCell) == null)									{										return "Cannot create layer1 track in MAKER";									}								}							} else							{								if ((via.flags & VIAPOWER) == 0 &&									(via.next.flags & VIAPOWER) == 0 &&									(via.next.xPos - via.xPos) < trackToTtrack)								{									if (trackLayer2(via.instance, null,										via.next.instance, null, SilComp.getVertArcWidth(), bCell) == null)									{										return "Cannot create layer1 track in MAKER";									}								}								for (MakerVia via2 = via.next; via2 != null; via2 = via2.next)								{									if ((via2.flags & VIASPECIAL) != 0) continue;									if (trackLayer1(via.instance, null, via2.instance, null,										SilComp.getHorizArcWidth(), bCell) == null)									{										return "Cannot create layer1 track in MAKER";									}									break;								}							}						}					}				}			}		}		// create stitches and lateral feeds		for(Place.RowList rlist : data.cell.placement.theRows)		{			for (Place.NBPlace place = rlist.start; place != null; place = place.next)			{				if (place.cell.type == GetNetlist.STITCH)				{					Route.RoutePort rPort = (Route.RoutePort)place.cell.ports.port;					MakerInst inst = (MakerInst)rPort.place.cell.tp;					NodeInst inst1 = inst.instance;					PortProto port1 = (PortProto)rPort.port.port;					rPort = (Route.RoutePort)place.cell.ports.next.port;					inst = (MakerInst)rPort.place.cell.tp;					NodeInst inst2 = inst.instance;					PortProto port2 = (PortProto)rPort.port.port;					if (trackLayer1(inst1, port1, inst2, port2,						SilComp.getHorizArcWidth(), bCell) == null)					{						return "Cannot create layer1 track in MAKER";					}				} else if (place.cell.type == GetNetlist.LATERALFEED)				{					Route.RoutePort rPort = (Route.RoutePort)place.cell.ports.port;					MakerInst inst = (MakerInst)rPort.place.cell.tp;					NodeInst inst1 = inst.instance;					PortProto port1 = (PortProto)rPort.port.port;					inst = (MakerInst)place.cell.tp;					NodeInst inst2 = inst.instance;					if (trackLayer1(inst1, port1, inst2, null,						SilComp.getHorizArcWidth(), bCell) == null)					{						return "Cannot create layer2 track in MAKER";					}				}			}		}		// export ports		for (MakerChannel chan = data.channels; chan != null; chan = chan.next)		{			for (MakerTrack track = chan.tracks; track != null; track = track.next)			{				for (MakerNode mNode = track.nodes; mNode != null; mNode = mNode.next)				{					for (MakerVia via = mNode.vias; via != null; via = via.next)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -