Skip to content

Commit 8c62b8c

Browse files
committed
Merge branch 'master' of github.com:verilog-to-routing/vtr-verilog-to-routing into openfpga
2 parents ec85a46 + efe7cc0 commit 8c62b8c

File tree

181 files changed

+7475
-3450
lines changed

Some content is hidden

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

181 files changed

+7475
-3450
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,47 +184,52 @@ jobs:
184184
include: [
185185
{
186186
name: 'Basic',
187-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on',
187+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on',
188188
suite: 'vtr_reg_basic'
189189
},
190190
{
191191
name: 'Basic_odin',
192-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_PARMYS=OFF -DWITH_ODIN=on',
192+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_PARMYS=OFF -DWITH_ODIN=on',
193193
suite: 'vtr_reg_basic_odin'
194194
},
195195
{
196196
name: 'Basic with NO_GRAPHICS',
197-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=off',
197+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=off',
198+
suite: 'vtr_reg_basic'
199+
},
200+
{
201+
name: 'Basic with NO_SERVER',
202+
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=on -DVPR_USE_SERVER=off',
198203
suite: 'vtr_reg_basic'
199204
},
200205
{
201206
name: 'Basic with CAPNPROTO disabled',
202-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_CAPNPROTO=off',
207+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_CAPNPROTO=off',
203208
suite: 'vtr_reg_basic'
204209
},
205210
{
206211
name: 'Basic with VTR_ENABLE_DEBUG_LOGGING',
207-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on',
212+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on',
208213
suite: 'vtr_reg_basic'
209214
},
210215
{
211216
name: 'Basic_odin with VTR_ENABLE_DEBUG_LOGGING',
212-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on -DWITH_PARMYS=OFF -DWITH_ODIN=on',
217+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on -DWITH_PARMYS=OFF -DWITH_ODIN=on',
213218
suite: 'vtr_reg_basic_odin'
214219
},
215220
{
216221
name: 'Strong',
217-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on',
222+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on',
218223
suite: 'vtr_reg_strong'
219224
},
220225
{
221226
name: 'Strong_odin',
222-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_PARMYS=OFF -DWITH_ODIN=on',
227+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_PARMYS=OFF -DWITH_ODIN=on',
223228
suite: 'vtr_reg_strong_odin'
224229
},
225230
{
226231
name: 'Valgrind Memory',
227-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_ODIN=on',
232+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_ODIN=on',
228233
suite: 'vtr_reg_valgrind_small'
229234
}
230235
]

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[submodule "libs/EXTERNAL/libcatch2"]
22
path = libs/EXTERNAL/libcatch2
33
url = https://github.com/catchorg/Catch2.git
4+
[submodule "libs/EXTERNAL/sockpp"]
5+
path = libs/EXTERNAL/sockpp
6+
#url = [email protected]:fpagliughi/sockpp.git
7+
url = [email protected]:w0lek/sockpp.git # fork where in branch v1.0.0_no_complication_warnings there are compilation warnings fixes for upstream tag v1.0.0 of sockpp

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ set(VPR_USE_EZGL "auto" CACHE STRING "Specify whether vpr uses the graphics libr
4040
set_property(CACHE VPR_USE_EZGL PROPERTY STRINGS auto off on)
4141
option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VPR." ON)
4242

43+
#Allow the user to decide whether to compile the server module
44+
option(VPR_USE_SERVER "Specify whether vpr enables the server mode" ON)
45+
4346
#Allow the user to enable/disable VPR analytic placement
4447
#VPR option --enable_analytic_placer is also required for Analytic Placement
4548
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22
ARG DEBIAN_FRONTEND=noninteractive
33
# set out workspace
44
ENV WORKSPACE=/workspace
@@ -19,6 +19,7 @@ RUN apt-get update -qq \
1919
libtbb-dev \
2020
python3-pip \
2121
git \
22+
time \
2223
# Install python packages
2324
&& pip install -r requirements.txt \
2425
# Cleanup

README.developers.md

Lines changed: 177 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,70 @@ and should be used when making changes to Odin.
344344
## Unit Tests
345345

346346
VTR also has a limited set of unit tests, which can be run with:
347+
347348
```shell
348349
#From the VTR root directory
349350
$ make && make test
350351
```
351352

353+
This will run `test_vtrutil`, `test_vpr`, `test_fasm`, and `test_archfpga`. Each test suite is added in their CMake
354+
files.
355+
356+
### Running Individual Testers
357+
358+
To run one of the four testers listed above on its own, navigate to the appropriate folder:
359+
360+
| Test | Directory |
361+
|-----------------|------------------------------------|
362+
| `test_archfpga` | `$VTR_ROOT/build/libs/libarchfpga` |
363+
| `test_vtrutil` | `$VTR_ROOT/build/libs/libvtrutil` |
364+
| `test_fasm` | `$VTR_ROOT/build/utils/fasm` |
365+
| `test_vpr` | `$VTR_ROOT/build/vpr` |
366+
367+
To see tester options, run it with `-h`:
368+
369+
```shell
370+
# Using test_vpr as an example
371+
# From $VTR_ROOT/build/vpr
372+
$ ./test_vpr -h
373+
```
374+
375+
To see the names of each unit test, use `--list-tests`:
376+
377+
```shell
378+
# From $VTR_ROOT/build/vpr
379+
$ ./test_vpr --list-tests
380+
```
381+
382+
The output should look similar to this:
383+
384+
```shell
385+
All available test cases:
386+
test_route_flow
387+
[vpr_noc_bfs_routing]
388+
test_find_block_with_matching_name
389+
[vpr_clustered_netlist]
390+
connection_router
391+
[vpr]
392+
binary_heap
393+
[vpr]
394+
edge_groups_create_sets
395+
[vpr]
396+
read_interchange_models
397+
[vpr]
398+
399+
... # many more test cases
400+
401+
52 test cases
402+
```
403+
404+
To run specific unit tests, pass them as arguments. For example:
405+
406+
```shell
407+
# From $VTR_ROOT/build/vpr
408+
$ ./test_vpr test_route_flow connection_router
409+
```
410+
352411
# Evaluating Quality of Result (QoR) Changes
353412
VTR uses highly tuned and optimized algorithms and data structures.
354413
Changes which effect these can have significant impacts on the quality of VTR's design implementations (timing, area etc.) and VTR's run-time/memory usage.
@@ -972,6 +1031,64 @@ This describes adding a test to `vtr_reg_strong`, but the process is similar for
9721031
$ git commit
9731032
```
9741033

1034+
## Creating Unit Tests
1035+
1036+
You can find the source code for the unit tests in their respective directories. New unit tests must also be created in
1037+
these directories.
1038+
1039+
| Test | Directory |
1040+
|-----------------|-----------------------------------|
1041+
| `test_archfpga` | `$VTR_ROOT/libs/libarchfpga/test` |
1042+
| `test_vtrutil` | `$VTR_ROOT/libs/libvtrutil/test` |
1043+
| `test_fasm` | `$VTR_ROOT/utils/fasm/test` |
1044+
| `test_vpr` | `$VTR_ROOT/vpr/test` |
1045+
1046+
VTR uses [Catch2](https://github.com/catchorg/Catch2) for its unit testing framework. For a full tutorial of how to use
1047+
the framework, see `$VTR_ROOT/libs/EXTERNAL/libcatch2/docs/Readme.md`.
1048+
1049+
### Example: Creating and Running a VPR Test Case
1050+
1051+
Navigate to `$VTR_ROOT/vpr/test`.
1052+
1053+
```shell
1054+
$ cd $VTR_ROOT/vpr/test
1055+
```
1056+
1057+
From here, let's create and open a new file `test_new_vpr.cpp` (begin the file name with `test_`). Be sure to `#include "catch2/catch_test_macros.hpp"`.
1058+
Introduce a test case using the `TEST_CASE` macro, and include a name and a tag. For boolean assertions, use `REQUIRE`.
1059+
1060+
```shell
1061+
#include "catch2/catch_test_macros.hpp"
1062+
1063+
// To choose a tag (written with square brackets "[tag]"), see examples from when you run ./test_vpr
1064+
// --list-tests in the tester exectuable directory, as shown earlier. A good default tag name is the name
1065+
// of the tester: in this case, [vpr].
1066+
TEST_CASE("a_vpr_test_name", "[vpr]") {
1067+
int x = 0;
1068+
REQUIRE(x == 0);
1069+
}
1070+
```
1071+
1072+
To run our test case, we must navigate back to `$VTR_ROOT/build/vpr` (from the table
1073+
under [Running Individual Testers](#running-individual-testers)). Since we created a test, we need to rebuild the
1074+
tester. Then, we can run our test.
1075+
1076+
```shell
1077+
$ cd $VTR_ROOT/build/vpr
1078+
$ make // rebuild tester
1079+
$ ./test_vpr a_vpr_test_name // run new unit test
1080+
```
1081+
1082+
Output:
1083+
1084+
```shell
1085+
Filters: "a_vpr_test_name"
1086+
Randomness seeded to: 2089861684
1087+
===============================================================================
1088+
All tests passed (1 assertion in 1 test case)
1089+
```
1090+
1091+
9751092
# Debugging Aids
9761093
VTR has support for several additional tools/features to aid debugging.
9771094
@@ -1213,7 +1330,7 @@ Instead changes should be made in the relevant up-stream repository, and then sy
12131330

12141331
For example to update the `libtatum` subtree:
12151332
```shell
1216-
./dev/external_subtrees.py --update libtatum
1333+
./dev/external_subtrees.py --update libtatum -m "commit message describing why component is being updated"
12171334
```
12181335

12191336
## Adding a new Subtree
@@ -1255,8 +1372,66 @@ To add a new external subtree to VTR do the following:
12551372
This will create two commits to the repository.
12561373
The first will squash all the upstream changes, the second will merge those changes into the current branch.
12571374

1375+
## Pushing VTR Changes Back to Upstream Subtree
1376+
1377+
If there are changes in the VTR repo in a subtree that should be merged back
1378+
into the source repo of the subtree, the changes can be pushed back manually.
1379+
1380+
The instructions above used a Python script to simplify updating subtrees in
1381+
VTR. This is fine for pulling in changes from a remote repo; however, it is not
1382+
good for pushing changes back. This is because these changes need to be pushed
1383+
somewhere, and it is not a good idea to just push it back to the master branch
1384+
directly. Instead, it should be pushed to a temporary branch. Then a PR can be
1385+
made to bring the changes into the target repo.
1386+
1387+
To push changes VTR made to a subtree do the following:
1388+
1389+
1. Create a fork of the target repo. Optionally you can create a branch to be
1390+
the target of the push, or you can just use master.
1391+
1392+
2. Run:
1393+
```shell
1394+
cd $VTR_ROOT
1395+
git subtree push --prefix=<subtree_path> <forked_repo_url> <branch_name>
1396+
```
1397+
The prefix is the internal path to the subtree, as written in
1398+
`dev/subtree_config.xml`.
1399+
1400+
3. Create a PR from your forked repo to the main repo, sharing the amazing
1401+
changes with the world.
1402+
1403+
## Tutorial: Syncing Tatum with VTR
1404+
1405+
This tutorial will show you how to synchronize `libtatum` in VTR and
1406+
[Tatum](https://github.com/verilog-to-routing/tatum); however, similar steps
1407+
can be done to synchronize any subtree in VTR.
1408+
1409+
First, we will pull in (update) any changes in Tatum that are not in VTR yet.
1410+
On a clean branch (based off master), execute the following:
1411+
```shell
1412+
cd $VTR_ROOT
1413+
./dev/external_subtrees.py --update libtatum -m "Pulling in changes from Tatum."
1414+
```
1415+
If the output in the terminal says `Subtree is already at commit <commit_hash>`,
1416+
then there is nothing to pull in. If it says changes were pulled in, a commit
1417+
would have already been made for you. Push these changes to your branch and
1418+
raise a PR on VTR to merge these changes in.
1419+
1420+
After pulling in all the changes from Tatum, without changing branches, we will
1421+
push our VTR changes to Tatum. This is a bit more complicated since, as stated
1422+
in the section on pushing to subtrees, the changes cannot just be pushed to
1423+
master.
1424+
1425+
Create a fork of Tatum and make sure the master branch of that fork is
1426+
synchronized with Tatum's master branch. Then execute the following:
1427+
```shell
1428+
cd $VTR_ROOT
1429+
git subtree push --prefix=libs/EXTERNAL/libtatum <forked_repo_url> master
1430+
```
1431+
After that command finishes, raise a PR from your forked repo onto the Tatum
1432+
repo for the changes to be reviewed and merged in.
12581433
1259-
## Subtree Rational
1434+
## Subtree Rationale
12601435
12611436
VTR uses subtrees to allow easy tracking of upstream dependencies.
12621437

dev/DOCKER_DEPLOY.md

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,62 @@
1-
Overview
2-
========
1+
# Building VTR on Docker
32

3+
## Overview
44
Docker creates an isolated container on your system so you know that VTR will run without further configurations nor affecting any other work.
55

66
Our Docker file sets up this enviroment by installing all necessary Linux packages and applications as well as Perl modules.
77

8-
Additionally, Cloud9 is installed, which enables the remote management of your container through browser. With Cloud9, VTR can be started easier (and even modified and recompiled) without the need to logging into a terminal. If the Cloud9 endpoint is published outside your LAN, you can also execute VTR remotely or share your screen with other users.
8+
## Setup
99

10+
1. Install docker (Community Edition is free and sufficient for VTR): https://docs.docker.com/engine/install/
1011

11-
Setup
12-
=====
12+
2. Clone the VTR project:
1313

14-
Install docker (Community Edition is free and sufficient for VTR): https://docs.docker.com/engine/installation/
14+
```
15+
git clone https://github.com/verilog-to-routing/vtr-verilog-to-routing
16+
```
1517
16-
Clone the VTR project:
18+
3. CD to the VTR folder and build the docker image:
1719
18-
`git clone https://github.com/verilog-to-routing/vtr-verilog-to-routing`
20+
```
21+
docker build . -t vtrimg
22+
```
1923
20-
CD to the VTR folder and build the docker image:
24+
4. Start docker with the new image:
2125
22-
`docker build . -t vtrimg`
26+
```
27+
docker run -it -d --name vtr vtrimg
28+
```
2329
24-
Start docker with the new image and connect the current volume with the workspace volume of the container:
2530
26-
`sudo docker run -it -d -p <port-to-open-on-host>:8080 -v <absolute-path-to-VTR-folder>:/workspace vtrimg`
31+
## Running
2732
33+
1. Attach to the Docker container. Attaching will open a shell on the `/workspace` directory within the container.
34+
The project root directory from the docker build process is copied and placed in the `/workspace` directory.
2835
29-
Running
30-
=======
36+
```sh
37+
# from host computer
38+
docker exec -it vtr /bin/bash
39+
```
3140
32-
Open a browser (Google Chrome for example) and navigate to your host's url at the port you opened up. For example:
33-
http://192.168.1.30:8080
41+
1. Verfiy that VTR has been installed correctly:
3442
35-
First, use one of the terminals and compile VTR:
36-
make && make installation/
43+
```sh
44+
# in container
45+
./vtr_flow/scripts/run_vtr_task.py regression_tests/vtr_reg_basic/basic_timing
46+
```
3747
38-
Second, ensure that a basic regression test passes:
39-
./run_reg_test.py vtr_reg_basic
48+
The expected output is:
4049
41-
Third, run and/or modify VTR in the usual way.
50+
```
51+
k6_N10_mem32K_40nm/single_ff OK
52+
k6_N10_mem32K_40nm/single_ff OK
53+
k6_N10_mem32K_40nm/single_wire OK
54+
k6_N10_mem32K_40nm/single_wire OK
55+
k6_N10_mem32K_40nm/diffeq1 OK
56+
k6_N10_mem32K_40nm/diffeq1 OK
57+
k6_N10_mem32K_40nm/ch_intrinsics OK
58+
k6_N10_mem32K_40nm/ch_intrinsics OK
59+
```
4260
43-
Developpement Debugging
44-
=======================
45-
the container already comes with clang as the default compiler and with scan-build the do statistical analysis on the build
46-
set to `debug` in makefile
47-
48-
run `scan-build make -j4` from the root VTR directory.
49-
to output the html analysis to a specific folder, run `scan-build make -j4 -o /some/folder`
50-
51-
the output is html and viewable in any browser.
61+
2. Run and/or modify VTR in the usual way.
5262

0 commit comments

Comments
 (0)