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

📄 technologytab.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: TechnologyTab.java * * Copyright (c) 2006 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.user.dialogs.projsettings;import com.sun.electric.database.text.Setting;import com.sun.electric.technology.Foundry;import com.sun.electric.technology.Technology;import com.sun.electric.tool.user.User;import com.sun.electric.tool.user.dialogs.ProjectSettingsFrame;import com.sun.electric.tool.user.ui.TopLevel;import java.util.ArrayList;import java.util.Iterator;import javax.swing.JOptionPane;import javax.swing.JPanel;/** * Class to handle the "Technology" tab of the Project Settings dialog. */public class TechnologyTab extends ProjSettingsPanel{	private ArrayList<Object> extraTechTabs = new ArrayList<Object>();	/** Value for standard SCMOS rules. */		public static final int MOCMOS_SCMOSRULES = 0; // = MoCMOS.SCMOSRULES	/** Value for submicron rules. */			public static final int MOCMOS_SUBMRULES  = 1; // = MoCMOS.SUBMRULES	/** Value for deep rules. */				public static final int MOCMOS_DEEPRULES  = 2; // = MoCMOS.DEEPRULES	private Setting defaultTechnologySetting = User.getDefaultTechnologySetting();	private Setting schematicTechnologySetting = User.getSchematicTechnologySetting();    private Setting processLayoutTechnologySetting = User.getPWellProcessLayoutTechnologySetting();    private Technology mocmos = Technology.getMocmosTechnology();	private Setting mocmosRuleSetSetting                  = mocmos.getSetting("MOCMOS Rule Set");	private Setting mocmosNumMetalSetting                 = mocmos.getSetting("NumMetalLayers");	private Setting mocmosSecondPolysiliconSetting        = mocmos.getSetting("UseSecondPolysilicon");	private Setting mocmosDisallowStackedViasSetting      = mocmos.getSetting("DisallowStackedVias");	private Setting mocmosAlternateActivePolyRulesSetting = mocmos.getSetting("UseAlternativeActivePolyRules");	private Setting mocmosAnalogSetting                   = mocmos.getSetting("Analog");	/** Creates new form TechnologyTab */	public TechnologyTab(ProjectSettingsFrame parent, boolean modal)	{		super(parent, modal);		initComponents();	}	/** return the panel to use for this preferences tab. */	public JPanel getPanel() { return technology; }	/** return the name of this preferences tab. */	public String getName() { return "Technology"; }	public Foundry.Type setFoundrySelected(Technology tech, javax.swing.JComboBox pulldown)	{		String selectedFoundry = getString(tech.getPrefFoundrySetting());		Foundry.Type foundry = Foundry.Type.NONE;		for (Iterator<Foundry> itF = tech.getFoundries(); itF.hasNext();)		{			Foundry factory = itF.next();			Foundry.Type type = factory.getType();			pulldown.addItem(type);			if (selectedFoundry.equalsIgnoreCase(factory.getType().getName())) foundry = type;		}		pulldown.setEnabled(foundry != Foundry.Type.NONE);		pulldown.setSelectedItem(foundry);		return foundry;	}	/**	 * Method called at the start of the dialog.	 * Caches current values and displays them in the Technology tab.	 */	public void init()	{		// MOCMOS		int initialTechRules = getInt(mocmosRuleSetSetting);		if (initialTechRules == MOCMOS_SCMOSRULES) techMOCMOSSCMOSRules.setSelected(true); else			if (initialTechRules == MOCMOS_SUBMRULES) techMOCMOSSubmicronRules.setSelected(true); else				techMOCMOSDeepRules.setSelected(true);		techMetalLayers.addItem("2 Layers");		techMetalLayers.addItem("3 Layers");		techMetalLayers.addItem("4 Layers");		techMetalLayers.addItem("5 Layers");		techMetalLayers.addItem("6 Layers");		techMetalLayers.setSelectedIndex(getInt(mocmosNumMetalSetting)-2);		techMOCMOSSecondPoly.setSelected(getBoolean(mocmosSecondPolysiliconSetting));		techMOCMOSDisallowStackedVias.setSelected(getBoolean(mocmosDisallowStackedViasSetting));		techMOCMOSAlternateContactRules.setSelected(getBoolean(mocmosAlternateActivePolyRulesSetting));		techMOCMOSAnalog.setSelected(getBoolean(mocmosAnalogSetting));		// Technologies		for(Iterator<Technology> it = Technology.getTechnologies(); it.hasNext(); )		{			Technology tech = it.next();			defaultTechPulldown.addItem(tech.getTechName());			if (tech.isScaleRelevant()) technologyPopup.addItem(tech.getTechName());		}		defaultTechPulldown.setSelectedItem(getString(defaultTechnologySetting));		technologyPopup.setSelectedItem(User.getSchematicTechnology().getTechName());        technologyProcess.setSelected(processLayoutTechnologySetting.getBoolean());        // Tabs for extra technologies if available		initExtraTab("com.sun.electric.plugins.tsmc.CMOS90Tab", cmos90Panel);		initExtraTab("com.sun.electric.plugins.tsmc.TSMC180Tab", tsmc180Panel);	}	private void initExtraTab(String className, JPanel panel)	{		try		{			Class<?> extraTechClass = Class.forName(className);			Object extraTechTab = extraTechClass.getConstructor(TechnologyTab.class, JPanel.class).newInstance(this, panel);			extraTechTabs.add(extraTechTab);		} catch (Exception e)		{//			System.out.println("Exceptions while importing extra technologies");			technology.remove(panel);		}	}	/**	 * Method called when the "OK" panel is hit.	 * Updates any changed fields in the Technology tab.	 */	public void term()	{		// MOCMOS		int currentNumMetals = techMetalLayers.getSelectedIndex() + 2;		int currentRules = MOCMOS_SCMOSRULES;		if (techMOCMOSSubmicronRules.isSelected()) currentRules = MOCMOS_SUBMRULES; else			if (techMOCMOSDeepRules.isSelected()) currentRules = MOCMOS_DEEPRULES;		boolean secondPoly = techMOCMOSSecondPoly.isSelected();		boolean alternateContactRules = techMOCMOSAlternateContactRules.isSelected();		if (techMOCMOSAnalog.isSelected())		{			// analog rules demand 2 metals, SCMOS, 2 poly, no stacked vias			if (currentNumMetals != 2 || currentRules != MOCMOS_SCMOSRULES || !secondPoly || alternateContactRules)			{				JOptionPane.showMessageDialog(TopLevel.getCurrentJFrame(),					"The Analog setting requires 2 metals, 2 polys, SCMOS rules, and no alternate contact rules...making these changes");				currentNumMetals = 2;				currentRules = MOCMOS_SCMOSRULES;				secondPoly = true;				alternateContactRules = false;			}		}		switch (currentNumMetals)		{			// cannot use deep rules if less than 5 layers of metal			case 2:			case 3:			case 4:				if (currentRules == MOCMOS_DEEPRULES)				{					JOptionPane.showMessageDialog(TopLevel.getCurrentJFrame(),						"Cannot use Deep rules if there are less than 5 layers of metal...using SubMicron rules.");					currentRules = MOCMOS_SUBMRULES;				}				break;			// cannot use scmos rules if more than 4 layers of metal			case 5:			case 6:				if (currentRules == MOCMOS_SCMOSRULES)				{					JOptionPane.showMessageDialog(TopLevel.getCurrentJFrame(),						"Cannot use SCMOS rules if there are more than 4 layers of metal...using SubMicron rules.");					currentRules = MOCMOS_SUBMRULES;				}				break;		}		setInt(mocmosNumMetalSetting, currentNumMetals);		setInt(mocmosRuleSetSetting, currentRules);		setBoolean(mocmosSecondPolysiliconSetting, secondPoly);		setBoolean(mocmosDisallowStackedViasSetting, techMOCMOSDisallowStackedVias.isSelected());		setBoolean(mocmosAlternateActivePolyRulesSetting,alternateContactRules);		setBoolean(mocmosAnalogSetting, techMOCMOSAnalog.isSelected());		// Technologies		String currentTechName = (String)technologyPopup.getSelectedItem();		if (Technology.findTechnology(currentTechName) != null)			setString(schematicTechnologySetting, currentTechName);		setString(defaultTechnologySetting, (String)defaultTechPulldown.getSelectedItem());        boolean currentV = technologyProcess.isSelected();        if (currentV != processLayoutTechnologySetting.getBoolean())        {            setBoolean(processLayoutTechnologySetting, currentV);            // It will force the reload of the factory rules.            Technology.getCurrent().setCachedRules(null);        }        // Tabs for extra technologies if available		for (Object extraTechTab: extraTechTabs)		{			try			{				extraTechTab.getClass().getMethod("term").invoke(extraTechTab);			} catch (Exception e)			{				System.out.println("Exceptions while importing extra technologies: " + e.getMessage());			}		}	}	/**	 * Method to check whether the foundry value has been changed. If changed, primitives might need resizing.	 * @param foundry	 * @param tech	 */	public boolean checkFoundry(Foundry.Type foundry, Technology tech)	{		if (foundry == null) return false; // technology without design rules.		boolean changed = false;		if (!foundry.getName().equalsIgnoreCase(getString(tech.getPrefFoundrySetting())))		{			changed = true;			String [] messages = {				tech.getTechShortName()+" primitives in database might be resized according to values provided by " + foundry + ".",				"If you do not resize now, arc widths might not be optimal for " + foundry + ".",

⌨️ 快捷键说明

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