📄 fillgendialog.java
字号:
pack(); }// </editor-fold>//GEN-END:initComponents private void metalOptionActionPerformed(java.awt.event.ActionEvent evt) { FillGenButton b = (FillGenButton)evt.getSource(); setMetalOption(b, false); // MISSING install observer/observable } private void setMetalOption(FillGenButton b, boolean flatSelected) { boolean option = b.isSelected(); b.vddSpace.setEnabled(option); b.vddUnit.setEnabled(option); b.gndSpace.setEnabled(option); b.gndUnit.setEnabled(option); boolean value = /*flatSelected &&*/ option && !templateButton.isSelected(); b.vddWidth.setEnabled(value); b.vddWUnit.setEnabled(value); b.gndWidth.setEnabled(value); b.gndWUnit.setEnabled(value); } private void setMetalOptions(boolean flatSelected) { for (FillGenButton b : metalOptions) { setMetalOption(b, flatSelected); } } public void generalSetup(boolean flatSelected, boolean createMaster) { boolean value = !flatSelected && createMaster || templateButton.isSelected(); setEnabledInHierarchy(masterDimPanel, value); value = value || flatSelected; setEnabledInHierarchy(metalPanel, value); setMetalOptions(flatSelected); setEnabledInHierarchy(otherMasterPanel, value); } private void optionActionPerformed() { optionAction(false, false, false); } public void optionAction(boolean flatSelected, boolean createMaster, boolean isCellSelected) { // Disable tiling setEnabledInHierarchy(tilingPanel, !isCellSelected); // Calls master select setting generalSetup(flatSelected, createMaster); } private static void setEnabledInHierarchy(Container c, boolean value) { c.setEnabled(value); for (int i = 0; i < c.getComponentCount(); i++) { Component co = c.getComponent(i); co.setEnabled(value); if (co instanceof Container) setEnabledInHierarchy((Container)co, value); } } private void okButtonActionPerformed() { FillGenConfig config = okButtonClick(false, false, false, false, 0, FillGenConfig.FillGenType.INTERNAL, -1); if (config != null) new FillGenJob(Job.getUserInterface().getCurrentCell(), config, false); } public FillGenConfig okButtonClick(boolean isFlatSelected, boolean createMaster, boolean binary, boolean around, double gap, FillGenConfig.FillGenType genType, int level) { boolean hierarchy = (!isFlatSelected); boolean useMaster = hierarchy && !createMaster; boolean even = (jComboBox1.getModel().getSelectedItem().equals("horiz")); FillGeneratorTool.Units LAMBDA = FillGeneratorTool.LAMBDA; FillGeneratorTool.Units TRACKS = FillGeneratorTool.TRACKS; int firstMetal = -1, lastMetal = -1; double vddReserve = 0, gndReserve = 0; double vddWidth = 0, gndWidth = 0; for (FillGenButton b : metalOptions) { if (!b.isSelected()) continue; double vddS = TextUtils.atof(b.vddSpace.getText()); double gndS = TextUtils.atof(b.gndSpace.getText()); double vddW = TextUtils.atof(b.vddWidth.getText()); double gndW = TextUtils.atof(b.gndWidth.getText());// if (vddS > -1 && gndS > -1) { if (firstMetal == -1) firstMetal = b.metal; lastMetal = b.metal; if (vddS > vddReserve) vddReserve = vddS; //@@TODO we don't check that units are identical if (gndS > gndReserve) gndReserve = gndS; if (vddW > vddWidth) vddWidth = vddW; if (gndW > gndWidth) gndWidth = gndW; } } if (!useMaster && vddReserve == 0 && gndReserve == 0) // nothing reserve { System.out.println("Nothing reserve"); return null; } // This assumes the wires are long enough for wide values are going to be retrieved double drcSpacingRule = DRC.getWorstSpacingDistance(tech, lastMetal); // only metals double width = TextUtils.atof(jTextField1.getText()); double height = TextUtils.atof(jTextField2.getText()); // Only when the fill will be with respect to a given cell FillGeneratorTool.FillTypeEnum type = FillGeneratorTool.FillTypeEnum.TEMPLATE; Cell cellToFill = Job.getUserInterface().getCurrentCell(); if (!templateButton.isSelected()) { if (cellToFill == null) { System.out.println("No cell to fill"); return null; } type = FillGeneratorTool.FillTypeEnum.CELL; Rectangle2D bnd = cellToFill.getBounds(); width = bnd.getWidth(); height = bnd.getHeight(); } List<Integer> items = new ArrayList<Integer>(12); for (int i = 0; i < tiledCells.length; i++) { if (tiledCells[i].getModel().isSelected()) items.add(new Integer(i+2)); } int[] cells = null; if (items.size() > 0) { cells = new int[items.size()]; for (int i = 0; i < items.size(); i++) cells[i] = items.get(i).intValue(); } TechType.TechTypeEnum techNm = TechType.TechTypeEnum.CMOS90; // putting one possible value if (tech == Technology.getMocmosTechnology()) { techNm = TechType.TechTypeEnum.MOCMOS; } else if (tech == Technology.getTSMC180Technology()) { techNm = TechType.TechTypeEnum.TSMC180; } else if (tech == Technology.getCMOS90Technology()) { techNm = TechType.TechTypeEnum.CMOS90; } else assert(false); // it should not reach this point // testing new code boolean withWidth = false; // Width and Height are either the w/h of the template to create or the size of the cell to fill FillGenConfig config = new FillGenConfig(type, techNm, "autoFillLib", FillGeneratorTool.PERIMETER, firstMetal, lastMetal, width, height, even, cells, hierarchy, 0.1, drcSpacingRule, binary, useMaster, around, gap, genType, level); if (!templateButton.isSelected()) { Rectangle2D bnd = cellToFill.getBounds(); double minSize = vddReserve + gndReserve + 2*drcSpacingRule + 2*gndReserve + 2*vddReserve; minSize = vddReserve + gndReserve + 2*drcSpacingRule + 2*vddWidth + 2*gndWidth; withWidth = true; config.setTargetValues(bnd.getWidth(), bnd.getHeight(), minSize, minSize); } boolean metalW = isFlatSelected || withWidth; for (FillGenButton b : metalOptions) { if (!b.isSelected()) continue; double vddVal = TextUtils.atof(b.vddSpace.getText()); double gndVal = TextUtils.atof(b.gndSpace.getText()); FillGeneratorTool.Units vddU = TRACKS; if (b.vddUnit.getModel().getSelectedItem().equals("lambda")) vddU = LAMBDA; FillGeneratorTool.Units gndU = TRACKS; if (b.gndUnit.getModel().getSelectedItem().equals("lambda")) gndU = LAMBDA; FillGenConfig.ReserveConfig c = config.reserveSpaceOnLayer(tech, b.metal, vddVal, vddU, gndVal, gndU); // Width values if (metalW) { vddU = TRACKS; if (b.vddUnit.getModel().getSelectedItem().equals("lambda")) vddU = LAMBDA; gndU = TRACKS; if (b.gndUnit.getModel().getSelectedItem().equals("lambda")) gndU = LAMBDA; vddVal = TextUtils.atof(b.vddWidth.getText()); gndVal = TextUtils.atof(b.gndWidth.getText()); c.reserveWidthOnLayer(vddVal, vddU, gndVal, gndU); } } setVisible(false); return config; } private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed closeDialog(); }//GEN-LAST:event_cancelButtonActionPerformed private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed// System.out.println("that's all folks");// System.exit(0); }//GEN-LAST:event_formWindowClosed /** * @param args the command line arguments */ public static void main(String args[]) { new FillGenDialog(null, new JFrame()); } public static void openFillGeneratorDialog(Technology tech) { new FillGenDialog(tech, TopLevel.getCurrentJFrame()); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton cancelButton; private javax.swing.JPanel floorplanPanel; private javax.swing.JLabel gndSpaceLabel; private javax.swing.JLabel gndWidthLabel; private javax.swing.JCheckBox jCheckBox1; private javax.swing.JCheckBox jCheckBox10; private javax.swing.JCheckBox jCheckBox11; private javax.swing.JCheckBox jCheckBox12; private javax.swing.JCheckBox jCheckBox2; private javax.swing.JCheckBox jCheckBox3; private javax.swing.JCheckBox jCheckBox4; private javax.swing.JCheckBox jCheckBox5; private javax.swing.JCheckBox jCheckBox6; private javax.swing.JCheckBox jCheckBox7; private javax.swing.JCheckBox jCheckBox8; private javax.swing.JCheckBox jCheckBox9; private javax.swing.JComboBox jComboBox1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JTabbedPane jTabbedPane1; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JPanel masterDimPanel; private javax.swing.JPanel metalPanel; private javax.swing.JButton okButton; private javax.swing.JPanel otherMasterPanel; private javax.swing.JRadioButton templateButton; private javax.swing.JPanel templatePanel; private javax.swing.JPanel tilingPanel; private javax.swing.ButtonGroup topGroup; private javax.swing.JLabel vddSpaceLabel; private javax.swing.JLabel vddWidthLabel; // End of variables declaration//GEN-END:variables}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -