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

📄 letool.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
                System.out.println("Error: Unable to uniquify cell "+cell.describe(false)+", too many versions already");                return cell;            }            // create new version            Cell icon = cell.iconView();            Cell newicon = null;            if (icon != null) {                newicon = Cell.copyNodeProto(icon, lib, newpname, true);                if (newicon == null) {                    System.out.println("Error: Unable to copy "+icon.describe(false)+" to "+newpname);                    return cell;                }            }            Cell newcell = Cell.copyNodeProto(cell, lib, newpname, true);            if (newcell == null) {                System.out.println("Error: Unable to copy "+cell.describe(false)+" to "+newpname);                return cell;            }            // change master icon            if (icon != null && newicon != null) {                for (Iterator<NodeInst> it = newcell.getNodes(); it.hasNext(); ) {                    NodeInst nni = it.next();                    if (nni.getProto() == icon) {                        nni.replace(newicon, true, true);                    }                }            }            return newcell;        }        public void prMsg(String msg) {            if (verbose) System.out.println(msg);        }    }    /**     * Prints results of a sizing job for a Nodable.     * @param no the Nodable to print info for.     */    public static void printResults(Nodable no, VarContext context)    {        // Doesn't iterate anymore over allJobs which might be AnalyzeCell because        // it remembers only 1        if (lastLEJobExecuted != null)        {            LENetlister netlister = lastLEJobExecuted.getNetlister();            if (netlister.printResults(no, context)) return;        }        // no info found        System.out.println("No existing completed sizing jobs contain info about "+no.getName());    }    public static void clearStoredSizesJob(NodeInst ni) {        ClearStoredSizes job = new ClearStoredSizes(ni);    }    public static void clearStoredSizesJob(Library lib) {        ClearStoredSizesLibrary job = new ClearStoredSizesLibrary(lib);    }    /**     * Clears stored "LEDRIVE_" sizes on a Nodable.     */    public static class ClearStoredSizes extends Job {        private NodeInst ni;		public ClearStoredSizes(NodeInst ni) {            super("Clear LE Sizes", tool, Job.Type.CHANGE, null, null, Job.Priority.USER);            this.ni = ni;            startJob();        }        public boolean doIt() throws JobException {            clearStoredSizes(ni);            return true;        }    }    public static class ClearStoredSizesLibrary extends Job {        private Library lib;		public ClearStoredSizesLibrary(Library lib) {            super("Clear LE Sizes", tool, Job.Type.CHANGE, null, null, Job.Priority.USER);            this.lib = lib;            startJob();        }        public boolean doIt() throws JobException {            clearStoredSizes(lib);            return true;        }    }    /**     * Clears stored "LEDRIVE_" sizes on all nodes in a Cell.     */    private static void clearStoredSizes(Cell cell) {        for (Iterator<NodeInst> it = cell.getNodes(); it.hasNext(); ) {            clearStoredSizes((NodeInst)it.next());        }        for (Iterator<Variable> it = cell.getVariables(); it.hasNext(); ) {            Variable var = (Variable)it.next();            String name = var.getKey().getName();            if (name.startsWith("LEDRIVE_")) {                cell.delVar(var.getKey());            }        }    }    /**     * Clears stored "LEDRIVE_" sizes for all cells in a Library.     */    private static void clearStoredSizes(Library lib) {        for (Iterator<Cell> it = lib.getCells(); it.hasNext(); ) {            clearStoredSizes((Cell)it.next());        }    }    // delete all vars that start with "LEDRIVE_"    private static void clearStoredSizes(NodeInst ni) {        for (Iterator<Variable> it = ni.getVariables(); it.hasNext(); ) {            Variable var = (Variable)it.next();            String name = var.getKey().getName();            if (name.startsWith("LEDRIVE_")) {                ni.delVar(var.getKey());            }        }    }/*    protected static void addSettings(NetlisterConstants constants, Cell cell) {        // find LESETTINGS cell        Cell settings = null;        for (Iterator libIt = Library.getLibraries(); libIt.hasNext(); ) {            Library lib = (Library)libIt.next();            for (Iterator it = lib.getCells(); it.hasNext(); ) {                Cell c = (Cell)it.next();                if (c.getVar("ATTR_LESETTINGS") != null) {                    settings = c;                    break;                }            }        }        if (settings == null) {            System.out.println("Did not find LESETTINGS Cell, not saving settings to "+cell.describe());            return;        }        Rectangle2D bounds = cell.getBounds();        int x = (int)bounds.getMaxX();        int y = (int)bounds.getMinY();        NodeInst ni = NodeInst.makeInstance(settings, new Point2D.Double(x,y), settings.getDefWidth(),                settings.getDefHeight(), cell);        if (ni == null) {            System.out.println("Could not create LESETTINGS instance, not saving settings to "+cell.describe());            return;        }        Variable var;        if ((var = ni.getVar("ATTR_su")) != null) ni.updateVar(var.getKey(), new Float(constants.su));        if ((var = ni.getVar("ATTR_wire_ratio")) != null) ni.updateVar(var.getKey(), new Float(constants.wireRatio));        if ((var = ni.getVar("ATTR_epsilon")) != null) ni.updateVar(var.getKey(), new Float(constants.epsilon));        if ((var = ni.getVar("ATTR_max_iter")) != null) ni.updateVar(var.getKey(), new Integer(constants.maxIterations));        if ((var = ni.getVar("ATTR_gate_cap")) != null) ni.updateVar(var.getKey(), new Float(constants.gateCap));        if ((var = ni.getVar("ATTR_alpha")) != null) ni.updateVar(var.getKey(), new Float(constants.alpha));        if ((var = ni.getVar("ATTR_keeper_ratio")) != null) ni.updateVar(var.getKey(), new Float(constants.keeperRatio));    }*/	/************************** PROJECT SETTINGS *************************///	// preferences; tech-dependent values handled by technology and    // project settings    private static double DEFAULT_GLOBALFANOUT = 4.7;    private static double DEFAULT_EPSILON      = 0.001;    private static int    DEFAULT_MAXITER      = 30;//    private static double DEFAULT_GATECAP      = 0.4;//    private static double DEFAULT_WIRERATIO    = 0.16;//    private static double DEFAULT_DIFFALPHA    = 0.7;    private static double DEFAULT_KEEPERRATIO  = 0.1;	/**	 * Method to tell whether to use local settings for Logical Effort.	 * The default is true.	 * @return true to use local settings for Logical Effort	 */	public static boolean isUseLocalSettings() { return tool.cacheUseLocalSettings.getBoolean(); }	/**	 * Returns project Setting to tell whether to use local settings for Logical Effort	 * @return project Setting to tell whether to use local settings for Logical Effort	 */	public static Setting getUseLocalSettingsSetting() { return tool.cacheUseLocalSettings; }//	private static Pref cacheHighlightComponents = Pref.makeBooleanPref("HighlightComponents", LETool.tool.prefs, false);//	/**//	 * Method to tell whether to highlight components in Logical Effort.//	 * The default is false.//	 * @return true to highlight components in Logical Effort//	 *///	public static boolean isHighlightComponents() { return cacheHighlightComponents.getBoolean(); }//	/**//	 * Method to set whether to highlight components in Logical Effort//	 * @param on whether to highlight components in Logical Effort//	 *///	public static void setHighlightComponents(boolean on) { cacheHighlightComponents.setBoolean(on); }//	private static Pref cacheShowIntermediateCapacitances = Pref.makeBooleanPref("ShowIntermediateCapacitances", LETool.tool.prefs, false);//	/**//	 * Method to tell whether to highlight intermediate capacitances in Logical Effort.//	 * The default is false.//	 * @return true to highlight intermediate capacitances in Logical Effort//	 *///	public static boolean isShowIntermediateCapacitances() { return cacheShowIntermediateCapacitances.getBoolean(); }//	/**//	 * Method to set whether to highlight intermediate capacitances in Logical Effort//	 * @param on whether to highlight intermediate capacitances in Logical Effort//	 *///	public static void setShowIntermediateCapacitances(boolean on) { cacheShowIntermediateCapacitances.setBoolean(on); }	/**	 * Method to get the Global Fanout for Logical Effort.	 * The default is DEFAULT_GLOBALFANOUT.	 * @return the Global Fanout for Logical Effort.	 */	public static double getGlobalFanout() { return tool.cacheGlobalFanout.getDouble(); }	/**     * Returns project Setting to tell the Global Fanout for Logical Effort.     * @return project Setting to tell the Global Fanout for Logical Effort.	 */	public static Setting getGlobalFanoutSetting() { return tool.cacheGlobalFanout; }	/**	 * Method to get the Convergence Epsilon value for Logical Effort.	 * The default is DEFAULT_EPSILON.	 * @return the Convergence Epsilon value for Logical Effort.	 */	public static double getConvergenceEpsilon() { return tool.cacheConvergenceEpsilon.getDouble(); }	/**	 * Returns project Setting to tell the Convergence Epsilon value for Logical Effort.	 * @return project Setting to tell the Convergence Epsilon value for Logical Effort.	 */	public static Setting getConvergenceEpsilonSetting() { return tool.cacheConvergenceEpsilon; }    /**	 * Method to get the maximum number of iterations for Logical Effort.	 * The default is DEFAULT_MAXITER.	 * @return the maximum number of iterations for Logical Effort.	 */	public static int getMaxIterations() { return tool.cacheMaxIterations.getInt(); }	/**	 * Returns project Setting to tell the maximum number of iterations for Logical Effort.	 * @return project Setting to tell the maximum number of iterations for Logical Effort.	 */	public static Setting getMaxIterationsSetting() { return tool.cacheMaxIterations; }//	private static Pref cacheGateCapacitance = Pref.makeDoublePref("GateCapfFPerLambda", LETool.tool.prefs, DEFAULT_GATECAP);//	/**//	 * Method to get the Gate Capacitance for Logical Effort.//	 * The default is DEFAULT_GATECAP.//	 * @return the Gate Capacitance for Logical Effort.//	 *///	public static double getGateCapacitance() { return cacheGateCapacitance.getDouble(); }//	/**//	 * Method to set the Gate Capacitance for Logical Effort.//	 * @param gc the Gate Capacitance for Logical Effort.//	 *///	public static void setGateCapacitance(double gc) { cacheGateCapacitance.setDouble(gc); }//	private static Pref cacheWireRatio = Pref.makeDoublePref("WireRatio", LETool.tool.prefs, DEFAULT_WIRERATIO);//	/**//	 * Method to get the wire capacitance ratio for Logical Effort.//	 * The default is DEFAULT_WIRERATIO.//	 * @return the wire capacitance ratio for Logical Effort.//	 *///	public static double getWireRatio() { return cacheWireRatio.getDouble(); }//	/**//	 * Method to set the wire capacitance ratio for Logical Effort.//	 * @param wr the wire capacitance ratio for Logical Effort.//	 *///	public static void setWireRatio(double wr) { cacheWireRatio.setDouble(wr); }//	private static Pref cacheDiffAlpha = Pref.makeDoublePref("DiffusionAlpha", LETool.tool.prefs, DEFAULT_DIFFALPHA);//	/**//	 * Method to get the diffusion to gate capacitance ratio for Logical Effort.//	 * The default is DEFAULT_DIFFALPHA.//	 * @return the diffusion to gate capacitance ratio for Logical Effort.//	 *///	public static double getDiffAlpha() { return cacheDiffAlpha.getDouble(); }//	/**//	 * Method to set the diffusion to gate capacitance ratio for Logical Effort.//	 * @param da the diffusion to gate capacitance ratio for Logical Effort.//	 *///	public static void setDiffAlpha(double da) { cacheDiffAlpha.setDouble(da); }	/**	 * Method to get the keeper size ratio for Logical Effort.	 * The default is DEFAULT_KEEPERRATIO.	 * @return the keeper size ratio for Logical Effort.	 */	public static double getKeeperRatio() { return tool.cacheKeeperRatio.getDouble(); }	/**	 * Returns project Setting to tell the keeper size ratio for Logical Effort.	 * @return project Setting to tell the keeper size ratio for Logical Effort.	 */	public static Setting getKeeperRatioSetting() { return tool.cacheKeeperRatio; }	private Setting cacheUseLocalSettings;    private Setting cacheGlobalFanout;    private Setting cacheConvergenceEpsilon;    private Setting cacheMaxIterations;    private Setting cacheKeeperRatio;    @Override    protected void initProjectSettings() {        makeBooleanSetting("UseLocalSettings", "Logical Effort Tab", "Use Local Settings from Cell", true);        makeDoubleSetting("GlobalFanout", "Logical Effort Tab", "Global Fanout", DEFAULT_GLOBALFANOUT);        makeDoubleSetting("ConvergenceEpsilon", "Logical Effort Tab", "Convergence Epsilon", DEFAULT_EPSILON);        makeIntSetting("MaxIterations", "Logical Effort Tab", "Maximum Iterations", DEFAULT_MAXITER);        makeDoubleSetting("KeeperRatio", "Logical Effort Tab", "Keeper Ratio", DEFAULT_KEEPERRATIO);    }    }

⌨️ 快捷键说明

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