Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check + dump power straps abutting/over hardmacros #710

Merged
merged 7 commits into from
Mar 3, 2023
Merged

Conversation

harrisonliew
Copy link
Contributor

@harrisonliew harrisonliew commented Feb 24, 2023

This PR adds power strap validity checking and power strap dumping for hardmacros as requested by rahulk29/substrate#92 and could eventually be extended for hierarchical design by abutment.

A new key, par.power_straps_abutment controls the checks. If true, straps are checked for abutment. This means that all instances of a given macro must be placed on a multiple of its top layer's power strap pitch, or else an error is thrown. If false, the layer above the macro's top layer must exist. In both situations, power obstructions on the relevant layer are checked for any overlaps.

Here is a test case:

Input placement constraints
vlsi.inputs.placement_constraints:
  - path: "pass"
    type: toplevel
    x: 0
    y: 0
    width: 100
    height: 100
    margins:
      left: 0
      right: 0
      top: 0
      bottom: 0
  - path: "pass/macro"
    type: hardmacro
    x: 10
    y: 10
    width: 10
    height: 10
    master: "macro"
    top_layer: "M4"
  - path: "pass/macro_on_pitch"
    type: hardmacro
    x: 10
    y: 20.752
    width: 10
    height: 10
    master: "macro"
    top_layer: "M4"
  - path: "pass/macro_too_short"
    type: hardmacro
    x: 20
    y: 20.752
    width: 10
    height: 1
    master: "macro"
    top_layer: "M4"
  - path: "pass/macro_bad_top_layer"
    type: hardmacro
    x: 20
    y: 10
    width: 10
    height: 10
    master: "macro"
    top_layer: "M5"
  - path: "pass/misaligned_macro"
    type: hardmacro
    x: 10
    y: 40
    width: 10
    height: 10
    master: "macro"
    top_layer: "M4"
  - path: "pass/macro_bad_mirroring"
    type: hardmacro
    orientation: mx
    x: 30
    y: 10
    width: 10
    height: 10
    master: "macro"
    top_layer: "M4"
  - path: "pass/pwr_obs"
    type: obstruction
    x: 10
    y: 10
    width: 10
    height: 10
    obs_types: ["power"]
    layers: ["M4", "M5"]

Here is the output log with default ASAP7 power straps:

Hammer logger output
[par] Running sub-step 'power_straps'
[par] [M4] The desired power strap width 0.960 on M4 was quantized down to 0.864 based on the technology's width table. Please check your power grid.
[par] Hardmacro instance "pass/macro" is partially/fully obstructed on layer M4 by power obstruction "pass/pwr_obs"! Double check that you will supply power to it.
[par] Hardmacro instance "pass/macro_too_short" is placed such that a full group of power straps on layer M4 do not abut it! Double check your macro placement/size vs. power strap group pitch.
[par] [M5] The desired power strap width 0.960 on M5 was quantized down to 0.864 based on the technology's width table. Please check your power grid.
[par] [M6] The desired power strap width 1.424 on M6 was quantized down to 1.152 based on the technology's width table. Please check your power grid.
[par] [M7] The desired power strap width 1.424 on M7 was quantized down to 1.152 based on the technology's width table. Please check your power grid.
[par] Some instances of hardmacro macro have conflicting "top_layer" fields. Check your placement constraints.
[par] par.power_straps_abutment is True, but multiple instances of the same hardmacro are not placed on the same multiple of its top_layer or are mirrored across the axis parallel to that layer's direction! You must move them for abutment to work or else you must generate different versions of your hardmacros with different top layer power. Offending masters and instances are:
{
    "macro": [
        "pass/misaligned_macro",
        "pass/macro_bad_top_layer",
        "pass/macro_bad_mirroring"
    ]
}

And here is the resulting JSON file to be consumed by substrate (or humans). Note that dimensions are given in multiples of the tech's grid unit. @rahulk29 please provide feedback as to whether these fields make sense to you.

power_straps.json
[
    {
        "macro": [
            {
                "layer": "M4",
                "direction": "horizontal",
                "net_order": [
                    "VSS",
                    "VDD"
                ],
                "width": 864,
                "spacing": 288,
                "group_pitch": 10752,
                "offset": -7696,
                "inst_paths": [
                    "pass/macro",
                    "pass/macro_on_pitch",
                    "pass/macro_too_short"
                ],
                "inst_orientations": [
                    "r0",
                    "r0",
                    "r0"
                ]
            },
            {
                "layer": "M5",
                "direction": "vertical",
                "net_order": [
                    "VSS",
                    "VDD"
                ],
                "width": 864,
                "spacing": 288,
                "group_pitch": 10752,
                "inst_paths": [
                    "pass/macro",
                    "pass/macro_on_pitch",
                    "pass/macro_too_short"
                ],
                "inst_orientations": [
                    "r0",
                    "r0",
                    "r0"
                ]
            }
        ]
    },
    {
        "macro_1": [
            {
                "layer": "M4",
                "direction": "horizontal",
                "net_order": [
                    "VSS",
                    "VDD"
                ],
                "width": 864,
                "spacing": 288,
                "group_pitch": 10752,
                "offset": -5440,
                "inst_paths": [
                    "pass/misaligned_macro"
                ],
                "inst_orientations": [
                    "r0"
                ]
            },
            {
                "layer": "M5",
                "direction": "vertical",
                "net_order": [
                    "VSS",
                    "VDD"
                ],
                "width": 864,
                "spacing": 288,
                "group_pitch": 10752,
                "inst_paths": [
                    "pass/misaligned_macro"
                ],
                "inst_orientations": [
                    "r0"
                ]
            }
        ]
    },
    {
        "macro_2": [
            {
                "layer": "M5",
                "direction": "vertical",
                "net_order": [
                    "VSS",
                    "VDD"
                ],
                "width": 864,
                "spacing": 288,
                "group_pitch": 10752,
                "offset": -6944,
                "inst_paths": [
                    "pass/macro_bad_top_layer"
                ],
                "inst_orientations": [
                    "r0"
                ]
            },
            {
                "layer": "M5",
                "direction": "vertical",
                "net_order": [
                    "VSS",
                    "VDD"
                ],
                "width": 864,
                "spacing": 288,
                "group_pitch": 10752,
                "inst_paths": [
                    "pass/macro_bad_top_layer"
                ],
                "inst_orientations": [
                    "r0"
                ]
            }
        ]
    },
    {
        "macro_3": [
            {
                "layer": "M4",
                "direction": "horizontal",
                "net_order": [
                    "VSS",
                    "VDD"
                ],
                "width": 864,
                "spacing": 288,
                "group_pitch": 10752,
                "offset": -7696,
                "inst_paths": [
                    "pass/macro_bad_mirroring"
                ],
                "inst_orientations": [
                    "mx"
                ]
            },
            {
                "layer": "M5",
                "direction": "vertical",
                "net_order": [
                    "VSS",
                    "VDD"
                ],
                "width": 864,
                "spacing": 288,
                "group_pitch": 10752,
                "inst_paths": [
                    "pass/macro_bad_mirroring"
                ],
                "inst_orientations": [
                    "mx"
                ]
            }
        ]
    }
]

Copy link
Member

@rahulk29 rahulk29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks Harrison!

@harrisonliew harrisonliew added this pull request to the merge queue Mar 3, 2023
Merged via the queue into master with commit c85bd2a Mar 3, 2023
@harrisonliew harrisonliew deleted the power_abut branch March 3, 2023 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants