📄 cellmodeltab.java
字号:
} verilogCellListClick(); } } private void verilogCellListClick() { Cell cell = getSelectedCell(); if (cell == null) return; ModelPref pref = initialBehaveFiles.get(cell); if (pref == null) { deriveModel.setSelected(true); fileNameField.setEditable(false); fileNameField.setText(""); return; } String behaveFile = pref.fileName; deriveModel.setSelected(pref.choice == Choice.NONE); netlistFromLayout.setSelected(pref.choice == Choice.USELAYOUTNETLIST); useModelFile.setSelected(pref.choice == Choice.USEMODELFILE); if (pref.choice == Choice.USEMODELFILE) { fileNameField.setEditable(true); } else { fileNameField.setEditable(false); } fileNameField.setText(behaveFile); lastLib = (String)libraryChoice.getSelectedItem(); lastCell = (String)cellList.getSelectedValue(); } private void verilogModelClick() { if (deriveModel.isSelected() || netlistFromLayout.isSelected()) { fileNameField.setEditable(false); } else { fileNameField.setEditable(true); } Cell cell = getSelectedCell(); if (cell == null) return; ModelPref pref = initialBehaveFiles.get(cell); if (deriveModel.isSelected()) pref.choice = Choice.NONE; if (netlistFromLayout.isSelected()) pref.choice = Choice.USELAYOUTNETLIST; if (useModelFile.isSelected()) pref.choice = Choice.USEMODELFILE; } private void showRecentCellsOnlyClick() { if (showRecentCells.isSelected()) { libraryChoice.setSelectedItem(recentlySetCellsName); } else { libraryChoice.setSelectedItem(curLib.getName()); } verilogLoadCellList(); } private Cell getSelectedCell() { String libName = (String)libraryChoice.getSelectedItem(); String cellName = (String)cellList.getSelectedValue(); Library lib; Cell cell = null; if (libName.equals(recentlySetCellsName)) { cell = (Cell)Cell.findNodeProto(cellName); lib = cell.getLibrary(); } else { lib = Library.findLibrary(libName); cell = lib.findNodeProto(cellName); } return cell; } /** * Method called when the "OK" panel is hit. * Updates any changed fields in the Verilog tab. */ public void term() { for(Iterator<Library> lIt = Library.getLibraries(); lIt.hasNext(); ) { Library lib = lIt.next(); if (lib.isHidden()) continue; for(Iterator<Cell> cIt = lib.getCells(); cIt.hasNext(); ) { Cell cell = cIt.next(); ModelPref pref = initialBehaveFiles.get(cell); if (pref == null) continue; boolean useLayoutView = (pref.choice == Choice.USELAYOUTNETLIST); boolean useModelFile = (pref.choice == Choice.USEMODELFILE); if (!pref.fileName.equals(modelPrefs.getModelFile(cell)) || useLayoutView != modelPrefs.isUseLayoutView(cell) || useModelFile != modelPrefs.isUseModelFromFile(cell)) { String fileName = pref.fileName.trim(); modelPrefs.setModelFile(cell, fileName, useModelFile, useLayoutView); //cell.newVar(Verilog.VERILOG_BEHAVE_FILE_KEY, pref.getString()); } } } } /** * Method called when the factory reset is requested. */ public void reset() { for(Iterator<Library> lIt = Library.getLibraries(); lIt.hasNext(); ) { Library lib = lIt.next(); if (lib.isHidden()) continue; for(Iterator<Cell> cIt = lib.getCells(); cIt.hasNext(); ) { Cell cell = cIt.next(); modelPrefs.factoryResetModelFile(cell); } } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; verilogModel = new javax.swing.ButtonGroup(); chooserPanel = new javax.swing.JPanel(); jLabel54 = new javax.swing.JLabel(); libraryChoice = new javax.swing.JComboBox(); cellsList = new javax.swing.JScrollPane(); deriveModel = new javax.swing.JRadioButton(); useModelFile = new javax.swing.JRadioButton(); browse = new javax.swing.JButton(); fileNameField = new javax.swing.JTextField(); showRecentCells = new javax.swing.JCheckBox(); netlistFromLayout = new javax.swing.JRadioButton(); getContentPane().setLayout(new java.awt.GridBagLayout()); setTitle("Tool Options"); setName(""); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); chooserPanel.setLayout(new java.awt.GridBagLayout()); jLabel54.setText("Library:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; chooserPanel.add(jLabel54, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); chooserPanel.add(libraryChoice, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; chooserPanel.add(cellsList, gridBagConstraints); verilogModel.add(deriveModel); deriveModel.setText("Derive Model from Circuitry"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(20, 4, 4, 4); chooserPanel.add(deriveModel, gridBagConstraints); verilogModel.add(useModelFile); useModelFile.setText("Use Model from File:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); chooserPanel.add(useModelFile, gridBagConstraints); browse.setText("Browse"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); chooserPanel.add(browse, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); chooserPanel.add(fileNameField, gridBagConstraints); showRecentCells.setText("Show Recently Used Cells Only"); showRecentCells.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); showRecentCells.setMargin(new java.awt.Insets(0, 0, 0, 0)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(4, 7, 4, 4); chooserPanel.add(showRecentCells, gridBagConstraints); verilogModel.add(netlistFromLayout); netlistFromLayout.setText("Netlist from Layout"); netlistFromLayout.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); netlistFromLayout.setMargin(new java.awt.Insets(0, 0, 0, 0)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(4, 8, 4, 4); chooserPanel.add(netlistFromLayout, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(chooserPanel, gridBagConstraints); pack(); }// </editor-fold>//GEN-END:initComponents /** Closes the dialog */ private void closeDialog(java.awt.event.WindowEvent evt)//GEN-FIRST:event_closeDialog { setVisible(false); dispose(); }//GEN-LAST:event_closeDialog // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton browse; private javax.swing.JScrollPane cellsList; private javax.swing.JPanel chooserPanel; private javax.swing.JRadioButton deriveModel; private javax.swing.JTextField fileNameField; private javax.swing.JLabel jLabel54; private javax.swing.JComboBox libraryChoice; private javax.swing.JRadioButton netlistFromLayout; private javax.swing.JCheckBox showRecentCells; private javax.swing.JRadioButton useModelFile; private javax.swing.ButtonGroup verilogModel; // End of variables declaration//GEN-END:variables}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -