Skip to content

Commit 9313160

Browse files
committed
Converting task and test functionality to python
1 parent 25efd66 commit 9313160

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2764
-160
lines changed

.github/kokoro/continuous/nightly.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ env_vars {
4646
value: "vtr_reg_nightly"
4747
}
4848

49-
#Options for run_reg_test.pl
49+
#Options for run_reg_test.py
5050
# -show_failures: show tool failures in main log output
5151
env_vars {
5252
key: "VTR_TEST_OPTIONS"

.github/kokoro/continuous/strong.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ env_vars {
4646
value: "vtr_reg_strong"
4747
}
4848

49-
#Options for run_reg_test.pl
49+
#Options for run_reg_test.py
5050
# -show_failures: show tool failures in main log output
5151
env_vars {
5252
key: "VTR_TEST_OPTIONS"

.github/kokoro/continuous/strong_sanitized.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ env_vars {
4848
value: "vtr_reg_strong"
4949
}
5050

51-
#Options for run_reg_test.pl
51+
#Options for run_reg_test.py
5252
# -show_failures: show tool failures in main log output
5353
# -skip_qor: Skip QoR checks (since we expect run-time failures due to sanitizers)
5454
env_vars {

.github/kokoro/continuous/weekly.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ env_vars {
4646
value: "vtr_reg_weekly"
4747
}
4848

49-
#Options for run_reg_test.pl
49+
#Options for run_reg_test.py
5050
# -show_failures: show tool failures in main log output
5151
env_vars {
5252
key: "VTR_TEST_OPTIONS"

.github/kokoro/presubmit/nightly.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ env_vars {
4646
value: "vtr_reg_nightly"
4747
}
4848

49-
#Options for run_reg_test.pl
49+
#Options for run_reg_test.py
5050
# -show_failures: show tool failures in main log output
5151
env_vars {
5252
key: "VTR_TEST_OPTIONS"

.github/kokoro/presubmit/strong.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ env_vars {
4646
value: "vtr_reg_strong"
4747
}
4848

49-
#Options for run_reg_test.pl
49+
#Options for run_reg_test.py
5050
# -show_failures: show tool failures in main log output
5151
env_vars {
5252
key: "VTR_TEST_OPTIONS"

.github/kokoro/presubmit/strong_sanitized.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ env_vars {
4848
value: "vtr_reg_strong"
4949
}
5050

51-
#Options for run_reg_test.pl
51+
#Options for run_reg_test.py
5252
# -show_failures: show tool failures in main log output
5353
# -skip_qor: Skip QoR checks (since we expect run-time failures due to sanitizers)
5454
env_vars {

.github/kokoro/steps/vtr-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ echo "========================================"
4545
echo "Running Tests"
4646
echo "========================================"
4747
export VPR_NUM_WORKERS=1
48-
./run_reg_test.pl $VTR_TEST $VTR_TEST_OPTIONS -j$NUM_CORES
48+
./run_reg_test.py $VTR_TEST $VTR_TEST_OPTIONS -j$NUM_CORES
4949
kill $MONITOR

.travis.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ jobs:
8686
- ./dev/check-format-py.sh
8787
- stage: Test
8888
name: "Python Lint"
89-
script:
89+
script:
90+
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
91+
- python3.6 get-pip.py
92+
- python3.6 -m pip install PrettyTable
93+
- rm get-pip.py
9094
- python3 ./dev/pylint_check.py
9195
- stage: Test
9296
name: "C++ Unit Tests"
@@ -111,8 +115,12 @@ jobs:
111115
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on"
112116
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
113117
script:
118+
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
119+
- python3.6 get-pip.py
120+
- python3.6 -m pip install PrettyTable
121+
- rm get-pip.py
114122
- ./.github/travis/build.sh
115-
- travis_wait 30 ./run_reg_test.pl vtr_reg_basic -show_failures -j2
123+
- travis_wait 30 ./run_reg_test.py vtr_reg_basic -show_failures -j2
116124
- stage: Test
117125
name: "Basic Regression Tests with NO_GRAPHICS"
118126
env:
@@ -135,16 +143,24 @@ jobs:
135143
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on"
136144
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
137145
script:
146+
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
147+
- python3.6 get-pip.py
148+
- python3.6 -m pip install PrettyTable
149+
- rm get-pip.py
138150
- ./.github/travis/build.sh
139-
- travis_wait 30 ./run_reg_test.pl vtr_reg_strong -show_failures -j2
151+
- travis_wait 30 ./run_reg_test.py vtr_reg_strong -show_failures -j2
140152
- stage: Test
141153
name: "Basic Valgrind Memory Tests"
142154
env:
143155
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on"
144156
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
145157
script:
158+
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
159+
- python3.6 get-pip.py
160+
- python3.6 -m pip install PrettyTable
161+
- rm get-pip.py
146162
- ./.github/travis/build.sh
147-
- travis_wait 30 ./run_reg_test.pl vtr_reg_valgrind_small -show_failures -j2
163+
- travis_wait 30 ./run_reg_test.py vtr_reg_valgrind_small -show_failures -j2
148164
- stage: Test
149165
name: "Sanitized Basic Regression Tests"
150166
env:
@@ -154,8 +170,12 @@ jobs:
154170
- LSAN_OPTIONS="exitcode=42" #Use a non-standard exit code to ensure LSAN errors are detected
155171
script:
156172
- ./.github/travis/build.sh
173+
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
174+
- python3.6 get-pip.py
175+
- python3.6 -m pip install PrettyTable
176+
- rm get-pip.py
157177
#We skip QoR since we are only checking for errors in sanitizer runs
158-
- travis_wait 50 ./run_reg_test.pl vtr_reg_basic -show_failures -skip_qor -j2
178+
- travis_wait 50 ./run_reg_test.py vtr_reg_basic -show_failures -skip_qor -j2
159179
#Currently strong regression with sanitizers is disabled as it exceeds the maximum travis job run-time
160180
#- stage: Test
161181
#name: "Sanitized Strong Regression Tests"
@@ -167,16 +187,20 @@ jobs:
167187
#script:
168188
#- ./.github/travis/build.sh
169189
##We skip QoR since we are only checking for errors in sanitizer runs
170-
#- travis_wait 60 ./run_reg_test.pl vtr_reg_strong -show_failures -skip_qor -j2
190+
#- travis_wait 60 ./run_reg_test.py vtr_reg_strong -show_failures -skip_qor -j2
171191
- stage: Test
172192
name: "ODIN-II Micro Tests"
173193
env:
174194
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DVTR_ENABLE_SANITIZE=on -DVTR_IPO_BUILD=off -DWITH_BLIFEXPLORER=on"
175195
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
176196
- BUILD_TYPE=debug
177197
script:
198+
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
199+
- python3.6 get-pip.py
200+
- python3.6 -m pip install PrettyTable
201+
- rm get-pip.py
178202
- ./.github/travis/build.sh
179-
- ./run_reg_test.pl odin_reg_micro -show_failures -j2
203+
- ./run_reg_test.py odin_reg_micro -show_failures -j2
180204

181205
- stage: Test
182206
name: "Build Compatibility: GCC 5 (Ubuntu Xenial - 16.04)"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ifneq (,$(findstring pgo,$(BUILD_TYPE)))
8787
#Need titan benchmarks for pgo_profile task
8888
@+$(MAKE) -C $(BUILD_DIR) get_titan_benchmarks
8989
#Note profiling must be done serially to avoid corrupting the generated profiles
90-
./run_reg_test.pl pgo_profile
90+
./run_reg_test.py pgo_profile
9191
#
9292
#Configure 2nd-stage build to use profiling data to guide compiler optimization
9393
#

ODIN_II/verify_odin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ FILTERED_VTR_TASK_PATH="${NEW_RUN_DIR}/vtr/task_list.txt"
12551255
function run_vtr_reg() {
12561256
pushd "${VTR_DIR}" &> /dev/null
12571257
RELATIVE_PATH_TO_TEST=$(realapath_from "${FILTERED_VTR_TASK_PATH}" "${VTR_REG_DIR}")
1258-
/usr/bin/env perl run_reg_test.pl -j "${_NUMBER_OF_PROCESS}" "${RELATIVE_PATH_TO_TEST}"
1258+
/usr/bin/env perl run_reg_test.py -j "${_NUMBER_OF_PROCESS}" "${RELATIVE_PATH_TO_TEST}"
12591259
popd &> /dev/null
12601260
}
12611261

README.developers.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The overall approach is similar, but we call out the differences below.
4545
At the bare minimum it is recommended to run:
4646
```
4747
make #Rebuild the code
48-
./run_reg_test.pl vtr_reg_basic vtr_reg_strong #Run tests
48+
./run_reg_test.py vtr_reg_basic vtr_reg_strong #Run tests
4949
```
5050
5151
See [Running Tests](#running-tests) for more details.
@@ -250,11 +250,11 @@ There are 4 main regression tests:
250250
QoR checks in this regression are aimed at evaluating quality and run-time of the VTR flow.
251251
As a result any QoR failures are a concern and should be investigated and understood.
252252

253-
These can be run with `run_reg_test.pl`:
253+
These can be run with `run_reg_test.py`:
254254
```shell
255255
#From the VTR root directory
256-
$ ./run_reg_test.pl vtr_reg_basic
257-
$ ./run_reg_test.pl vtr_reg_strong
256+
$ ./run_reg_test.py vtr_reg_basic
257+
$ ./run_reg_test.py vtr_reg_strong
258258
```
259259

260260
The *nightly* and *weekly* regressions require the Titan and ISPD benchmarks
@@ -263,22 +263,22 @@ which can be integrated into your VTR tree with:
263263
make get_titan_benchmarks
264264
make get_ispd_benchmarks
265265
```
266-
They can then be run using `run_reg_test.pl`:
266+
They can then be run using `run_reg_test.py`:
267267
```shell
268-
$ ./run_reg_test.pl vtr_reg_nightly
269-
$ ./run_reg_test.pl vtr_reg_weekly
268+
$ ./run_reg_test.py vtr_reg_nightly
269+
$ ./run_reg_test.py vtr_reg_weekly
270270
```
271271

272272
To speed-up things up, individual sub-tests can be run in parallel using the `-j` option:
273273
```shell
274274
#Run up to 4 tests in parallel
275-
$ ./run_reg_test.pl vtr_reg_strong -j4
275+
$ ./run_reg_test.py vtr_reg_strong -j4
276276
```
277277

278278
You can also run multiple regression tests together:
279279
```shell
280280
#Run both the basic and strong regression, with up to 4 tests in parallel
281-
$ ./run_reg_test.pl vtr_reg_basic vtr_reg_strong -j4
281+
$ ./run_reg_test.py vtr_reg_basic vtr_reg_strong -j4
282282
```
283283

284284
## Odin Functionality Tests
@@ -291,8 +291,8 @@ Odin has its own set of tests to verify the correctness of its synthesis results
291291
These can be run with:
292292
```shell
293293
#From the VTR root directory
294-
$ ./run_reg_test.pl odin_reg_micro
295-
$ ./run_reg_test.pl odin_reg_full
294+
$ ./run_reg_test.py odin_reg_micro
295+
$ ./run_reg_test.py odin_reg_full
296296
```
297297
and should be used when making changes to Odin.
298298

@@ -391,7 +391,7 @@ Lets assume we have a failure in `vtr_reg_basic`:
391391

392392
```shell
393393
#In the VTR root directory
394-
$ ./run_reg_test.pl vtr_reg_strong
394+
$ ./run_reg_test.py vtr_reg_strong
395395
#Output trimmed...
396396
regression_tests/vtr_reg_basic/basic_no_timing
397397
-----------------------------------------
@@ -421,7 +421,7 @@ latest run002 run004 run005
421421
There we see there is a `config` directory (which defines the test), and a set of run-directories.
422422
Each time a test is run it creates a new `runXXX` directory (where `XXX` is an incrementing number).
423423
From the above we can tell that our last run was `run005` (the symbolic link `latest` also points to the most recent run directory).
424-
From the output of `run_reg_test.pl` we know that one of the failing architecture/circuit/parameters combinations was `k4_N10_memSize16384_memData64/ch_intrinsics/common`.
424+
From the output of `run_reg_test.py` we know that one of the failing architecture/circuit/parameters combinations was `k4_N10_memSize16384_memData64/ch_intrinsics/common`.
425425
Each architecture/circuit/parameter combination is run in its own sub-folder.
426426
Lets move to that directory:
427427
```shell
@@ -561,12 +561,12 @@ A typical approach to evaluating an algorithm change would be to run `vtr_reg_qo
561561
$ cd vtr_flow/tasks
562562

563563
#Run the VTR benchmarks
564-
$ ../scripts/run_vtr_task.pl regression_tests/vtr_reg_nightly/vtr_reg_qor_chain
564+
$ ../scripts/run_vtr_task.py regression_tests/vtr_reg_nightly/vtr_reg_qor_chain
565565

566566
#Several hours later... they complete
567567

568568
#Parse the results
569-
$ ../scripts/parse_vtr_task.pl regression_tests/vtr_reg_nightly/vtr_reg_qor_chain
569+
$ ../scripts/python_libs/vtr/parse_vtr_task.py regression_tests/vtr_reg_nightly/vtr_reg_qor_chain
570570

571571
#The run directory should now contain a summary parse_results.txt file
572572
$ head -5 vtr_reg_nightly/vtr_reg_qor_chain/latest/parse_results.txt
@@ -596,12 +596,12 @@ $ make get_titan_benchmarks
596596
$ cd vtr_flow/tasks
597597

598598
#Run the VTR benchmarks
599-
$ ../scripts/run_vtr_task.pl regression_tests/vtr_reg_weekly/vtr_reg_titan
599+
$ ../scripts/run_vtr_task.py regression_tests/vtr_reg_weekly/vtr_reg_titan
600600

601601
#Several days later... they complete
602602

603603
#Parse the results
604-
$ ../scripts/parse_vtr_task.pl regression_tests/vtr_reg_weekly/vtr_reg_titan
604+
$ ../scripts/python_libs/vtr/parse_vtr_task.py regression_tests/vtr_reg_weekly/vtr_reg_titan
605605

606606
#The run directory should now contain a summary parse_results.txt file
607607
$ head -5 vtr_reg_nightly/vtr_reg_qor_chain/latest/parse_results.txt
@@ -793,22 +793,22 @@ This describes adding a test to `vtr_reg_strong`, but the process is similar for
793793
```shell
794794
#From the VTR root
795795
$ cd vtr_flow/tasks
796-
$ ../scripts/run_vtr_task.pl regression_tests/vtr_reg_strong/strong_mytest
796+
$ ../scripts/run_vtr_task.py regression_tests/vtr_reg_strong/strong_mytest
797797
798798
regression_tests/vtr_reg_strong/strong_mytest
799799
-----------------------------------------
800800
Current time: Jan-25 06:51 PM. Expected runtime of next benchmark: Unknown
801801
k6_frac_N10_mem32K_40nm/ch_intrinsics...OK
802802
```
803803
804-
Next we can generate the golden reference results using `parse_vtr_task.pl` with the `-create_golden` option:
804+
Next we can generate the golden reference results using `parse_vtr_task.py` with the `-create_golden` option:
805805
```shell
806-
$ ../scripts/parse_vtr_task.pl regression_tests/vtr_reg_strong/strong_mytest -create_golden
806+
$ ../scripts/python_libs/vtr/parse_vtr_task.py regression_tests/vtr_reg_strong/strong_mytest -create_golden
807807
```
808808
809809
And check that everything matches with `-check_golden`:
810810
```shell
811-
$ ../scripts/parse_vtr_task.pl regression_tests/vtr_reg_strong/strong_mytest -check_golden
811+
$ ../scripts/python_libs/vtr/parse_vtr_task.py regression_tests/vtr_reg_strong/strong_mytest -check_golden
812812
regression_tests/vtr_reg_strong/strong_mytest...[Pass]
813813
```
814814
@@ -825,7 +825,7 @@ This describes adding a test to `vtr_reg_strong`, but the process is similar for
825825
Now, when we run `vtr_reg_strong`:
826826
```shell
827827
#From the VTR root directory
828-
$ ./run_reg_test.pl vtr_reg_strong
828+
$ ./run_reg_test.py vtr_reg_strong
829829
#Output trimmed...
830830
regression_tests/vtr_reg_strong/strong_mytest
831831
-----------------------------------------

dev/DOCKER_DEPLOY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ First, use one of the terminals and compile VTR:
3636
make && make installation/
3737

3838
Second, ensure that a basic regression test passes:
39-
./run_reg_test.pl vtr_reg_basic
39+
./run_reg_test.py vtr_reg_basic
4040

4141
Third, run and/or modify VTR in the usual way.
4242

dev/pylint_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def main():
176176
ignore_list.append("C0330")
177177

178178
# Build pylint command
179-
cmd = ["pylint", path, "-s", "n", "--disable=C0330"]
179+
cmd = ["pylint", path, "-s", "n"]
180180
if ignore_list:
181181
cmd.append("--disable=" + ",".join(ignore_list))
182182

doc/src/quickstart/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ Lets make a new directory to work in named ``blink_run_flow``:
375375
> mkdir -p ~/vtr_work/quickstart/blink_run_flow
376376
> cd ~/vtr_work/quickstart/blink_run_flow
377377
378-
Now lets run the script (``$VTR_ROOT/vtr_flow/scripts/run_vtr_flow.pl``) passing in:
378+
Now lets run the script (``$VTR_ROOT/vtr_flow/scripts/run_vtr_flow.py``) passing in:
379379

380380
* The circuit verilog file (``$VTR_ROOT/doc/src/quickstart/blink.v``)
381381
* The FPGA architecture file (``$VTR_ROOT/vtr_flow/arch/timing/EArch.xml``)
@@ -390,7 +390,7 @@ The resulting command is:
390390

391391
.. code-block:: bash
392392
393-
> $VTR_ROOT/vtr_flow/scripts/run_vtr_flow.pl \
393+
> $VTR_ROOT/vtr_flow/scripts/run_vtr_flow.py \
394394
$VTR_ROOT/doc/src/quickstart/blink.v \
395395
$VTR_ROOT/vtr_flow/arch/timing/EArch.xml \
396396
-temp_dir . \

doc/src/tutorials/flow/basic_flow.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The following steps show you to run the VTR design flow to map a sample circuit
99

1010
.. code-block:: shell
1111
12-
../scripts/run_vtr_task.pl basic_flow
12+
../scripts/run_vtr_task.py basic_flow
1313
1414
This command will run the VTR flow on a single circuit and a single architecture.
1515
The files generated from the run are stored in ``basic_flow/run[#]`` where ``[#]`` is the number of runs you have done.
@@ -18,7 +18,7 @@ The following steps show you to run the VTR design flow to map a sample circuit
1818

1919
.. code-block:: shell
2020
21-
../scripts/parse_vtr_task.pl basic_flow/
21+
../scripts/python_libs/vtr/parse_vtr_task.py basic_flow/
2222
2323
This parses out the information of the VTR run and outputs the results in a text file called ``run[#]/parse_results.txt``.
2424

@@ -30,7 +30,7 @@ The following steps show you to run the VTR design flow to map a sample circuit
3030

3131
.. code-block:: shell
3232
33-
../scripts/parse_vtr_task.pl -check_golden basic_flow
33+
../scripts/python_libs/vtr/parse_vtr_task.py -check_golden basic_flow
3434
3535
It should return: ``basic_flow...[Pass]``
3636

doc/src/vtr/install_vtr.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Verifying Installation
2525
~~~~~~~~~~~~~~~~~~~~~~
2626
To verfiy that VTR has been installed correctly run::
2727

28-
$VTR_ROOT/vtr_flow/scripts/run_vtr_task.pl basic_flow
28+
$VTR_ROOT/vtr_flow/scripts/run_vtr_task.py basic_flow
2929

3030
The expected output is::
3131

0 commit comments

Comments
 (0)