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

Add support for default input-driver and output-load cells to cell libraries #331

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dependency_support/com_google_skywater_pdk/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def _skywater_cell_library_impl(ctx):
tech_lef = tech_lef,
cell_lef_definitions = cell_lef_files,
platform_gds = platform_gds_files,
default_input_driver_cell = ctx.attr.default_input_driver_cell,
default_output_load = ctx.attr.default_output_load,
),
]

Expand All @@ -112,6 +114,14 @@ skywater_cell_library = rule(
"default_corner": attr.string(
mandatory = True,
),
"default_input_driver_cell": attr.string(
default = "",
doc = "Cell to assume drives primary input nets",
),
"default_output_load": attr.string(
default = "",
doc = "Cell to assume is being driven by each primary output",
),
"openroad_configuration": attr.label(
providers = [OpenRoadPdkInfo],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ load("@rules_hdl//dependency_support/com_google_skywater_pdk:build_defs.bzl", "s
load("@rules_hdl//dependency_support/com_google_skywater_pdk:cells_info.bzl", "sky130_cell_normalize")
load(":cell_libraries.bzl", "CELL_LIBRARIES")

def declare_cell_library(workspace_name, name):
def declare_cell_library(workspace_name, name, default_input_driver_cell = "", default_output_load = ""):
"""This should be called from the BUILD file of a cell library workspace. It sets up the targets for the generated files of the given library.

Args:
workspace_name: The name of the skywater workspace
name: The name of the top level standard cell library
default_input_driver_cell: Cell to assume drives primary input nets
default_output_load: Cell to assume is being driven by each primary output
"""
native.filegroup(
name = "spice_models",
Expand Down Expand Up @@ -86,6 +88,8 @@ def declare_cell_library(workspace_name, name):
visibility = ["//visibility:public"],
openroad_configuration = library.get("open_road_configuration", None),
tech_lef = "tech/{}.tlef".format(name) if library.get("library_type", None) != "ip_library" else None,
default_input_driver_cell = default_input_driver_cell,
default_output_load = default_output_load,
)

# Multi-corner library
Expand Down Expand Up @@ -115,4 +119,6 @@ def declare_cell_library(workspace_name, name):
visibility = ["//visibility:public"],
openroad_configuration = library.get("open_road_configuration", None),
tech_lef = "tech/{}.tlef".format(name) if library.get("library_type", None) != "ip_library" else None,
default_input_driver_cell = default_input_driver_cell,
default_output_load = default_output_load,
)
Loading