Skip to content

Commit 2c4588b

Browse files
authored
Merge pull request #8903 from Pinata-Consulting/mock-array-logic-equivalence-check
test/orfs: mock-array logic equivalence check
2 parents 089d41d + 31281a9 commit 2c4588b

File tree

8 files changed

+3628
-0
lines changed

8 files changed

+3628
-0
lines changed

test/orfs/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,19 @@ To hunt down missing `tags = ["manual"]` run a query like:
112112
bazelisk query 'kind(".*", //test/orfs/mock-array/...) except attr(tags, "manual", //test/orfs/mock-array/...)'
113113

114114
Note that OpenROAD *does* want `bazelisk test ...` to run all tests, so test targets should be marked `tags = ["orfs"]` instead, so that `.bazelrc` can skip builds of those targets with the `build --build_tag_filters=-orfs` line.
115+
116+
## eqy tests
117+
118+
`eqy_test` is used to run equivalence checks before and after an ORFS stage, such as before and after floorplan for mock-array. To run the test and keep all the files from the test and see interactive output, run:
119+
120+
bazelisk test //test/orfs/mock-array:MockArray_4x4_eqy_test --test_output=streamed --sandbox_debug
121+
122+
If this fails, then it will output the line below. `eqy` uses a very, very large number of files and copying out these files to the bazel-testlogs folder for inspection takes some time:
123+
124+
Copying 114462 files to bazel-testlogs/test/orfs/mock-array/MockArray_4x4_eqy_test/test.outputs for inspection.
125+
126+
If you just want the files needed to run a locally installed `eqy`, build all the files used in the run above by:
127+
128+
bazelisk build //test/orfs/mock-array:MockArray_4x4_eqy_test
129+
130+
The files used to run the test are then in `bazel-bin/test/orfs/mock-array/`.

test/orfs/mock-array/BUILD

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@bazel-orfs//:eqy.bzl", "eqy_test")
12
load("@bazel-orfs//:openroad.bzl", "orfs_run")
23
load("@bazel-orfs//toolchains/scala:chisel.bzl", "chisel_binary")
34
load(":mock-array.bzl", "config", "element", "mock_array", "verilog")
@@ -99,3 +100,47 @@ orfs_run(
99100
script = ":write_pin_placement.tcl",
100101
tags = ["manual"],
101102
)
103+
104+
[
105+
orfs_run(
106+
name = "{}_floorplan_verilog".format(module),
107+
src = ":{}_base_floorplan".format(module),
108+
outs = [
109+
"{}_floorplan.v".format(module),
110+
],
111+
arguments = {
112+
"OUTPUT": "$(location :{}_floorplan.v)".format(module),
113+
},
114+
script = ":write_verilog.tcl",
115+
tags = ["manual"],
116+
)
117+
for module in [
118+
"MockArray_4x4",
119+
"Element_4x4",
120+
]
121+
]
122+
123+
ASAP7_DEPS = [
124+
"asap7/asap7sc7p5t_AO_RVT_TT_201020.v",
125+
"asap7/asap7sc7p5t_INVBUF_RVT_TT_201020.v",
126+
"asap7/asap7sc7p5t_OA_RVT_TT_201020.v",
127+
"asap7/asap7sc7p5t_SIMPLE_RVT_TT_201020.v",
128+
"@docker_orfs//:OpenROAD-flow-scripts/flow/platforms/asap7/verilog/stdcell/dff.v",
129+
"@docker_orfs//:OpenROAD-flow-scripts/flow/platforms/asap7/verilog/stdcell/empty.v",
130+
]
131+
132+
eqy_test(
133+
name = "MockArray_4x4_eqy_test",
134+
depth = 1,
135+
gate_verilog_files = [
136+
":MockArray_4x4_floorplan.v",
137+
":Element_4x4_floorplan.v",
138+
"src/main/resources/multiplier.v",
139+
] + ASAP7_DEPS,
140+
gold_verilog_files = [
141+
":4x4_array.sv",
142+
"src/main/resources/multiplier.v",
143+
] + ASAP7_DEPS,
144+
module_top = "MockArray",
145+
tags = ["manual"],
146+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Hacked asap7 files
2+
3+
These are a few asap7 files hacked and slashed until eqy was able to parse them, hence a copy here specific to the tests in this module.

0 commit comments

Comments
 (0)