Skip to content

Commit cfc0bad

Browse files
authored
Merge pull request #9034 from Pinata-Consulting/eqy-document-local-workflow
test/orfs: add eqy standalone teste case production
2 parents 2bec092 + 525f5b9 commit cfc0bad

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

test/orfs/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,87 @@ If you just want the files needed to run a locally installed `eqy`, build all th
128128
bazelisk build //test/orfs/mock-array:MockArray_4x4_eqy_test
129129

130130
The files used to run the test are then in `bazel-bin/test/orfs/mock-array/`.
131+
132+
### TL;DR creating archive for standalone eqy test
133+
134+
Create `/tmp/issue.tar.gz`
135+
136+
bazelisk build //test/orfs/gcd:gcd_eqy_synth_test
137+
tar --exclude='*oss_cad_suite*' -czvf /tmp/issue.tar.gz -C "$(bazelisk info bazel-bin)/test/orfs/gcd/gcd_eqy_synth_test.run.sh.runfiles" .
138+
139+
Reproduction instructions:
140+
141+
1. untar archive
142+
2. cd _main
143+
3. ~/oss-cad-suite/bin/eqy test/orfs/gcd/gcd_eqy_synth_test.eqy
144+
145+
Comments:
146+
147+
- `~/oss-cad-suite/` should be familiar with anyone versed in eqy as it refers to the [official binary release binaries](https://github.com/YosysHQ/oss-cad-suite-build)
148+
- Reproduction cases should be minimal in terms of size and context. The above recipe contains some unnecessary files, unnecessary directory structure, etc. Prune the test case further manually to get to the core of the matter.
149+
150+
## Running eqy tests standalone outside bazel
151+
152+
Build the test files:
153+
154+
bazelisk build //test/orfs/gcd:gcd_eqy_synth_test
155+
156+
This outputs:
157+
158+
Target //test/orfs/gcd:gcd_eqy_synth_test up-to-date:
159+
bazel-bin/test/orfs/gcd/gcd_eqy_synth_test.run.sh
160+
161+
Copy all files needed to run the tests into a working folder `foo`:
162+
163+
rsync -aL "$(bazelisk info bazel-bin)/test/orfs/gcd/gcd_eqy_synth_test.run.sh.runfiles/" foo/
164+
165+
Change cwd for running the tests:
166+
167+
cd foo/_main
168+
169+
Bazel sets up both binaries and data files to run the tests, to create a reportable standalone test. A report should include only the data files and not the actual binaries used locally to run the test:
170+
171+
$ find .
172+
.
173+
./test
174+
./test/orfs
175+
./test/orfs/asap7
176+
./test/orfs/asap7/asap7sc7p5t_SIMPLE_RVT_TT_201020.v
177+
./test/orfs/asap7/asap7sc7p5t_INVBUF_RVT_TT_201020.v
178+
./test/orfs/asap7/asap7sc7p5t_AO_RVT_TT_201020.v
179+
./test/orfs/asap7/asap7sc7p5t_OA_RVT_TT_201020.v
180+
./test/orfs/gcd
181+
./test/orfs/gcd/gcd.v
182+
./test/orfs/gcd/gcd_eqy_synth_test.run.sh
183+
./test/orfs/gcd/gcd_eqy_synth.v
184+
./test/orfs/gcd/gcd_eqy_synth_test.eqy
185+
186+
Bazel generated `bazel-bin/test/orfs/gcd/gcd_eqy_synth_test.run.sh` to runs the tests. Examine this script to look at that for clues as to how to run the tests standalone:
187+
188+
$ head -n 5 test/orfs/gcd/gcd_eqy_synth_test.run.sh
189+
# !/bin/sh
190+
set -euo pipefail
191+
test_status=0
192+
(exec ../bazel-orfs++_repo_rules+oss_cad_suite/bin/eqy "$@" test/orfs/gcd/gcd_eqy_synth_test.eqy) || test_status=$?
193+
194+
What we want is:
195+
196+
../bazel-orfs++_repo_rules+oss_cad_suite/bin/eqy test/orfs/gcd/gcd_eqy_synth_test.eqy
197+
198+
Running this, we get:
199+
200+
<pre>$ ../bazel-orfs++_repo_rules+oss_cad_suite/bin/eqy test/orfs/gcd/gcd_eqy_synth_test.eqy
201+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:24</font> [<font color="#12488B">gcd_eqy_synth_test</font>] <font color="#A347BA">read_gold</font>: starting process &quot;yosys -ql gcd_eqy_synth_test/gold.log gcd_eqy_synth_test/gold.ys&quot;
202+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:24</font> [<font color="#12488B">gcd_eqy_synth_test</font>] <font color="#A347BA">read_gold</font>: finished (returncode=0)
203+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:24</font> [<font color="#12488B">gcd_eqy_synth_test</font>] <font color="#A347BA">read_gate</font>: starting process &quot;yosys -ql gcd_eqy_synth_test/gate.log gcd_eqy_synth_test/gate.ys&quot;
204+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:25</font> [<font color="#12488B">gcd_eqy_synth_test</font>] <font color="#A347BA">read_gate</font>: finished (returncode=0)
205+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:25</font> [<font color="#12488B">gcd_eqy_synth_test</font>] <font color="#A347BA">combine</font>: starting process &quot;yosys -ql gcd_eqy_synth_test/combine.log gcd_eqy_synth_test/combine.ys&quot;
206+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:25</font> [<font color="#12488B">gcd_eqy_synth_test</font>] <font color="#A347BA">combine</font>: finished (returncode=0)
207+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:25</font> [<font color="#12488B">gcd_eqy_synth_test</font>] <font color="#A2734C"><b>Warning: Cannot find entity _*_.*.</b></font>
208+
[deleted]
209+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:32</font> [<font color="#12488B">gcd_eqy_synth_test</font>] <font color="#C01C28"><b>Failed to prove equivalence of partition gcd.resp_msg.1</b></font>
210+
[deleted]
211+
<font color="#12488B">EQY</font> <font color="#26A269"> 8:05:32</font> [<font color="#12488B">gcd_eqy_synth_test</font>] DONE (FAIL, rc=2)
212+
</pre>
213+
214+

0 commit comments

Comments
 (0)