📄 primitivenode.java
字号:
* but each layer is tied to a specific port on the node. * If any piece of geometry covers more than one port, * it must be split for the purposes of an "electrical" description.<BR> * For example, the MOS transistor has 2 layers: Active and Poly. * But it has 3 electrical layers: Active, Active, and Poly. * The active must be split since each half corresponds to a different PrimitivePort on the PrimitiveNode. * @return the list of electrical Layers that comprise this PrimitiveNode. */ public Technology.NodeLayer [] getElectricalLayers() { return electricalLayers; } /** * Method to set the list of electrical Layers that comprise this PrimitiveNode. * Like the list returned by "getLayers", the results describe this PrimitiveNode, * but each layer is tied to a specific port on the node. * If any piece of geometry covers more than one port, * it must be split for the purposes of an "electrical" description.<BR> * For example, the MOS transistor has 2 layers: Active and Poly. * But it has 3 electrical layers: Active, Active, and Poly. * The active must be split since each half corresponds to a different PrimitivePort on the PrimitiveNode. * @param electricalLayers the list of electrical Layers that comprise this PrimitiveNode. */ public void setElectricalLayers(Technology.NodeLayer [] electricalLayers) { this.electricalLayers = electricalLayers; if (false) layers = electricalLayers; } /** * Method to find the NodeLayer on this PrimitiveNode with a given Layer. * If there are more than 1 with the given Layer, the first is returned. * @param layer the Layer to find. * @return the NodeLayer that has this Layer. */ public Technology.NodeLayer findNodeLayer(Layer layer, boolean electrical) { // Give higher priority to electrical layers Technology.NodeLayer[] nodes = (electrical) ? electricalLayers : layers; if (nodes != null) { for(int j=0; j<nodes.length; j++) { Technology.NodeLayer oneLayer = nodes[j]; if (oneLayer.getLayer() == layer) return oneLayer; } } return null; } /** * Tells whether this PrimitiveNode has NodeLayer with MULTICUTBOX representation. * For now, multicut primitives and resistor primitives have such NodeLayers. * @return true if this PrimitiveNode has NodeLayer with MULTICUTBOX representation. */ public boolean hasMultiCuts() { return numMultiCuts > 0; } /** * Find a NodeLayer of this PrimitiveNode has NodeLayer with MULTICUTBOX representation. * If no such NodeLayer exists, returns null, if many - returns any of them.. * @return a NodeLayer of this PrimitiveNode has NodeLayer with MULTICUTBOX representation. */ public Technology.NodeLayer findMulticut() { for (Technology.NodeLayer nl: layers) { if (nl.getRepresentation() == Technology.NodeLayer.MULTICUTBOX) return nl; } return null; } /** * Tells whether this PrimitiveNode is multicut, i.e. it has exactly one NodeLayer with MULTICUTBOX representation, * @return true if this PrimitiveNode is multicut. */ public boolean isMulticut() { return numMultiCuts == 1; } /** * Method to return the Pref that describes the defaut width of this PrimitiveNode. * @param factoryExtendX the "factory" default extend of this PrimitiveNode over minimal width. * @return a Pref that stores the proper default width of this PrimitiveNode. */ private Pref getNodeProtoExtendXPref(double factoryExtendX) { Pref pref = defaultExtendXPrefs.get(this); if (pref == null) { pref = Pref.makeDoublePref("DefaultExtendXFor" + getName() + "IN" + tech.getTechName(), tech.getTechnologyPreferences(), factoryExtendX); defaultExtendXPrefs.put(this, pref); } return pref; } /** * Method to return the Pref that describes the defaut height of this PrimitiveNode. * @param factoryExtendY the "factory" default extend of this PrimitiveNode over minimal height. * @return a Pref that stores the proper default height of this PrimitiveNode. */ private Pref getNodeProtoExtendYPref(double factoryExtendY) { Pref pref = defaultExtendYPrefs.get(this); if (pref == null) { pref = Pref.makeDoublePref("DefaultExtendYFor" + getName() + "IN" + tech.getTechName(), tech.getTechnologyPreferences(), factoryExtendY); defaultExtendYPrefs.put(this, pref); } return pref; } /** * Method to set the factory-default width of this PrimitiveNode. * This is only called during construction. * @param defWidth the factory-default width of this PrimitiveNode. * @param defHeight the factory-default height of this PrimitiveNode. */ protected void setFactoryDefSize(double defWidth, double defHeight) { getNodeProtoExtendXPref(DBMath.round(0.5*(defWidth - fullRectangle.getLambdaWidth()))); getNodeProtoExtendYPref(DBMath.round(0.5*(defHeight - fullRectangle.getLambdaHeight()))); } /** * Method to set the default size of this PrimitiveNode. * @param defWidth the new default width of this PrimitiveNode. * @param defHeight the new default height of this PrimitiveNode. */ public void setDefSize(double defWidth, double defHeight) { getNodeProtoExtendXPref(0).setDouble(DBMath.round(0.5*(defWidth - fullRectangle.getLambdaWidth()))); getNodeProtoExtendYPref(0).setDouble(DBMath.round(0.5*(defHeight - fullRectangle.getLambdaHeight()))); } /** * Method to return the default full width of this PrimitiveNode. * @return the default width of this PrimitiveNode. */ public double getDefWidth() { return DBMath.gridToLambda(fullRectangle.getGridWidth() + 2*getDefaultGridExtendX()); } /** * Method to return the default full height of this PrimitiveNode. * @return the default height of this PrimitiveNode. */ public double getDefHeight() { return DBMath.gridToLambda(fullRectangle.getGridHeight() + 2*getDefaultGridExtendY()); } /** * Method to return the default base width of this PrimitiveNode in lambda units. * @return the default base width of this PrimitiveNode in lambda units. */ public double getDefaultLambdaBaseWidth() { return DBMath.gridToLambda(getDefaultGridBaseWidth()); } /** * Method to return the factory default base width of this PrimitiveNode in lambda units. * @return the factory default base width of this PrimitiveNode in lambda units. */ public double getFactoryDefaultLambdaBaseWidth() { return DBMath.gridToLambda(getFactoryDefaultGridBaseWidth()); } /** * Method to return the default base hwight of this PrimitiveNode in lambda units. * @return the default base height of this PrimitiveNode in lambda units. */ public double getDefaultLambdaBaseHeight() { return DBMath.gridToLambda(getDefaultGridBaseHeight()); } /** * Method to return the factory default base hwight of this PrimitiveNode in lambda units. * @return the factory default base height of this PrimitiveNode in lambda units. */ public double getFactoryDefaultLambdaBaseHeight() { return DBMath.gridToLambda(getFactoryDefaultGridBaseHeight()); } /** * Method to return the default base width of this PrimitiveNode in grid units. * @return the default base width of this PrimitiveNode in grid units. */ public long getDefaultGridBaseWidth() { return baseRectangle.getGridWidth() + 2*getDefaultGridExtendX(); } /** * Method to return the factory default base width of this PrimitiveNode in grid units. * @return the factory default base width of this PrimitiveNode in grid units. */ public long getFactoryDefaultGridBaseWidth() { return baseRectangle.getGridWidth() + 2*getFactoryDefaultGridExtendX(); } /** * Method to return the default base height of this PrimitiveNode in grid units. * @return the default base height of this PrimitiveNode in grid units. */ public long getDefaultGridBaseHeight() { return baseRectangle.getGridHeight() + 2*getDefaultGridExtendY(); } /** * Method to return the factory default base height of this PrimitiveNode in grid units. * @return the factory default base height of this PrimitiveNode in grid units. */ public long getFactoryDefaultGridBaseHeight() { return baseRectangle.getGridHeight() + 2*getFactoryDefaultGridExtendY(); } /** * Method to return the defaut extend of this PrimitiveNode over minimal width\ * in lambda units. * @return the defaut extend of this PrimitiveNode over minimal width in lambda units. */ public double getDefaultLambdaExtendX() { return DBMath.gridToLambda(getDefaultGridExtendX()); } /** * Method to return the defaut extend of this PrimitiveNode over minimal height\ * in lambda units. * @return the defaut extend of this PrimitiveNode overn ninimal height in lambda units. */ public double getDefaultLambdaExtendY() { return DBMath.gridToLambda(getDefaultGridExtendY()); } /** * Method to return the defaut extend of this PrimitiveNode over minimal width\ * in grid units. * @return the defaut extend of this PrimitiveNode over minimal width in grid units. */ public long getDefaultGridExtendX() { return DBMath.lambdaToGrid(getNodeProtoExtendXPref(0).getDouble()); } /** * Method to return the defaut extend of this PrimitiveNode over minimal height\ * in grid units. * @return the defaut extend of this PrimitiveNode overn ninimal height in grid units. */ public long getDefaultGridExtendY() { return DBMath.lambdaToGrid(getNodeProtoExtendYPref(0).getDouble()); } /** * Method to return the factory defaut extend of this PrimitiveNode over minimal width\ * in grid units. * @return the defaut extend of this PrimitiveNode over minimal width in grid units. */ public long getFactoryDefaultGridExtendX() { return DBMath.lambdaToGrid(getNodeProtoExtendXPref(0).getDoubleFactoryValue()); } /** * Method to return the factory defaut extend of this PrimitiveNode over minimal height\ * in grid units. * @return the defaut extend of this PrimitiveNode overn ninimal height in grid units. */ public long getFactoryDefaultGridExtendY() { return DBMath.lambdaToGrid(getNodeProtoExtendYPref(0).getDoubleFactoryValue()); } /** * Method to get the size offset of this PrimitiveNode. * To get the SizeOffset for a specific NodeInst, use Technology.getSizeOffset(ni). * Use this method only to get the SizeOffset of a PrimitiveNode. * @return the size offset of this PrimitiveNode. */ public SizeOffset getProtoSizeOffset() { return offset; } /** * Method to get the base (highlight) ERectangle of this PrimitiveNode. * Base ERectangle is a highlight rectangle of standard-size NodeInst of * this PrimtiveNode * To get the base ERectangle for a specific NodeInst, use Technology.getBaseRectangle(ni). * Use this method only to get the base ERectangle of a PrimitiveNode. * @return the base ERectangle of this PrimitiveNode. */ public ERectangle getBaseRectangle() { return baseRectangle; } /** * Method to get the full (true) ERectangle of this
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -