Skip to content

Commit

Permalink
Merge branch 'temp-fix-asap7' into asap7-improve-2
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Nov 7, 2023
2 parents 9508260 + ca1e78a commit 2b6e962
Show file tree
Hide file tree
Showing 14 changed files with 308 additions and 17 deletions.
11 changes: 11 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ llvm_toolchain(
# },
)

maybe(
http_archive,
name = "rules_7zip",
strip_prefix = "rules_7zip-e00b15d3cb76b78ddc1c15e7426eb1d1b7ddaa3e",
urls = ["https://github.com/zaucy/rules_7zip/archive/e00b15d3cb76b78ddc1c15e7426eb1d1b7ddaa3e.zip"],
sha256 = "fd9e99f6ccb9e946755f9bc444abefbdd1eedb32c372c56dcacc7eb486aed178",
)

load("@rules_7zip//:setup.bzl", "setup_7zip")
setup_7zip()

maybe(
http_archive,
name = "rules_proto",
Expand Down
6 changes: 4 additions & 2 deletions dependency_support/dependency_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ load("@rules_hdl//dependency_support/org_sourceware_bzip2:org_sourceware_bzip2.b
load("@rules_hdl//dependency_support/org_sourceware_libffi:org_sourceware_libffi.bzl", "org_sourceware_libffi")
load("@rules_hdl//dependency_support/org_swig:org_swig.bzl", "org_swig")
load("@rules_hdl//dependency_support/org_theopenroadproject:org_theopenroadproject.bzl", "org_theopenroadproject")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7:org_theopenroadproject_asap7.bzl", "org_theopenroadproject_asap7")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:org_theopenroadproject_asap7_pdk_r1p7.bzl", "org_theopenroadproject_asap7_pdk_r1p7")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7sc7p5t_28:org_theopenroadproject_asap7sc7p5t_28.bzl", "org_theopenroadproject_asap7sc7p5t_28")
load("@rules_hdl//dependency_support/pybind11:pybind11.bzl", "pybind11")
load("@rules_hdl//dependency_support/tk_tcl:tk_tcl.bzl", "tk_tcl")
load("@rules_hdl//dependency_support/verilator:verilator.bzl", "verilator")
Expand Down Expand Up @@ -103,7 +104,8 @@ def dependency_support():
org_sourceware_libffi()
org_swig()
org_theopenroadproject()
org_theopenroadproject_asap7()
org_theopenroadproject_asap7_pdk_r1p7()
org_theopenroadproject_asap7sc7p5t_28()
pybind11()
tk_tcl()
verilator()
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

<<<<<<<< HEAD:dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7-sc7p5t_rev27_rvt-cells.bzl
# ASAP7 "rev 27" 7.5 track standard cell library using regular VT transistors
# ------------------------------------------------------------------------
asap7_cells_files(
Expand All @@ -20,6 +21,26 @@ asap7_cells_files(
tracks = "7p5t",
vt = "rvt",
has_gds = True,
========
"""Arizona State University 7nm PDK"""

load("@rules_hdl//pdk:open_road_configuration.bzl", "open_road_pdk_configuration")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:asap7.bzl", "asap7_cell_library")

asap7_cell_library(
name = "asap7_rvt_1x",
srcs = glob(["LIB/CCS/*.lib.7z"]),
cell_lef = "LEF/asap7sc7p5t_28_R_1x_220121a.lef",
cell_type = "RVT",
platform_gds = "GDS/asap7sc7p5t_28_R_220121a.gds",
default_corner_delay_model = "ccs",
default_corner_swing = "SS",
openroad_configuration = ":open_road_asap7_1x",
tech_lef = "techlef_misc/asap7_tech_1x_201209.lef",
visibility = [
"//visibility:public",
]
>>>>>>>> temp-fix-asap7:dependency_support/org_theopenroadproject_asap7sc7p5t_28/bundled.BUILD.bazel
)

open_road_pdk_configuration(
Expand Down Expand Up @@ -54,17 +75,22 @@ open_road_pdk_configuration(
"M7": "0.5",
},
global_routing_signal_layers = "M2-M7",
<<<<<<<< HEAD:dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7-sc7p5t_rev27_rvt-cells.bzl
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:asap7.lyt",
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:pdn_config_1x.pdn",
========
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:asap7.lyt",
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:pdn_config.pdn",
>>>>>>>> temp-fix-asap7:dependency_support/org_theopenroadproject_asap7sc7p5t_28/bundled.BUILD.bazel
pin_horizontal_metal_layer = "M4",
pin_vertical_metal_layer = "M5",
rc_script_configuration = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:rc_script.tcl",
rc_script_configuration = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:rc_script.tcl",
tap_cell = "TAPCELL_ASAP7_75t_R",
tapcell_distance = 25,
tie_high_port = "TIEHIx1_ASAP7_75t_R/H",
tie_low_port = "TIELOx1_ASAP7_75t_R/L",
tie_separation = 0,
tracks_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:tracks.tcl",
tracks_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:tracks.tcl",
wire_rc_clock_metal_layer = "M5",
wire_rc_signal_metal_layer = "M2",
)
39 changes: 39 additions & 0 deletions dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
load("@rules_hdl//pdk:build_defs.bzl", "CornerInfo", "StandardCellInfo")
load("@rules_hdl//pdk:open_road_configuration.bzl", "OpenRoadPdkInfo")

<<<<<<< HEAD

def asap7_srams_files(name=None, rev=None, tracks=None, has_gds=True):
if rev not in ["26", "27", "28"]:
Expand Down Expand Up @@ -148,17 +149,39 @@ def _asap7_cell_library_impl(ctx):
uncompressed_files = []
for file in liberty_files:
uncompressed_file = ctx.actions.declare_file(file.basename[:-len(".gz")])
=======
def _asap7_cell_library_impl(ctx):
liberty_files = [file for file in ctx.files.srcs if file.extension == "7z"]
liberty_files = [file for file in liberty_files if "_{}_".format(ctx.attr.default_corner_delay_model) in file.basename]
liberty_files = [file for file in liberty_files if "SRAM" not in file.basename]
liberty_files = [file for file in liberty_files if ctx.attr.cell_type in file.basename]

uncompressed_files = []
for file in liberty_files:
uncompressed_file = ctx.actions.declare_file(file.basename[:-len(".7z")])
>>>>>>> temp-fix-asap7
ctx.actions.run_shell(
outputs = [
uncompressed_file,
],
inputs = [
file,
],
<<<<<<< HEAD
command = "gunzip --to-stdout {compressed_file} > {uncompressed_file}".format(
compressed_file = file.path,
uncompressed_file = uncompressed_file.path,
),
=======
command = "{tool} x -so -- {compressed_file} > {uncompressed_file}".format(
tool = ctx.executable._uncompress.path,
compressed_file = file.path,
uncompressed_file = uncompressed_file.path,
),
tools = [
ctx.executable._uncompress,
],
>>>>>>> temp-fix-asap7
)

uncompressed_files.append(uncompressed_file)
Expand Down Expand Up @@ -204,14 +227,30 @@ asap7_cell_library = rule(
"tech_lef": attr.label(allow_single_file = True, mandatory = True, doc = "The tech lef file for these standard cells"),
"default_corner_swing": attr.string(mandatory = True, values = ["SS", "FF", "TT"]),
"default_corner_delay_model": attr.string(mandatory = True, values = ["ccs", "ccsn", "ccsa"]),
<<<<<<< HEAD
#TODO(b/212480812): Support multiple VTs in a single design.
"openroad_configuration": attr.label(providers = [OpenRoadPdkInfo]),
"cell_lef": attr.label(allow_single_file = True, mandatory = True, doc = "The lef file for the standard cells"),
"platform_gds": attr.label(allow_single_file = True, mandatory = False, doc = "Platform GDS files"),
=======
"cell_type": attr.string(mandatory = True, values = ["RVT", "LVT", "SLVT"]),
#TODO(b/212480812): Support multiple VTs in a single design.
"openroad_configuration": attr.label(providers = [OpenRoadPdkInfo]),
"cell_lef": attr.label(allow_single_file = True, mandatory = True, doc = "The lef file for the standard cells"),
"platform_gds": attr.label(allow_single_file = True, mandatory = True, doc = "Platform GDS files"),
>>>>>>> temp-fix-asap7
"_combine_liberty": attr.label(
default = Label("@rules_hdl//pdk/liberty:combine_liberty"),
executable = True,
cfg = "exec",
),
<<<<<<< HEAD
=======
"_uncompress": attr.label(
default = Label("@7zip//:7za"),
executable = True,
cfg = "exec",
),
>>>>>>> temp-fix-asap7
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

<<<<<<< HEAD
# DO NOT EDIT - This file is generated by `build-BUILD.py` script!

"""
Expand Down Expand Up @@ -743,3 +744,7 @@ open_road_pdk_configuration(
wire_rc_clock_metal_layer = "M5",
wire_rc_signal_metal_layer = "M2",
)
=======
"""Arizona State University 7nm PDK"""

>>>>>>> temp-fix-asap7
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def org_theopenroadproject_asap7():
def org_theopenroadproject_asap7_pdk_r1p7():
maybe(
http_archive,
name = "org_theopenroadproject_asap7",
name = "org_theopenroadproject_asap7_pdk_r1p7",
urls = [
"https://github.com/The-OpenROAD-Project/asap7/archive/cd13de4e603913291ec6b8401ab63ec481178a5a.tar.gz",
"https://github.com/The-OpenROAD-Project/asap7_pdk_r1p7/archive/1ff7649bbf423207f6f70293dc1cf630cd477365.tar.gz"
],
strip_prefix = "asap7-cd13de4e603913291ec6b8401ab63ec481178a5a",
sha256 = "1820b732362852ec9658695c7509dd81eda571bb6b64def48ff92e2fab78fbe8",
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7:bundled.BUILD.bazel"),
strip_prefix = "asap7_pdk_r1p7-1ff7649bbf423207f6f70293dc1cf630cd477365",
sha256 = "b5847f93e55debb49d03ec581e22eb301109ff90c9ad19d35ae1223c70250391",
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:bundled.BUILD.bazel"),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Registers Bazel workspaces for the Boost C++ libraries."""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def org_theopenroadproject_asap7_pdk_r1p7():
maybe(
http_archive,
name = "org_theopenroadproject_asap7_pdk_r1p7",
urls = [
"https://github.com/The-OpenROAD-Project/asap7_pdk_r1p7/archive/1ff7649bbf423207f6f70293dc1cf630cd477365.tar.gz"
],
strip_prefix = "asap7_pdk_r1p7-1ff7649bbf423207f6f70293dc1cf630cd477365",
sha256 = "b5847f93e55debb49d03ec581e22eb301109ff90c9ad19d35ae1223c70250391",
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:bundled.BUILD.bazel"),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Floorplan information - core boundary coordinates, std. cell row height,

set ::halo 2

# POWER or GROUND #Std. cell rails starting with power or ground rails at the bottom of the core area
set ::rails_start_with "POWER" ;

# POWER or GROUND #Upper metal stripes starting with power or ground rails at the left/bottom of the core area
set ::stripes_start_with "POWER" ;

# Power nets
set ::power_nets "VDD"
set ::ground_nets "VSS"

####################################
# global connections
####################################
add_global_connection -defer_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power
add_global_connection -defer_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$}
add_global_connection -defer_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$}
add_global_connection -defer_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground
add_global_connection -defer_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$}
global_connect
####################################
# voltage domains
####################################
set_voltage_domain -name {CORE} -power {VDD} -ground {VSS}
####################################
# standard cell grid
####################################
define_pdn_grid -name {top} -voltage_domains {CORE}
add_pdn_stripe -grid {top} -layer {M1} -width {0.018} -pitch {0.54} -offset {0} -followpins
add_pdn_stripe -grid {top} -layer {M2} -width {0.018} -pitch {0.54} -offset {0} -followpins
add_pdn_stripe -grid {top} -layer {M5} -width {0.12} -spacing {0.072} -pitch {11.88} -offset {0.300}
add_pdn_stripe -grid {top} -layer {M6} -width {0.288} -spacing {0.096} -pitch {12} -offset {0.513}
add_pdn_connect -grid {top} -layers {M1 M2}
add_pdn_connect -grid {top} -layers {M2 M5}
add_pdn_connect -grid {top} -layers {M5 M6}

pdn::allow_repair_channels true
13 changes: 13 additions & 0 deletions dependency_support/org_theopenroadproject_asap7sc7p5t_28/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

<<<<<<<< HEAD:dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7-sc7p5t_rev27_rvt-cells.bzl
# ASAP7 "rev 27" 7.5 track standard cell library using regular VT transistors
# ------------------------------------------------------------------------
asap7_cells_files(
name = "asap7-cells-sc7p5t_rev27_rvt",
rev = "27",
tracks = "7p5t",
vt = "rvt",
has_gds = True,
========
"""Arizona State University 7nm PDK"""

load("@rules_hdl//pdk:open_road_configuration.bzl", "open_road_pdk_configuration")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:asap7.bzl", "asap7_cell_library")

asap7_cell_library(
name = "asap7_rvt_1x",
srcs = glob(["LIB/CCS/*.lib.7z"]),
cell_lef = "LEF/asap7sc7p5t_28_R_1x_220121a.lef",
cell_type = "RVT",
platform_gds = "GDS/asap7sc7p5t_28_R_220121a.gds",
default_corner_delay_model = "ccs",
default_corner_swing = "SS",
openroad_configuration = ":open_road_asap7_1x",
tech_lef = "techlef_misc/asap7_tech_1x_201209.lef",
visibility = [
"//visibility:public",
]
>>>>>>>> temp-fix-asap7:dependency_support/org_theopenroadproject_asap7sc7p5t_28/bundled.BUILD.bazel
)

open_road_pdk_configuration(
name = "open_road-asap7-sc7p5t_rev27_rvt",
cell_site = "asap7sc7p5t",
cts_buffer_cell = "BUFx4_ASAP7_75t_R",
do_not_use_cell_list = [
"*x1_ASAP7*",
"*x1p*_ASAP7*",
"*xp*_ASAP7*",
"SDF*",
"ICG*",
"DFFH*",
],
endcap_cell = "TAPCELL_ASAP7_75t_R",
fill_cells = [
"FILLERxp5_ASAP7_75t_R",
"DECAPx1_ASAP7_75t_R",
"DECAPx2_ASAP7_75t_R",
"DECAPx4_ASAP7_75t_R",
"DECAPx6_ASAP7_75t_R",
"DECAPx10_ASAP7_75t_R",
],
global_placement_cell_pad = 2,
global_routing_clock_layers = "M2-M7",
global_routing_layer_adjustments = {
"M2": "0.5",
"M3": "0.5",
"M4": "0.5",
"M5": "0.5",
"M6": "0.5",
"M7": "0.5",
},
global_routing_signal_layers = "M2-M7",
<<<<<<<< HEAD:dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7-sc7p5t_rev27_rvt-cells.bzl
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:asap7.lyt",
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:pdn_config_1x.pdn",
========
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:asap7.lyt",
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:pdn_config.pdn",
>>>>>>>> temp-fix-asap7:dependency_support/org_theopenroadproject_asap7sc7p5t_28/bundled.BUILD.bazel
pin_horizontal_metal_layer = "M4",
pin_vertical_metal_layer = "M5",
rc_script_configuration = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:rc_script.tcl",
tap_cell = "TAPCELL_ASAP7_75t_R",
tapcell_distance = 25,
tie_high_port = "TIEHIx1_ASAP7_75t_R/H",
tie_low_port = "TIELOx1_ASAP7_75t_R/L",
tie_separation = 0,
tracks_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:tracks.tcl",
wire_rc_clock_metal_layer = "M5",
wire_rc_signal_metal_layer = "M2",
)
Loading

0 comments on commit 2b6e962

Please sign in to comment.