|
1 | 1 | # RDF Test Harness |
2 | 2 |
|
3 | | -This folder contains an end-to-end regression for the Robust Design Flow (RDF). |
4 | | -The test runs the full OpenROAD flow on the `gcd` design for the Nangate45 |
5 | | -platform and compares the resulting report artifacts against the goldens in |
| 3 | +This directory exercises the Robust Design Flow (RDF) end-to-end on the `gcd` |
| 4 | +design (Nangate45) and compares the reported metrics against the goldens in |
6 | 5 | `tests/golden/`. |
7 | 6 |
|
8 | | -## Prerequisites |
| 7 | +## Recommended: Run in Docker |
9 | 8 |
|
10 | | -- OpenROAD-flow-scripts and its toolchain must be built (see the repository |
11 | | - `README.md` for build instructions). |
12 | | -- `make`, `python3`, and all runtime dependencies required by ORFS must be on |
13 | | - your `PATH`. |
| 9 | +Build the container image (from the repository root): |
14 | 10 |
|
15 | | -## Running the Regression |
| 11 | +```bash |
| 12 | +docker build -t rdf-openroad-ci -f docker/Dockerfile . |
| 13 | +``` |
16 | 14 |
|
17 | | -From the repository root: |
| 15 | +Run the regression inside the image, mounting your working copy at |
| 16 | +`/workspace`: |
18 | 17 |
|
19 | 18 | ```bash |
20 | | -python3 -m unittest discover -s tests |
| 19 | +docker run --rm -it \ |
| 20 | + -v "$PWD":/workspace \ |
| 21 | + rdf-openroad-ci \ |
| 22 | + bash -lc "python3 tests/run_regression.py" |
21 | 23 | ``` |
22 | 24 |
|
23 | | -This takes about a minute and streams the full flow output to the terminal so |
24 | | -you can watch each stage execute. Temporary results live in `rdf.test/` while |
25 | | - the test runs and are cleaned up automatically afterward. |
| 25 | +This matches the Jenkins CI environment and prints the full flow log. |
26 | 26 |
|
27 | 27 | ## Updating Golden Artifacts |
28 | 28 |
|
29 | | -If the flow metrics legitimately change (e.g., due to tool updates): |
| 29 | +When tool updates legitimately change the reported metrics: |
30 | 30 |
|
31 | | -1. Run the flow manually to generate fresh artifacts: |
| 31 | +1. Regenerate the reports in Docker: |
32 | 32 | ```bash |
33 | | - python3 scripts/robust_design_flow.py -t -r -y -v \ |
34 | | - -c scripts/sample_run.yml -d gcd -n nangate45 |
| 33 | + docker run --rm -it \ |
| 34 | + -v "$PWD":/workspace \ |
| 35 | + rdf-openroad-ci \ |
| 36 | + bash -lc "python3 scripts/robust_design_flow.py -t -r -y -v \\ |
| 37 | + -c scripts/sample_run.yml -d gcd -n nangate45" |
35 | 38 | ``` |
36 | | -2. Copy the new report files into the golden directory: |
| 39 | +2. Copy the updated files back onto the host: |
37 | 40 | ```bash |
38 | 41 | cp rdf.test/logs/nangate45/gcd/base/6_report.log tests/golden/6_report.log.ok |
39 | 42 | cp rdf.test/logs/nangate45/gcd/base/6_report.json tests/golden/6_report.json.ok |
40 | 43 | ``` |
41 | | -3. Remove `rdf.test/` when done: `rm -rf rdf.test`. |
42 | | -4. Re-run the regression to confirm parity. |
43 | | - |
44 | | -## Troubleshooting |
45 | | - |
46 | | -- If the test fails because `make` or OpenROAD is not found, verify that the |
47 | | - ORFS environment setup scripts have been sourced. |
48 | | -- To inspect a failing run, comment out the `tearDown` cleanup in |
49 | | - `tests/test_robust_design_flow.py` so the `rdf.test/` directory is preserved |
50 | | - for manual inspection. |
| 44 | +3. Clean up the temporary workspace: |
| 45 | + ```bash |
| 46 | + rm -rf rdf.test |
| 47 | + ``` |
| 48 | +4. Re-run `python3 tests/run_regression.py` (or the Docker command above) to |
| 49 | + confirm parity. |
| 50 | + |
| 51 | +## Tips |
| 52 | + |
| 53 | +- The test fixture removes `rdf.test/` after each run. Comment out |
| 54 | + `tearDown()` in `tests/test_robust_design_flow.py` if you need to inspect the |
| 55 | + intermediate flow outputs while debugging. |
| 56 | +- To use a prebuilt installation located elsewhere (for example |
| 57 | + `/opt/Robust-Design-Flow` on Jenkins), set `RDF_INSTALL_ROOT` before running |
| 58 | + the regression. When unset, the scripts default to the current working copy. |
| 59 | +- If you choose to run natively (outside Docker), ensure OpenROAD-flow-scripts |
| 60 | + is built, the toolchain is on `PATH`, and Python has `unittest-xml-reporting` |
| 61 | + and `PyYAML` installed. |
0 commit comments