Skip to content

Commit

Permalink
Add support for manual_override of standard cells.
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ansell <[email protected]>
  • Loading branch information
mithro committed Sep 18, 2023
1 parent 3ba0ef0 commit 781a9a0
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions pdk/proto/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,24 @@ def _extract_lef_and_liberty_impl(ctx):
content = []
out_files = []

for file in standard_cell.cell_lef_definitions:
content.append("cell_lef_paths: \"{}\"".format(file.short_path))
out_files.extend(standard_cell.cell_lef_definitions)
manual_override = ctx.attr.cell_lef_paths or ctx.attr.tech_lef_path or ctx.attr.liberty_path

if not manual_override:
for file in standard_cell.cell_lef_definitions:
content.append("cell_lef_paths: \"{}\"".format(file.short_path))
out_files.extend(standard_cell.cell_lef_definitions)

content.append("tech_lef_path: \"{}\"".format(standard_cell.tech_lef.short_path))
out_files.append(standard_cell.tech_lef)

content.append("liberty_path: \"{}\"".format(standard_cell.default_corner.liberty.short_path))
out_files.append(standard_cell.default_corner.liberty)
else:
for file in ctx.attr.cell_lef_paths:
content.append("cell_lef_paths: \"{}\"".format(file))

content.append("tech_lef_path: \"{}\"".format(ctx.attr.tech_lef_path))
content.append("liberty_path: \"{}\"".format(ctx.attr.liberty_path))

content.append("tech_lef_path: \"{}\"".format(standard_cell.tech_lef.short_path))
out_files.append(standard_cell.tech_lef)
Expand Down Expand Up @@ -121,5 +136,8 @@ extract_lef_and_liberty = rule(
implementation = _extract_lef_and_liberty_impl,
attrs = {
"standard_cell": attr.label(providers = [StandardCellInfo]),
"cell_lef_paths": attr.string_list(),
"tech_lef_path": attr.string(),
"liberty_path": attr.string(),
},
)

0 comments on commit 781a9a0

Please sign in to comment.