在 Cadence Virtuoso 中对包含层次化 PDK 单元(如金属电阻 resm1resm2resm6 等)的电路进行 CDL 网表导出时,有时会遇到 OSSHNL-514 错误,提示 hnlCDLParamList 属性未定义。本文介绍错误成因及两种解决方案。

1. 错误现象 (Error Messages)

在执行 CDL 网表导出(Run netlist / CDL Out)时,日志中出现如下报错:

1
2
3
4
5
6
7
8
9
10
11
12
13
Begin Incremental Netlisting
Failed to netlist because the hnlCDLParamList property for hierarchical cellview 'resm1' is not defined.
Either define the hnlCDLParamList property for the cellview or assign the CDLBlackBox property to the cellview and renetlist.

Failed to find 'hnlCDLFormatInst' property for element 'resm1' for current instance resm1 in cellview db:0x059eb39a.
Ensure that it is either a black box or it has nlAction property with value = "stop".

ERROR (OSSHNL-514): Netlist generation failed because of the errors reported above.
The netlist might not have been generated at all, or the generated netlist could be corrupt.
Fix the reported errors and regenerate the netlist.

CDL netlist did not complete.
ERROR: Problem creating CDL for Module_1/1_3_Exclude_Self_Capacitance/schematic

2. 问题分析 (Root Cause)

2.1 OSS 层次化网表器的工作机制

Cadence 的 CDL 导出使用 OSS Hierarchical Netlister (HNL)。当网表器遍历设计层次时,对于每一个遇到的层次化单元(非原始器件),它需要知道:

  1. hnlCDLParamList:网表器需要知道该单元应将哪些参数写入 .subckt 定义行。
  2. hnlCDLFormatInst:网表器需要一个 SKILL 过程来格式化该单元的实例调用行。
  3. nlAction:告知网表器在遇到该单元时是否停止向下递归。

2.2 常见触发场景

  • PDK 金属电阻resm1(Metal 1 电阻)、resm2(Metal 2 电阻)、resm6(Metal 6 电阻)在 GPDK045 等 PDK 中以层次化 schematic 实现,但在 CDL 网表中应作为叶节点(leaf cell)或黑盒(black box)处理。
  • 用户自定义层次化单元:任何在 CDL 导出时被网表器识别为层次化但缺少必要属性的单元。
  • PDK 版本不完整或 CDF 配置缺失:PDK 单元未正确配置 CDL 相关的 Cellview 属性。

3. 解决方案 (Solutions)

根据 Cadence 官方建议,有两种方式可以修复此问题:

方案 A:设置 nlAction = "stop" 并定义 hnlCDLParamList(推荐用于保留参数)

此方案告知网表器在该单元处停止递归,并将指定参数写入 .subckt 定义行。

SKILL 命令(在 CIW 中执行):

; 以 resm1 为例,对 resm2、resm6 重复相同操作
let((cv)
  cv = dbOpenCellViewByType("gpdk045" "resm1" "schematic" "" "a")
  when(cv
    ; 定义需要在网表中输出的参数列表,根据实际 CDF 参数调整
    dbReplaceProp(cv "hnlCDLParamList" "list" '("w" "l"))
    ; 告知网表器在此单元处停止递归
    dbReplaceProp(cv "nlAction" "string" "stop")
    dbSave(cv)
    dbClose(cv)
    printf("resm1 schematic updated successfully.\n")
  )
)

注意hnlCDLParamList 的参数列表需与该单元实际的 CDF 参数(或网表中需要输出的参数)对应,例如电阻宽度 w、长度 l 等。请根据实际 PDK 文档确认参数名称。

UI 操作步骤:

  1. 在 Library Manager 中找到 gpdk045resm1schematic,双击打开。
  2. 菜单选择 Edit → Properties → Cellview
  3. Properties 面板中点击 Add
    • 添加属性 hnlCDLParamList,类型选 list,值填写参数列表(如 ("w" "l"))。
    • 添加属性 nlAction,类型选 string,值填写 stop
  4. 点击 OK 并保存,对 resm2resm6 重复上述步骤。
  5. 重新运行 CDL 网表导出。

方案 B:设置 CDLBlackBox 属性(黑盒处理)

此方案将单元标记为黑盒,网表器不会展开其内部层次,仅生成一个空的 .subckt 定义(或跳过定义)。适用于不需要在 CDL 中展开内部细节的情况。

SKILL 命令(在 CIW 中执行):

; 以 resm1 为例
let((cv)
  cv = dbOpenCellViewByType("gpdk045" "resm1" "schematic" "" "a")
  when(cv
    dbReplaceProp(cv "CDLBlackBox" "boolean" t)
    dbSave(cv)
    dbClose(cv)
    printf("resm1 set as CDL black box.\n")
  )
)

UI 操作步骤:

  1. 打开 resm1 的 schematic 视图。
  2. 菜单选择 Edit → Properties → Cellview
  3. 添加布尔属性 CDLBlackBox,值设为 t(true)。
  4. 保存后重新运行 CDL 导出。

方案对比

对比项 方案 A(nlAction = stop) 方案 B(CDLBlackBox)
参数输出 .subckt 行输出指定参数 不输出参数(黑盒)
内部展开 不展开,停止递归 不展开
适用场景 需要在 CDL 中保留器件参数(如 w, l) 仅需占位,不关心内部实现
常用于 PDK 基本单元(电阻、电容等) 第三方 IP 或不需导出内容的模块

4. 批量处理多个单元(SKILL 脚本)

如果有多个单元需要修复,可使用以下批处理脚本:

; 批量为 gpdk045 中的金属电阻单元设置 nlAction 和 hnlCDLParamList
let((cellList cv libName)
  libName = "gpdk045"
  cellList = '("resm1" "resm2" "resm6")
  foreach(cellName cellList
    cv = dbOpenCellViewByType(libName cellName "schematic" "" "a")
    if(cv then
      dbReplaceProp(cv "hnlCDLParamList" "list" '("w" "l"))
      dbReplaceProp(cv "nlAction" "string" "stop")
      dbSave(cv)
      dbClose(cv)
      printf("Updated: %s/%s/schematic\n" libName cellName)
    else
      printf("WARNING: Cannot open %s/%s/schematic\n" libName cellName)
    )
  )
)

执行完毕后重新运行 CDL 网表导出。

5. 排查步骤(Troubleshooting Checklist)

  1. 确认报错单元名称:从错误日志中收集所有报错的单元(resm1resm2resm6 等)。
  2. 确认单元所在库:错误信息通常指明库名,或通过 Library Manager 查找。
  3. 检查是否有写权限:若 PDK 库只读,需先将相关单元拷贝到可写库,再添加属性。
  4. 选择方案:根据是否需要参数输出,选择方案 A 或方案 B。
  5. 执行修复:通过 SKILL 命令或 UI 操作添加缺失属性。
  6. 重新导出 CDL:重新执行 CDL 网表导出,确认错误消除。
  7. 校验网表内容:检查生成的 CDL 文件,确认 .subckt 定义及参数输出符合预期。

6. 参考资料 (References)