oaModInst
模块: oapy._oa._design
导入: from oapy._oa import _design
概览
oaModInst 在 oapy 中可用,可通过 _design 模块访问。
本页汇总 oaModInst 当前在 oapy 中可用的 Python 接口。
详细说明
The oaModInst class is an abstract base class for module instances。 An instance represents the inclusion of one module (or a design containing a top module) as a part of the contents of another。 The module containing the instance is the parent module, and the module that is included is the master module of the instance。 oaModInst objects are always in the module domain。 An oaModInst can have an equivalent oaInst in the block domain and will always have an equivalent oaOccInst in the occurrence hierarchy。 Note that oaModInst::getOccInsts will return oaOccInsts only if the occurrence hierarchy has been expanded to include those objects。 See Working in the Occurrence Domain for more details。 Instances can create hierarchical designs。 The master of an instance can contain instances of other masters。 This hierarchy can continue for as many levels as needed to express a complete design。 All instances have names。 These names can be assigned by the creator。 For scalar modules, instance names can be automatically assigned by the database。 Module instances always have an InstHeader, which contains the attributes that are constant for all instances of a given master module。 However, the InstHeader class for oaModModuleInsts is oaModModuleInstHeader and the InstHeader class for oaModDesignInsts is oaModInstHeader 。 An oaModModuleInstHeader collects all the same oaModModuleInsts for a given parent module, while an oaModInstHeader collects all of the same oaModDesignInsts across an oaDesign for all parent modules。 Instances of pCells include a set of parameter values used to tailor the pCell for each specific instance。 The oaModInst class can be observed by deriving from oaObserver
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.destroy() |
| ✅ | obj.getMasterModule() |
| ✅ | obj.getName(name) |
| ✅ | obj.getName(ns, name) |
| ✅ | obj.getNumBits() |
| ✅ | obj.isBound() |
| ✅ | obj.isImplicit() |
| ✅ | obj.isModDesignInst() |
| ✅ | obj.isModModuleInst() |
| ✅ | obj.usesTermPositions() |
| ✅ | obj.scalarize() |
| ✅ | obj.getInstTerms(filterFlags=oacInstTermIterNotImplicit) |
| ✅ | obj.getAssignments() |
| ✅ | obj.getOccInsts(top) |
| ✅ | _design.oaModInst.find(module, name) |
方法说明
obj.destroy()
绑定状态: 已绑定
Python 调用: obj.destroy()
Removes this modInst from the database。 If this was the last instance of the module or design that is its master then the oaModInstHeader that it belongs to is destroyed as well。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.destroy()
obj.getMasterModule()
绑定状态: 已绑定
Python 调用: obj.getMasterModule()
This function returns the master module of this instance。 NULL is returned if the module master can not be bound。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.getMasterModule()
obj.getName(name)
绑定状态: 已绑定
Python 调用: obj.getName(name)
This function fills out name with the name of this instance。 The name is mapped according to the specified nameSpace。
参数
ns: The nameSpace used to map the name。name: The returned instance name。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.getName(name)
obj.getName(ns, name)
绑定状态: 已绑定
Python 调用: obj.getName(ns, name)
This function fills out name with the name of this instance。
参数
name: The returned instance name。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.getName(ns, name)
obj.getNumBits()
绑定状态: 已绑定
Python 调用: obj.getNumBits()
This function returns the number of bits of this instance。 This function always returns '1' for scalar and array instances。 The function can return '1' or more for vector instances。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.getNumBits()
obj.isBound()
绑定状态: 已绑定
Python 调用: obj.isBound()
This function returns a boolean value indicating whether this instance is currently bound to its master。 An instance is bound to its master if some traversal is made from the instance to the master or an object in the master。 If the instance is bound, then its master is in memory and the linkage from the instance to the master is established。
返回
- true if the instance is bound, otherwise false。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.isBound()
obj.isImplicit()
绑定状态: 已绑定
Python 调用: obj.isImplicit()
This function returns a boolean value that indicates if this instance is implicit, having been automatically created as a result of the creation of a vectorInst。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.isImplicit()
obj.isModDesignInst()
绑定状态: 已绑定
Python 调用: obj.isModDesignInst()
This function determines if this object is an instance of one of the classes derived from the oaModDesignInst class。 The function returns a boolean value of true if the oaModInst is an oaModDesignInst 。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.isModDesignInst()
obj.isModModuleInst()
绑定状态: 已绑定
Python 调用: obj.isModModuleInst()
This function determines if this object is an instance of one of the classes derived from the oaModModuleInst class。 The function returns a boolean value of true if the oaModInst is an oaModModuleInst 。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.isModModuleInst()
obj.usesTermPositions()
绑定状态: 已绑定
Python 调用: obj.usesTermPositions()
This function returns a boolean indicating how connections to this instance have been made。 If the instTerms associated with this instance connect to terminal positions, this function returns true。 Otherwise, this function returns false。 Note that if the collection of instTerms for this instance is empty, this function will also return false。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.usesTermPositions()
obj.scalarize()
绑定状态: 已绑定
Python 调用: obj.scalarize()
This function insures that the bitInsts associated with this instance have been promoted to the explicit state so that they can support implementation data。 If this instance is a multibit instance, this function insures that all constituent bitInsts are promoted to the explicit state。 The multibit instance is then demoted to the implicit state so that no implementation data can be associated with it。 When an instance is demoted to the implicit state, associated implementation data is removed from it。 When an instance is scalarized, all of its connections are also scalarized。 Each bit of any multi-bit connection associated with the instance is promoted to the explicit state and is available for editing。
异常
oacCannotScalarizeImplicitInst。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.scalarize()
obj.getInstTerms(filterFlags=oacInstTermIterNotImplicit)
绑定状态: 已绑定
Python 调用: obj.getInstTerms(filterFlags=oacInstTermIterNotImplicit)
This function returns a collection of module instTerms associated with this instance。 When oacInstTermIterNotImplicit is included in filterFlags, the collection will only contain explicit instTerms associated with the instance When oacInstTermIterSingleBit is included in filterFlags, the collection will only contain instTerms that make a single-bit connection to the instance。
参数
filterFlags: Specifies which types of instTerms to include in the collection。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.getInstTerms(filterFlags=oacInstTermIterNotImplicit)
obj.getAssignments()
绑定状态: 已绑定
Python 调用: obj.getAssignments()
This function returns a collection of module assignments associated with this instance。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.getAssignments()
obj.getOccInsts(top)
绑定状态: 已绑定
Python 调用: obj.getOccInsts(top)
This function returns a collection of occurrence instances associated with this instance in the design hierarchy under the specified 'top' occurrence。 It is an error if the specified top occurrence is not in the same design as this module instance is in。
Python 示例
from oapy._oa import _design
# assume obj is a oaModInst
obj.getOccInsts(top)
_design.oaModInst.find(module, name)
绑定状态: 已绑定
Python 调用: _design.oaModInst.find(module, name)
This function searches the specified module for an instance with the specified name。 If the name is hierarchical, then this function searches for the instance as specified in the hierarchical path name。 If found, the instance is returned。 Otherwise, NULL is returned。
参数
module: The module to search。name: The instance name to find。
返回
- A pointer to the module instance, if found; otherwise, NULL。
Python 示例
from oapy._oa import _design
_design.oaModInst.find(module, name)