You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Cadence Virtuoso是否有Skill函数获取当前设计的版图子主单元列表?

获取Cadence Virtuoso版图子主单元列表的SKILL方法

Absolutely! You’re right that ddGetObjChildren pulls in child objects across all views (like schematic, abstract, etc.)—which isn’t what you need for layout-specific master cells. Let’s fix that with targeted SKILL code:

方法1:直接指定库和单元名获取

首先,打开顶层单元的版图视图,然后遍历其中的所有实例,提取并去重主单元:

; 替换成你的库名和顶层单元名
libName = "MyLibrary"
topCellName = "TopCell"

; 打开顶层单元的版图视图
topLayoutView = dbOpenViewByType(libName topCellName "layout" "maskLayout")

; 创建一个表来存储唯一的主单元(避免重复实例的重复记录)
layoutMasterTable = makeTable('() 0)

; 遍历版图中的所有实例,提取主单元信息
foreach(inst topLayoutView~>instances
    masterCell = inst~>master
    ; 用"库名:单元名"作为键,确保每个主单元只存一次
    layoutMasterTable[concat(masterCell~>libName ":" masterCell~>cellName)] = masterCell
)

; 将表中的值转换为唯一主单元对象的列表
uniqueLayoutMasters = values(layoutMasterTable)

方法2:针对当前已打开的版图设计

如果你已经在版图编辑器中打开了顶层单元,可以直接获取当前设计对象,省去指定库和单元名的步骤:

; 获取当前打开的版图设计
currentLayoutDesign = axlGetDesign()
topLayoutView = currentLayoutDesign~>view

; 后续步骤和方法1一致
layoutMasterTable = makeTable('() 0)
foreach(inst topLayoutView~>instances
    masterCell = inst~>master
    layoutMasterTable[concat(masterCell~>libName ":" masterCell~>cellName)] = masterCell
)
uniqueLayoutMasters = values(layoutMasterTable)

说明

  • dbOpenViewByType:专门用于打开指定类型的视图(这里是layout类型,maskLayout是视图的技术类型)
  • inst~>master:每个版图实例的master属性指向它的主单元对象,包含库名、单元名等完整信息
  • 使用makeTable去重:确保同一个主单元即使被多次实例化,也只会在结果列表中出现一次

内容的提问来源于stack exchange,提问作者Roman Kaganovich

火山引擎 最新活动