📄 silcomp.java
字号:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: SilComp.java * Silicon compiler tool (QUISC): control * Written by Andrew R. Kostiuk, Queen's University. * Translated to Java by Steven M. Rubin, Sun Microsystems. * * Copyright (c) 2005 Sun Microsystems and Static Free Software * * Electric(tm) is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Electric(tm) is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Electric(tm); see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, Mass 02111-1307, USA. */package com.sun.electric.tool.sc;import com.sun.electric.database.geometry.Poly;import com.sun.electric.database.hierarchy.Cell;import com.sun.electric.database.hierarchy.Export;import com.sun.electric.database.text.Pref;import com.sun.electric.tool.Tool;import java.awt.geom.Rectangle2D;/** * This is the Silicon Compiler tool. */public class SilComp extends Tool{ /** the Silicon Compiler tool. */ private static SilComp tool = new SilComp(); public static final String SCLIBNAME = "sclib"; /****************************** TOOL INTERFACE ******************************/ /** * The constructor sets up the Silicon Compiler tool. */ private SilComp() { super("sc"); } /** * Method to initialize the Silicon Compiler tool. */ public void init() { } /** * Method to retrieve the singleton associated with the Silicon Compiler tool. * @return the SilComp tool. */ public static SilComp getSilCompTool() { return tool; } static double leafCellXSize(Cell cell) { Rectangle2D bounds = cell.getBounds(); return bounds.getWidth(); } static double leafCellYSize(Cell cell) { Rectangle2D bounds = cell.getBounds(); return bounds.getHeight(); } /** * Method to return the xpos of the indicated leaf port from the left side of it's parent leaf cell. * @param port the leaf port. * @return position from left side of cell. */ static double leafPortXPos(Export port) { if (port == null) return 0; Poly poly = port.getOriginalPort().getPoly(); Rectangle2D bounds = port.getParent().getBounds(); return poly.getCenterX() - bounds.getMinX(); } /** * Method to return the xpos of the indicated leaf port from the bottom side of it's parent leaf cell. * @param port the leaf port. * @return position from bottom side of cell. */ static double leafPortYPos(Export port) { if (port == null) return 0; Poly poly = port.getOriginalPort().getPoly(); Rectangle2D bounds = port.getParent().getBounds(); return poly.getCenterY() - bounds.getMinY(); } /****************************** OPTIONS ******************************/ private static Pref cacheNumberOfRows = Pref.makeIntPref("NumberOfRows", tool.prefs, 4); /** * Method to return the number of rows of cells to make. * The default is 4. * @return the number of rows of cells to make. */ public static int getNumberOfRows() { return cacheNumberOfRows.getInt(); } /** * Method to set the number of rows of cells to make. * @param rows the new number of rows of cells to make. */ public static void setNumberOfRows(int rows) { cacheNumberOfRows.setInt(rows); } /** * Method to return the number of rows of cells to make, by default. * @return the number of rows of cells to make, by default. */ public static int getFactoryNumberOfRows() { return cacheNumberOfRows.getIntFactoryValue(); } private static Pref cacheHorizRoutingArc = Pref.makeStringPref("HorizRoutingArc", tool.prefs, "Metal-1"); /** * Method to return the horizontal routing arc. * The default is "Metal-1". * @return the name of the horizontal routing arc. */ public static String getHorizRoutingArc() { return cacheHorizRoutingArc.getString(); } /** * Method to set the horizontal routing arc. * @param arcName name of new horizontal routing arc. */ public static void setHorizRoutingArc(String arcName) { cacheHorizRoutingArc.setString(arcName); } /** * Method to return the horizontal routing arc, by default. * @return the name of the horizontal routing arc, by default. */ public static String getFactoryHorizRoutingArc() { return cacheHorizRoutingArc.getStringFactoryValue(); } private static Pref cacheHorizRoutingWidth = Pref.makeDoublePref("HorizArcWidth", tool.prefs, 4); /** * Method to return the width of the horizontal routing arc. * The default is 4. * @return the width of the horizontal routing arc. */ public static double getHorizArcWidth() { return cacheHorizRoutingWidth.getDouble(); } /** * Method to set the width of the horizontal routing arc. * @param wid the new width of the horizontal routing arc. */ public static void setHorizArcWidth(double wid) { cacheHorizRoutingWidth.setDouble(wid); } /** * Method to return the width of the horizontal routing arc, by default. * @return the width of the horizontal routing arc, by default. */ public static double getFactoryHorizArcWidth() { return cacheHorizRoutingWidth.getDoubleFactoryValue(); } private static Pref cacheVertRoutingArc = Pref.makeStringPref("VertRoutingArc", tool.prefs, "Metal-2"); /** * Method to return the vertical routing arc. * The default is "Metal-2". * @return the name of the vertical routing arc. */ public static String getVertRoutingArc() { return cacheVertRoutingArc.getString(); } /** * Method to set the vertical routing arc. * @param arcName name of new vertical routing arc. */ public static void setVertRoutingArc(String arcName) { cacheVertRoutingArc.setString(arcName); } /** * Method to return the vertical routing arc, by default. * @return the name of the vertical routing arc, by default. */ public static String getFactoryVertRoutingArc() { return cacheVertRoutingArc.getStringFactoryValue(); } private static Pref cacheVertRoutingWidth = Pref.makeDoublePref("VertArcWidth", tool.prefs, 4); /** * Method to return the width of the vertical routing arc. * The default is 4. * @return the width of the vertical routing arc. */ public static double getVertArcWidth() { return cacheVertRoutingWidth.getDouble(); } /** * Method to set the width of the vertical routing arc. * @param wid the new width of the vertical routing arc. */ public static void setVertArcWidth(double wid) { cacheVertRoutingWidth.setDouble(wid); } /** * Method to return the width of the vertical routing arc, by default. * @return the width of the vertical routing arc, by default. */ public static double getFactoryVertArcWidth() { return cacheVertRoutingWidth.getDoubleFactoryValue(); } private static Pref cachePowerWireWidth = Pref.makeDoublePref("PowerWireWidth", tool.prefs, 5); /** * Method to return the width of the power and ground arc. * The default is 5. * @return the width of the power and ground arc. */ public static double getPowerWireWidth() { return cachePowerWireWidth.getDouble(); } /** * Method to set the width of the power and ground arc. * @param wid the new width of the power and ground arc.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -