Skip to content

Commit

Permalink
Merge pull request #331 from ericastor/main
Browse files Browse the repository at this point in the history
Add support for default input-driver and output-load cells to cell libraries
  • Loading branch information
QuantamHD authored Jun 6, 2024
2 parents 7a6dbc1 + e38e933 commit 9a73ccd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
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,
)

0 comments on commit 9a73ccd

Please sign in to comment.