首页 / dm / oaLib

oaLib

模块: oapy._oa._dm 导入: from oapy._oa import _dm

概览

oaLiboapy 提供的库管理入口,用于创建、打开和查询 OA 库。

本页汇总 oaLib 当前在 oapy 中可用的 Python 接口。

详细说明

An oaLib is a collection of design data represented as a library database and library data。 The library database contains all information about the on-disk library including the cells, views, cellViews, associated data files on disk, and associated information about this data。 Libraries have several different roles and purposes: Design libraries contain the user-created parts of a design hierarchy, including all the data and design components that make up a design。 Reference libraries contain the master copies of the cells you can reference in a design。 Technology libraries contain the technology parameters that correspond to a particular design methodology and fabrication technology。 These parameters typically are contained in a technology database ( oaTech )。 It is possible to store all these types of data in a single library。 Usually, however, the reference data and technology parameters are stored in a single library。 A library is also a logical container object that contains cells, views, cellViews, and files, as follows: A cell ( oaCell ) is a container object that contains cellViews and files。 A single cell contains the data that describe an individual building block of a chip or system。 A cell can contain multiple cellViews, each of which represent a different view of this cell。 A view ( oaView ) is a container object that contains cellViews and files。 A view is a specific representation of a cell。 Different views can represent levels of abstraction for a design (behavior or gate), or different stages in the design process (RTL, post-synthesis, placed, routed)。 Each view has a designated viewType, which is persistent。 The oaViewType utility class is used to represent a viewType。 There are several reserved viewTypes used by OpenAccess, which are represented in the oaReservedViewType enum wrapper class。 You can specify the view type with the viewType argument to oaDesign::open 。 A cellView ( oaCellView ) is a container object that contains files。 CellViews also can contain OpenAccess databases such as an oaDesign or oaWafer 。 A cellView will always have a single oaDMFile that holds the primary data for the cellView and is known as the primary file。 This correlates to the master file definition in previous versions of OpenAccess。 The view's viewType attribute indicates the type of this file。 The primary oaDMFile can be empty (or not exist on disk)。 A file ( oaDMFile ) contains data。 Files can be created or modified using the oaDMFile API。 The oaLib class can be observed by deriving from oaObserver 。 Library Access Before any library structure data -- such as oaCells, oaViews, oaCellViews, oaDMFiles, and their attributes -- is accessed, the application must obtain read library access。 Before changing anything in the library structure, the application must obtain write library access。 Read and write library access is obtained through the appropriate oaLib::getAccess call。 For example, read-only oaLib functions, such as oaLib::getCells , oaLib::getViews , and oaLib::getCellViews , require read access to the library, and set() functions, such as oaLib::setAttributes , require write access to the library。 However, oaLib static functions and oaLib functions that access static data on an oaLib, such as oaLib::create , oaLib::open , or oaLib::find , do not require library access。 Note: If an oaLib function requires library access, this requirement is noted in the function description。 If the library access must be write access, this requirement also is noted。 You can use oaLib::hasAccess(), oaLib::hasWriteAccess and oaLib::getAccessType() to obtain information about library access status。 Library access persists until ended through an oaLib::releaseAccess call。 The OpenAccess design, wafer, tech, and parasitic database functions have library access built in -- users do not have to obtain library access to open or modify the oaDesign , oaWafer , oaTech , and parasitics databases。 Before opening any of these database objects, OpenAccess first looks to see if the user has obtained library access; if not, OpenAccess will attempt to get access。 If Open Access cannot get library access, an exception is thrown。 When OA obtains library access, it is held for as short a time as possible within the span of the API call。 For more Information on accessing and working with OpenAccess libraries, see OpenAccess 2.2 Libraries and Design Management in the Programmers Guide。

方法总览

状态 Python 调用
obj.close()
obj.getName(name)
obj.getName(ns, out)
obj.getPath(path)
obj.getFullPath(fullPath)
obj.getWritePath(writePath)
obj.getMode()
obj.getDMSystemName(dmSystem)
obj.getAttributes(attrs)
obj.isReadable()
obj.isWritable()
obj.isMarkedToBeClosed()
obj.setAttributes(attrs)
obj.getAccess(accessType, timeout=0)
obj.releaseAccess()
obj.getAccessLevel()
obj.hasVC()
obj.calcVMSize()
obj.getControlledObjects(depth=oacCellViewFileVCQueryDepth, top=NULL, localOnly=false)
obj.getWorkingVersions(depth=oacCellViewFileVCQueryDepth)
obj.getCells()
obj.getViews()
obj.getViewsByName(name)
obj.getCellViews()
obj.getGroups()
obj.getGroups(def)
obj.getGroupsByName(name)
_dm.oaLib.create(name, libPath, mode=oacSharedLibMode, dmSystem="oaDMSystem", dmAttrList=NULL)
_dm.oaLib.open(name, libPath, writePath="", mode=oacSharedLibMode)
_dm.oaLib.find(name)
_dm.oaLib.exists(libPath)
_dm.oaLib.getOpenLibs()

方法说明

obj.close()

绑定状态: 已绑定

Python 调用: obj.close()

This function closes the library。 All of its contents become inaccessible, all its library access calls are released, and its non-committed changes are lost。 Note: This function does not require library access。 For more information on library access, see classoaLib.html Library Access in the detailed description for oaLib。 classoaLib.html classoaLib.html。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.close()

obj.getName(name)

绑定状态: 已绑定

Python 调用: obj.getName(name)

This function returns the name of this library。 The name is returned as an oaString mapped to the specified namespace。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getName(name)

obj.getName(ns, out)

绑定状态: 已绑定

Python 调用: obj.getName(ns, out)

This function returns the name of this library。 The name is returned as an oaScalarName 。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getName(ns, out)

obj.getPath(path)

绑定状态: 已绑定

Python 调用: obj.getPath(path)

This function returns the path to this library。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • path: the path to the library directory is returned in this oaString 。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getPath(path)

obj.getFullPath(fullPath)

绑定状态: 已绑定

Python 调用: obj.getFullPath(fullPath)

This function returns the full (absolute) path to this library。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • fullPath: output parameter - the returned full (absolute) path to this library。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getFullPath(fullPath)

obj.getWritePath(writePath)

绑定状态: 已绑定

Python 调用: obj.getWritePath(writePath)

This function returns the write path to this library。 This is the path to the directory that may be used as a place to create temporary files (using oaDMObject::getTempFile )。 The writePath is a non-persistent attribute of the library。 If the library is opened using oaLib::create , the writePath is the same as the library path。 If the library is opened using oaLib::open , the writePath can be specified through the oaLib::open API。 When a library is specified in the library definition file (see oaLibDefList Detailed Description), the writePath may be specified as an attribute using the ASSIGN syntax, with the library attribute name of "writePath"。 If the writePath is not specified, it will default to the library path。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • writePath: the returned write path for this library。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getWritePath(writePath)

obj.getMode()

绑定状态: 已绑定

Python 调用: obj.getMode()

This function returns the access mode of this library。 This is the mode that was passed in when the library was opened or created。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getMode()

obj.getDMSystemName(dmSystem)

绑定状态: 已绑定

Python 调用: obj.getDMSystemName(dmSystem)

This function returns the name of the DMSystem associated with this library。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • dmSystem: output parameter - the returned name of the DMSystem associated with this file。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getDMSystemName(dmSystem)

obj.getAttributes(attrs)

绑定状态: 已绑定

Python 调用: obj.getAttributes(attrs)

This function returns the attributes defined for this library and its Design Management (DM) and Version Control (VC) systems when the library was created。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to the library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • attrs: Contains the list of attributes associated with the library and its DM and VC systems。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getAttributes(attrs)

obj.isReadable()

绑定状态: 已绑定

Python 调用: obj.isReadable()

This function returns true if the library is readable; false if not。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.isReadable()

obj.isWritable()

绑定状态: 已绑定

Python 调用: obj.isWritable()

This function returns true if the library is writable; false if not。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.isWritable()

obj.isMarkedToBeClosed()

绑定状态: 已绑定

Python 调用: obj.isMarkedToBeClosed()

This function returns a boolean indicating whether or not this library is marked to be closed。 Libraries can be marked "to be closed" when the current session's library definitions are being reloaded from the library definitions file。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.isMarkedToBeClosed()

obj.setAttributes(attrs)

绑定状态: 已绑定

Python 调用: obj.setAttributes(attrs)

This function sets the attributes specified in the given attrList array for this library and its associated Design Management (DM) and Version Control (VC) systems。 The attributes are specific to the DM and VC systems, which may impose restrictions on what attributes may be changed。 Note: This function requires write access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if write access to this library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • attrs: Contains the attributes to set for the library and its associated DM and VC systems。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.setAttributes(attrs)

obj.getAccess(accessType, timeout=0)

绑定状态: 已绑定

Python 调用: obj.getAccess(accessType, timeout=0)

This function tries to get the requested access for the library。 A boolean is returned which indicates success or failure。 Library access cannot be upgraded (changed from read to write), so an exception is thrown if this is attempted。

参数

  • accessType: the type of access requested on this library。
  • timeout: an optional timeout in seconds for the function to wait to obtain the requested access。

异常

  • oacLibAccessCannotUpgrade

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getAccess(accessType, timeout=0)

obj.releaseAccess()

绑定状态: 已绑定

Python 调用: obj.releaseAccess()

This function requests that the current access on this library be released。 An exception is thrown if the library is not currently being accessed。

异常

  • oacLibReleaseNoAccess

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.releaseAccess()

obj.getAccessLevel()

绑定状态: 已绑定

Python 调用: obj.getAccessLevel()

This function returns the level of access that the user has on the library。 There are three levels of access: no access, read access, and write access。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getAccessLevel()

obj.hasVC()

绑定状态: 已绑定

Python 调用: obj.hasVC()

This function returns a boolean that indicates whether or not the library has a version control system associated with it。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.hasVC()

obj.calcVMSize()

绑定状态: 已绑定

Python 调用: obj.calcVMSize()

This function calculates and returns the amount of virtual memory this library database is currently using。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.calcVMSize()

obj.getControlledObjects(depth=oacCellViewFileVCQueryDepth, top=NULL, localOnly=false)

绑定状态: 已绑定

Python 调用: obj.getControlledObjects(depth=oacCellViewFileVCQueryDepth, top=NULL, localOnly=false)

This function returns an array of the objects that the version control system reports as being controlled in this library。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to this library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。 oacCellVCQueryDepth: stop the query at the Cell level, not including "cell files" oacViewVCQueryDepth: stop the query at the View level, not including "view files" oacCellViewVCQueryDepth: stop the query at the CellView level, not including "cellView" files oacCellViewFileVCQueryDepth: stop the query at the CellView file level。 This is currently the lowest level oacMaxQueryDepth: query to the bottom of the hierarchy。

参数

  • depth: this parameter is used to control the depth that this function will go in the hierarchy when applying this operation。 The enum values have the following meanings:。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getControlledObjects(depth=oacCellViewFileVCQueryDepth, top=NULL, localOnly=false)

obj.getWorkingVersions(depth=oacCellViewFileVCQueryDepth)

绑定状态: 已绑定

Python 调用: obj.getWorkingVersions(depth=oacCellViewFileVCQueryDepth)

This function retrieves the version information of this library。 The version information reported back is the version of the file that is currently visible in the user's workspace。 The objects in the array must all be versionable and belong to this library。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to this library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。 oacCellVCQueryDepth: stop the query at the Cell level, not including "cell files" oacViewVCQueryDepth: stop the query at the View level, not including "view files" oacCellViewVCQueryDepth: stop the query at the CellView level, not including "cellView" files oacCellViewFileVCQueryDepth: stop the query at the CellView file level。 This is currently the lowest level oacMaxQueryDepth: query to the bottom of the hierarchy。

参数

  • depth: this parameter is used to control the depth that this function will go in the hierarchy when applying this operation。 The enum values have the following meanings:。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getWorkingVersions(depth=oacCellViewFileVCQueryDepth)

obj.getCells()

绑定状态: 已绑定

Python 调用: obj.getCells()

This function returns a collection of cells in this library。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to this library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getCells()

obj.getViews()

绑定状态: 已绑定

Python 调用: obj.getViews()

This function returns a collection of views in this library。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to this library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getViews()

obj.getViewsByName(name)

绑定状态: 已绑定

Python 调用: obj.getViewsByName(name)

This function returns a collection of views in this library database with the specified name。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to this library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getViewsByName(name)

obj.getCellViews()

绑定状态: 已绑定

Python 调用: obj.getCellViews()

This function returns a collection of cellViews in this library。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to this library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getCellViews()

obj.getGroups()

绑定状态: 已绑定

Python 调用: obj.getGroups()

This functions return a collection of groups in this lib database with the specified group definition。

参数

  • def: input group definition。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getGroups()

obj.getGroups(def)

绑定状态: 已绑定

Python 调用: obj.getGroups(def)

This function returns a collection of groups in this lib database。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to this library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getGroups(def)

obj.getGroupsByName(name)

绑定状态: 已绑定

Python 调用: obj.getGroupsByName(name)

This function returns a collection of groups in this library database with the specified name。 Note: This function requires access to this library (through oaLib::getAccess )。 An oacLibAccessDenied exception is thrown if access to the library does not exist。 For more information on library access, see Library Access in the detailed description for oaLib。

异常

  • oacLibAccessDenied

Python 示例

from oapy._oa import _dm

# assume obj is a oaLib
obj.getGroupsByName(name)

_dm.oaLib.create(name, libPath, mode=oacSharedLibMode, dmSystem="oaDMSystem", dmAttrList=NULL)

绑定状态: 已绑定

Python 调用: _dm.oaLib.create(name, libPath, mode=oacSharedLibMode, dmSystem="oaDMSystem", dmAttrList=NULL)

This function creates the library using the specified name and attributes。 The directory specified by libPath will be created to hold the library files。 Example: If libPath is specified as usr1/mylibs/project1/cells , the /usr1/mylibs/project1/ parent directory must exist and /usr1/mylibs/project1/cells must not exist。 Note that the creator of a library is responsible for adding the library definition (library name and path) of the newly-created library in the library definition file used by OpenAccess applications (see oaLibDefFile::addLib for more information)。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

oapy 额外提供了便捷短重载 oaLib.create(name, libPath)

参数

  • name: the name of the library to create。
  • libPath: an absolute or relative path to the library directory。 The specified directory will be created to hold the library files。
  • mode: the access mode of the library to create。
  • dmSystem: the dmSystem name of the library to create。
  • dmAttrList: A list of persistent attributes to be given to the new library。 The set of valid attribute names and values are defined by a specific DM system and the Version Control system that it uses。

异常

  • oacLibNameExists: - a library with the specified name already exists。
  • oacLibCouldNotCreate: - libPath is an empty string; it specifies the name of an existing file or a non-empty directory; or the directory specified by libPath is not writeable。

Python 示例

from oapy._oa import _dm

lib = _dm.oaLib.create("demo_lib", "/tmp/demo_lib")

_dm.oaLib.open(name, libPath, writePath="", mode=oacSharedLibMode)

绑定状态: 已绑定

Python 调用: _dm.oaLib.open(name, libPath, writePath="", mode=oacSharedLibMode)

This function opens an existing library at the given path, using the specified name and attributes。 An oacCannotOpenOpenedLib exception is thrown if the library is open。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • name: the name of the library to open。
  • libPath: an absolute or relative path to the library directory。
  • writePath: the path that is writable for the opened library。
  • mode: the mode of the library to open。

异常

  • oacCannotOpenOpenedLib

Python 示例

from oapy._oa import _dm

lib = _dm.oaLib.open("demo_lib", "/tmp/demo_lib")

_dm.oaLib.find(name)

绑定状态: 已绑定

Python 调用: _dm.oaLib.find(name)

This function attempts to find an open library with the specified name。 If found, a pointer to the library is returned。 If the library cannot be found, NULL is returned。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • name: the name of the library to be found。

Python 示例

from oapy._oa import _dm

_dm.oaLib.find(name)

_dm.oaLib.exists(libPath)

绑定状态: 已绑定

Python 调用: _dm.oaLib.exists(libPath)

This function returns true if a library directory exists at the given libPath。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

参数

  • libPath: an absolute or relative path to the library directory。

Python 示例

from oapy._oa import _dm

_dm.oaLib.exists(libPath)

_dm.oaLib.getOpenLibs()

绑定状态: 已绑定

Python 调用: _dm.oaLib.getOpenLibs()

This function returns a collection of open library databases。 Note: This function does not require library access。 For more information on library access, see Library Access in the detailed description for oaLib。

Python 示例

from oapy._oa import _dm

_dm.oaLib.getOpenLibs()