Skip to content
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
151 changes: 0 additions & 151 deletions flow/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@bazel-orfs//:openroad.bzl", "orfs_flow")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

filegroup(
name = "constraints-gcd",
Expand Down Expand Up @@ -101,158 +100,8 @@ orfs_flow(
]),
)

filegroup(
name = "mock-array-constraints",
srcs = [
"designs/asap7/mock-array/constraints.sdc",
],
visibility = [":__subpackages__"],
)

filegroup(
name = "mock-array-io",
srcs = [
"designs/asap7/mock-array/io.tcl",
],
data = [
"designs/src/mock-array/util.tcl",
],
visibility = [":__subpackages__"],
)

MOCK_ARRAY_FLOORPLAN_PLACE = {
"PLACE_PINS_ARGS": "-annealing",
"IO_CONSTRAINTS": "$(location :mock-array-io)",
"PLACE_DENSITY": "0.30",
"DIE_AREA": "0 0 358.56 388.8",
"CORE_AREA": "2.16 2.16 356.40000000000003 386.64000000000004",
"MACRO_PLACE_HALO": "0 2.16",
"RTLMP_BOUNDARY_WT": "0",
"PDN_TCL": "$(PLATFORM_DIR)/openRoad/pdn/BLOCKS_grid_strategy.tcl",
"MACRO_HALO_X": "0.5",
"MACRO_HALO_Y": "0.5",
"MACRO_BLOCKAGE_HALO": "0",
"ADDITIONAL_FILES": "$(locations :mock-array-io)",
}

orfs_flow(
name = "MockArray",
macros = ["Element_generate_abstract"],
stage_arguments = {
"synth": {
"SDC_FILE": "$(location :mock-array-constraints)",
},
"floorplan": MOCK_ARRAY_FLOORPLAN_PLACE | {
},
"place": MOCK_ARRAY_FLOORPLAN_PLACE | {
},
"cts": {
"CTS_BUF_DISTANCE": "60",
},
"route": {
# works with 28 or more iterations as of writing, so give it a few more.
"GLOBAL_ROUTE_ARGS": "-congestion_iterations 40 -verbose",
# If this design isn't quickly done in detailed routing, something is wrong.
# At time of adding this option, only 12 iterations were needed for 0
# violations.
"DETAILED_ROUTE_ARGS": "-bottom_routing_layer M2 -top_routing_layer M7 -save_guide_updates -verbose 1 -droute_end_iter 15",
# since we are specifying DETAILED_ROUTE_ARGS, we need to communicate the
# same information to other stages in the flow.
"MIN_ROUTING_LAYER": "M2",
"MAX_ROUTING_LAYER": "M7",
},
"final": {
"GDS_ALLOW_EMPTY": "Element",
"PWR_NETS_VOLTAGEsS": "",
"GND_NETS_VOLTAGES": "",
},
},
stage_sources = {
"synth": all_sources + [":mock-array-constraints"] + [":mock-array-io"],
"floorplan": all_sources + [":mock-array-io"],
"place": all_sources + [":mock-array-io"],
"cts": all_sources,
"final": all_sources,
},
verilog_files = glob(include = ["designs/src/mock-array/*.v"]),
)

filegroup(
name = "mock-array-element-io",
srcs = [
"designs/asap7/mock-array/Element/io.tcl",
],
data = [
"designs/src/mock-array/util.tcl",
],
visibility = [":__subpackages__"],
)

MOCK_ARRAY_ELEMENT_FLOORPLAN_PLACE = {
"IO_CONSTRAINTS": "$(location :mock-array-element-io)",
"PLACE_PINS_ARGS": "-annealing",
}

MOCK_ARRAY_ELEMENT_ALL = {
"MOCK_ARRAY_ROWS": "8",
"MOCK_ARRAY_COLS": "8",
}

mock_array_all_sources = ["designs/src/mock-array/util.tcl"]

orfs_flow(
name = "Element",
abstract_stage = "route",
arguments = {
"PLACE_DENSITY": "0.82",
},
stage_arguments = {
"synth": MOCK_ARRAY_ELEMENT_ALL | {
"SDC_FILE": "$(location :mock-array-constraints)",
},
"floorplan": MOCK_ARRAY_ELEMENT_ALL | MOCK_ARRAY_ELEMENT_FLOORPLAN_PLACE | {
"DIE_AREA": "0 0 43.2 43.2",
"CORE_AREA": "1.08 1.08 42.120000000000005 42.120000000000005",
"PDN_TCL": "$(PLATFORM_DIR)/openRoad/pdn/BLOCK_grid_strategy.tcl",
},
"place": MOCK_ARRAY_ELEMENT_ALL | MOCK_ARRAY_ELEMENT_FLOORPLAN_PLACE | {
},
"cts": MOCK_ARRAY_ELEMENT_ALL | {
},
"route": MOCK_ARRAY_ELEMENT_ALL | {
# If this design isn't quickly done in detailed routing, something is wrong.
# At time of adding this option, only 3 iterations were needed for 0
# violations.
"DETAILED_ROUTE_ARGS": "-bottom_routing_layer M2 -top_routing_layer M5 -save_guide_updates -verbose 1 -droute_end_iter 10",
# since we are specifying DETAILED_ROUTE_ARGS, we need to communicate the
# same information to other stages in the flow.
"MIN_ROUTING_LAYER": "M2",
"MAX_ROUTING_LAYER": "M5",
},
"final": MOCK_ARRAY_ELEMENT_ALL | {
"PWR_NETS_VOLTAGES": "",
"GND_NETS_VOLTAGES": "",
},
},
stage_sources = {
"synth": mock_array_all_sources + [":mock-array-constraints"],
"floorplan": mock_array_all_sources + [":mock-array-element-io"],
"place": mock_array_all_sources + [":mock-array-element-io"],
"cts": mock_array_all_sources,
"route": mock_array_all_sources,
"final": mock_array_all_sources,
},
verilog_files = glob(include = ["designs/src/mock-array/*.v"]),
)

filegroup(
name = "ethmac_lvt_src",
srcs = glob(include = ["designs/src/ethmac_lvt/*.v"]),
visibility = [":__subpackages__"],
)

compile_pip_requirements(
name = "requirements",
src = "util/requirements.in",
requirements_txt = "util/requirements_lock.txt",
)
59 changes: 59 additions & 0 deletions flow/designs/asap7/ethmac_lvt/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
load("@bazel-orfs//:sweep.bzl", "orfs_sweep")
load("//util:plot_congestion.bzl", "plot_congestion")

# Format densities, rounding to 2 decimal places.
SWEEPS = {
"PLACE_DENSITY": [str(0.60 + x * 0.01 + 0.005)[:4] for x in range(20)],
"CORE_UTILIZATION": [str(40 + x * 5) for x in range(4)],
}

SWEEP = "PLACE_DENSITY"

orfs_sweep(
name = "ethmac_lvt",
arguments = {
# Faster builds
"SKIP_INCREMENTAL_REPAIR": "1",
"GPL_TIMING_DRIVEN": "0",
# Various
"SDC_FILE": "$(location :constraint.sdc)",
"ABC_AREA": "1",
"CORE_UTILIZATION": "40",
"CORE_ASPECT_RATIO": "1",
"CORE_MARGIN": "2",
"PLACE_DENSITY": "0.60",
"ASAP7_USELVT": "1",
"RECOVER_POWER": "1",
"ADDITIONAL_LIBS": "$(LIB_DIR)/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz \
$(LIB_DIR)/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz \
$(LIB_DIR)/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz \
$(LIB_DIR)/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz \
$(LIB_DIR)/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib",
"ADDITIONAL_GDS": "$(PLATFORM_DIR)/gds/asap7sc7p5t_28_R_220121a.gds",
"ADDITIONAL_LEFS": "$(PLATFORM_DIR)/lef/asap7sc7p5t_28_R_1x_220121a.lef",
},
other_variants = {"base": {}},
sources = {
"SDC_FILE": [":constraint.sdc"],
},
sweep = {
value: {
"arguments": {
SWEEP: value,
},
"previous_stage": {
"floorplan": "ethmac_lvt_synth",
},
}
for value in SWEEPS[SWEEP]
},
top = "ethmac",
verilog_files = ["//:ethmac_lvt_src"],
)

plot_congestion(
name = "plot",
srcs = [":ethmac_lvt_{value}_grt".format(value = value) for value in SWEEPS[SWEEP]],
argument = SWEEP,
values = SWEEPS[SWEEP],
)
122 changes: 122 additions & 0 deletions flow/designs/asap7/mock-array/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
load("@bazel-orfs//:openroad.bzl", "orfs_flow")
load("@bazel-orfs//:sweep.bzl", "orfs_sweep")
load("//util:plot_congestion.bzl", "plot_congestion")

# Format densities, rounding to 2 decimal places.
SWEEPS = {
"PLACE_DENSITY": [str(0.82 + x * 0.01 + 0.005)[:4] for x in range(10)],
}

SWEEP = "PLACE_DENSITY"

filegroup(
name = "mock-array-constraints",
srcs = [
"constraints.sdc",
],
visibility = [":__subpackages__"],
)

filegroup(
name = "mock-array-io",
srcs = [
"io.tcl",
],
data = [
"//designs/src/mock-array:util.tcl",
],
visibility = [":__subpackages__"],
)

orfs_flow(
name = "MockArray",
arguments = {
"PLACE_PINS_ARGS": "-annealing",
"IO_CONSTRAINTS": "$(location :mock-array-io)",
"PLACE_DENSITY": "0.30",
"DIE_AREA": "0 0 358.56 388.8",
"CORE_AREA": "2.16 2.16 356.40000000000003 386.64000000000004",
"MACRO_PLACE_HALO": "0 2.16",
"RTLMP_BOUNDARY_WT": "0",
"PDN_TCL": "$(PLATFORM_DIR)/openRoad/pdn/BLOCKS_grid_strategy.tcl",
"MACRO_HALO_X": "0.5",
"MACRO_HALO_Y": "0.5",
"MACRO_BLOCKAGE_HALO": "0",
"SDC_FILE": "$(location :mock-array-constraints)",
"MAX_ROUTING_LAYER": "M9",
"GDS_ALLOW_EMPTY": "Element",
"PWR_NETS_VOLTAGEsS": "",
"GND_NETS_VOLTAGES": "",
},
macros = ["Element_generate_abstract"],
stage_sources = {
"synth": [":mock-array-constraints"] + [":mock-array-io"],
"floorplan": [":mock-array-io"],
"place": [":mock-array-io"],
},
verilog_files = ["//designs/src/mock-array:verilog"],
)

filegroup(
name = "mock-array-element-io",
srcs = [
"Element/io.tcl",
],
data = [
"//designs/src/mock-array:util.tcl",
],
visibility = [":__subpackages__"],
)

mock_array_all_sources = ["//designs/src/mock-array:util.tcl"]

orfs_sweep(
name = "Element",
abstract_stage = "route",
arguments = {
"PLACE_DENSITY": "0.82",
"MOCK_ARRAY_ROWS": "8",
"MOCK_ARRAY_COLS": "8",
"DETAILED_ROUTE_END_ITERATION": "6",
"MIN_ROUTING_LAYER": "M2",
"MAX_ROUTING_LAYER": "M5",
"IO_PLACER_H": "M2 M4",
"IO_PLACER_V": "M3 M5",
"PLACE_PINS_ARGS": "-annealing",
"GND_NETS_VOLTAGES": "",
"PWR_NETS_VOLTAGES": "",
"SDC_FILE": "$(location :mock-array-constraints)",
"IO_CONSTRAINTS": "$(location :mock-array-element-io)",
"DIE_AREA": "0 0 43.2 43.2",
"CORE_AREA": "1.08 1.08 42.120000000000005 42.120000000000005",
"PDN_TCL": "$(PLATFORM_DIR)/openRoad/pdn/BLOCK_grid_strategy.tcl",
},
other_variants = {"base": {}},
stage_sources = {
"synth": mock_array_all_sources + [":mock-array-constraints"],
"floorplan": mock_array_all_sources + [":mock-array-element-io"],
"place": mock_array_all_sources + [":mock-array-element-io"],
"cts": mock_array_all_sources,
"route": mock_array_all_sources,
"final": mock_array_all_sources,
},
sweep = {
value: {
"arguments": {
SWEEP: value,
},
"previous_stage": {
"floorplan": "Element_synth",
},
}
for value in SWEEPS[SWEEP]
},
verilog_files = ["//designs/src/mock-array:verilog"],
)

plot_congestion(
name = "plot",
srcs = [":Element_{value}_grt".format(value = value) for value in SWEEPS[SWEEP]],
argument = SWEEP,
values = SWEEPS[SWEEP],
)
7 changes: 7 additions & 0 deletions flow/designs/src/mock-array/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exports_files(["util.tcl"] + glob(["*.v"]))

filegroup(
name = "verilog",
srcs = glob(["*.v"]),
visibility = ["//visibility:public"],
)
18 changes: 18 additions & 0 deletions flow/util/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
load("@orfs-pip//:requirements.bzl", "requirement")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

exports_files(["open_plots.sh"])

py_binary(
name = "plot_congestion",
srcs = ["plot_congestion.py"],
main = "plot_congestion.py",
visibility = ["//visibility:public"],
deps = [requirement("matplotlib")],
)

compile_pip_requirements(
name = "requirements",
src = "requirements.in",
requirements_txt = "requirements_lock.txt",
)
2 changes: 2 additions & 0 deletions flow/util/open_plots.sh
Copy link
Member

Choose a reason for hiding this comment

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

This seems trivial - do we need a script for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As far as I could find out, yes.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
xdg-open $1
Loading