Skip to content

AttributeError: 'NoneType' object has no attribute 'setSigType' in apply_def_template.py when using --permissive and --copy-def-power #697

@RakshithSuresh2001

Description

@RakshithSuresh2001

Description

AttributeError: 'NoneType' object has no attribute 'setSigType' in defutil.py when running Caravel user_project_wrapper hardening with FP_TEMPLATE_MATCH_MODE=permissive and FP_TEMPLATE_COPY_POWER_PINS=True. The flow crashes at the Odb.ApplyDEFTemplate step.

Expected Behavior

The wrapper hardening flow should complete successfully when using permissive mode with power pin copying enabled. The relocate_pins() function should handle the case where odb.dbBTerm.create() returns None for pins that already exist in the design.

Environment report

OpenLane version: 2.3.10
PDK: sky130A
OS: Ubuntu 24.04 (WSL2)
Docker image: ghcr.io/efabless/openlane2:2.3.10
Design: Caravel user_project_wrapper with full-size user project macro (2860x3505 um)

Reproduction material

Config: openlane/user_project_wrapper/config.json
FP_TEMPLATE_MATCH_MODE: permissive
FP_TEMPLATE_COPY_POWER_PINS: true
FP_DEF_TEMPLATE: fixed_dont_change/user_project_wrapper.def
User project macro fills full user area on sky130A

Relevant log output

File "defutil.py", line 257, in relocate_pins
    pin_bterm.setSigType(bterm.getSigType())
    ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'setSigType'

The Fix:

# Line 257 - add None check
if pin_bterm is not None:
    pin_bterm.setSigType(bterm.getSigType())

# Line 261 - filter None from list
output_bterms = [b for b in output_bterms if b is not None]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions