Skip to content

Commit 03bfc2c

Browse files
committed
test/orfs/ram_8x7: various tools to try out simulation and LEC with eqy_test()
Useful in debugging pre-post synthesis behaviors. Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 182f51b commit 03bfc2c

File tree

11 files changed

+3164
-6
lines changed

11 files changed

+3164
-6
lines changed

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ bazel_dep(name = "bazel-orfs")
162162
# To bump version, run: bazelisk run @bazel-orfs//:bump
163163
git_override(
164164
module_name = "bazel-orfs",
165-
commit = "06be7f48c85f3e66e4a79205a68ae2170be88273",
165+
commit = "a17e303ef27d2362b39085e042275edc8a77a6df",
166166
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
167167
)
168168

@@ -171,10 +171,10 @@ orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
171171
# To bump version, run: bazelisk run @bazel-orfs//:bump
172172
orfs.default(
173173
# Official image https://hub.docker.com/r/openroad/orfs/tags
174-
image = "docker.io/openroad/orfs:v3.0-4230-g26b521c49",
174+
image = "docker.io/openroad/orfs:v3.0-4316-gedfa2beff",
175175
# Use OpenROAD of this repo instead of from the docker image
176176
openroad = "//:openroad",
177-
sha256 = "8fc7ac130828053d7f0a9ad93ae8e3a74e9b24be6e76f9900f809ff93a80d005",
177+
sha256 = "4961fcfb4fd4bf3c7a7fb7ccb4083b5566f928bdcde7b6d6a1c341655d9fa262",
178178
)
179179
use_repo(orfs, "com_github_nixos_patchelf_download")
180180
use_repo(orfs, "docker_orfs")

MODULE.bazel.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/orfs/ram_8x7/BUILD

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
load("@bazel-orfs//:eqy.bzl", "eqy_test")
2+
load("@bazel-orfs//:openroad.bzl", "orfs_flow", "orfs_run")
3+
load("//test/orfs/mock-array:mock-array.bzl", "ASAP7_REMOVE_CELLS")
4+
load(":sim.bzl", "sim_test")
5+
6+
package(
7+
features = ["-layering_check"], # TODO: enable
8+
)
9+
10+
orfs_flow(
11+
name = "ram_8x7",
12+
# buildifier: disable=unsorted-dict-items
13+
arguments = {
14+
# Various
15+
"CORE_AREA": "1.08 1.08 15.12 15.12",
16+
"DIE_AREA": "0 0 16.2 16.2",
17+
"PLACE_DENSITY": "0.35",
18+
"OPENROAD_HIERARCHICAL": "1",
19+
"HOLD_SLACK_MARGIN": "-1000",
20+
"MACRO_PLACE_HALO": "0 1",
21+
#"PDN_TCL": "$(PLATFORM_DIR)/openRoad/pdn/BLOCKS_grid_strategy.tcl",
22+
"RTLMP_BOUNDARY_WT": "0",
23+
"SETUP_SLACK_MARGIN": "-4000",
24+
"TAPCELL_TCL": "",
25+
},
26+
sources = {
27+
"RULES_JSON": [":rules-base.json"],
28+
"SDC_FILE": [":constraint.sdc"],
29+
},
30+
tags = ["manual"],
31+
test_kwargs = {
32+
"tags": ["orfs"],
33+
},
34+
verilog_files = ["ram_8x7.sv"],
35+
)
36+
37+
STAGES = [
38+
"source",
39+
# _source tests original source to source transition,
40+
# which checks that the eqy setup works.
41+
"source",
42+
# _synth tests synthesis output, and so on
43+
# for the next stages.
44+
"synth",
45+
"floorplan",
46+
"place",
47+
"cts",
48+
"grt",
49+
"route",
50+
"final",
51+
]
52+
53+
[orfs_run(
54+
name = "ram_8x7_{stage}_verilog".format(stage = stage),
55+
src = ":ram_8x7_{stage}".format(stage = stage),
56+
outs = [
57+
"ram_8x7_{stage}.v".format(stage = stage),
58+
],
59+
arguments = {
60+
"ASAP7_REMOVE_CELLS": " ".join(ASAP7_REMOVE_CELLS),
61+
"OUTPUT": "$(location :ram_8x7_{stage}.v)".format(stage = stage),
62+
},
63+
script = "//test/orfs/mock-array:write_verilog.tcl",
64+
tags = ["manual"],
65+
) for stage in STAGES[2:]]
66+
67+
filegroup(
68+
name = "ram_8x7_source_files",
69+
srcs = [
70+
"ram_8x7.sv",
71+
],
72+
)
73+
74+
[filegroup(
75+
name = "ram_8x7_{stage}_files".format(stage = stage),
76+
srcs = [
77+
":ram_8x7_{stage}_verilog".format(stage = stage),
78+
],
79+
) for stage in STAGES[2:]]
80+
81+
[eqy_test(
82+
name = "eqy_{stage}_test".format(stage = STAGES[i + 1]),
83+
depth = 1,
84+
gate_verilog_files = [
85+
":ram_8x7_{stage}_files".format(stage = STAGES[i + 1]),
86+
] + ([] if STAGES[i + 1] == "source" else ["//test/orfs/mock-array:asap7_files"]),
87+
gold_verilog_files = [
88+
":ram_8x7_{stage}_files".format(stage = STAGES[i]),
89+
] + ([] if STAGES[i] == "source" else ["//test/orfs/mock-array:asap7_files"]),
90+
module_top = "ram_8x7",
91+
tags = ["manual"],
92+
) for i in range(len(STAGES) - 1)]
93+
94+
[sim_test(
95+
name = "ram_8x7_{stage}_sim_test".format(stage = stage),
96+
cc_srcs = ["ram_8x7_sim.cpp"],
97+
module_top = "ram_8x7",
98+
tags = ["manual"],
99+
verilog = [":ram_8x7_{stage}.v".format(stage = stage) if stage != "source" else ":ram_8x7.sv"],
100+
) for stage in STAGES[1:]]
101+
102+
OTHER = [
103+
"good.v",
104+
"bad.v",
105+
]
106+
107+
[sim_test(
108+
name = "ram_8x7_{other}_sim_test".format(other = other[:-2]),
109+
cc_srcs = ["ram_8x7_sim.cpp"],
110+
module_top = "ram_8x7",
111+
tags = ["manual"],
112+
verilog = [other],
113+
) for other in OTHER]
114+
115+
eqy_test(
116+
name = "eqy_repair_tie_test",
117+
depth = 1,
118+
gate_verilog_files = [
119+
"bad.v",
120+
"//test/orfs/mock-array:asap7_files",
121+
],
122+
gold_verilog_files = [
123+
"good.v",
124+
"//test/orfs/mock-array:asap7_files",
125+
],
126+
module_top = "ram_8x7",
127+
tags = ["manual"],
128+
)

test/orfs/ram_8x7/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Summary
2+
3+
The main value here is that this caused eqy_floorplan_test to fail.

0 commit comments

Comments
 (0)