Skip to content

Commit 1bc8d77

Browse files
committed
2 parents 2fa709e + f523a0f commit 1bc8d77

File tree

160 files changed

+6889
-3216
lines changed

Some content is hidden

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

160 files changed

+6889
-3216
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
@@ -39,6 +39,9 @@ set(VPR_USE_EZGL "auto" CACHE STRING "Specify whether vpr uses the graphics libr
3939
set_property(CACHE VPR_USE_EZGL PROPERTY STRINGS auto off on)
4040
option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VPR." ON)
4141

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

README.developers.md

Lines changed: 118 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
@@ -1352,5 +1469,4 @@ The following outlines the procedure to following when making an official VTR re
13521469
* GitHub will automatically create a release based on the tag
13531470
* Add the new change log entry to the [GitHub release description](https://github.com/verilog-to-routing/vtr-verilog-to-routing/releases)
13541471
* Update the [ReadTheDocs configuration](https://readthedocs.org/projects/vtr/versions/) to build and serve documentation for the relevant tag (e.g. `v8.0.0`)
1355-
* Send a release announcement email to the [vtr-announce](mailto:[email protected]) mailing list (make sure to thank all contributors!)
1356-
1472+
* Send a release announcement email to the [vtr-announce](mailto:[email protected]) mailing list (make sure to thank all contributors!)

libs/EXTERNAL/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ add_subdirectory(libtatum)
1111
add_subdirectory(libcatch2)
1212
#add_subdirectory(parmys)
1313

14+
#VPR_USE_SERVER is initialized in the root CMakeLists
15+
#compile sockpp only if server mode is enabled
16+
if (VPR_USE_SERVER)
17+
set(SOCKPP_BUILD_SHARED OFF CACHE BOOL "Override default value" FORCE)
18+
set(SOCKPP_BUILD_STATIC ON CACHE BOOL "Override default value" FORCE)
19+
add_subdirectory(sockpp)
20+
endif()
21+
1422
#VPR_USE_EZGL is initialized in the root CMakeLists.
1523
#compile libezgl only if the user asks for or has its dependencies installed.
1624
if (VPR_USE_EZGL STREQUAL "on")
@@ -132,3 +140,12 @@ target_include_directories(Catch2
132140
$<INSTALL_INTERFACE:include>
133141
)
134142

143+
# Some sockpp headers generate warnings, so treat them as system headers to suppress warnings
144+
if (VPR_USE_SERVER)
145+
target_include_directories(sockpp-static
146+
SYSTEM
147+
PUBLIC
148+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/sockpp/include>
149+
$<INSTALL_INTERFACE:include>
150+
)
151+
endif()

libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ void TimingReporter::report_timing_setup(std::ostream& os,
9999
report_timing(os, paths);
100100
}
101101

102+
void TimingReporter::report_timing_setup(std::vector<tatum::TimingPath>& paths,
103+
std::ostream& os,
104+
const SetupTimingAnalyzer& setup_analyzer,
105+
size_t npaths) const {
106+
paths = path_collector_.collect_worst_setup_timing_paths(timing_graph_, setup_analyzer, npaths);
107+
108+
report_timing(os, paths);
109+
}
110+
102111
void TimingReporter::report_timing_hold(std::string filename,
103112
const HoldTimingAnalyzer& hold_analyzer,
104113
size_t npaths) const {
@@ -114,6 +123,15 @@ void TimingReporter::report_timing_hold(std::ostream& os,
114123
report_timing(os, paths);
115124
}
116125

126+
void TimingReporter::report_timing_hold(std::vector<tatum::TimingPath>& paths,
127+
std::ostream& os,
128+
const HoldTimingAnalyzer& hold_analyzer,
129+
size_t npaths) const {
130+
paths = path_collector_.collect_worst_hold_timing_paths(timing_graph_, hold_analyzer, npaths);
131+
132+
report_timing(os, paths);
133+
}
134+
117135
void TimingReporter::report_skew_setup(std::string filename,
118136
const SetupTimingAnalyzer& setup_analyzer,
119137
size_t nworst) const {

libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ class TimingReporter {
6464
public:
6565
void report_timing_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
6666
void report_timing_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
67+
void report_timing_setup(std::vector<tatum::TimingPath>& paths, std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
6768

6869
void report_timing_hold(std::string filename, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
6970
void report_timing_hold(std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
71+
void report_timing_hold(std::vector<tatum::TimingPath>& paths, std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
7072

7173
void report_skew_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const;
7274
void report_skew_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const;

libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#pragma once
2+
#include <cstddef>
23
#include <iterator>
34
#include <memory>
45

@@ -104,15 +105,15 @@ class TimingTags {
104105

105106
//Iterator definition
106107
template<class T>
107-
class Iterator : public std::iterator<std::random_access_iterator_tag, T> {
108+
class Iterator {
108109
friend TimingTags;
109110
public:
110-
using value_type = typename std::iterator<std::random_access_iterator_tag, T>::value_type;
111-
using difference_type = typename std::iterator<std::random_access_iterator_tag, T>::difference_type;
112-
using pointer = typename std::iterator<std::random_access_iterator_tag, T>::pointer;
113-
using reference = typename std::iterator<std::random_access_iterator_tag, T>::reference;
114-
using iterator_category = typename std::iterator<std::random_access_iterator_tag, T>::iterator_category;
115-
public:
111+
using iterator_category = std::random_access_iterator_tag;
112+
using difference_type = std::ptrdiff_t;
113+
using value_type = T;
114+
using pointer = T*;
115+
using reference = T&;
116+
116117
Iterator(): p_(nullptr) {}
117118
Iterator(pointer p): p_(p) {}
118119
Iterator(const Iterator& other): p_(other.p_) {}
@@ -143,7 +144,7 @@ class TimingTags {
143144
friend bool operator>=(Iterator lhs, Iterator rhs) { return lhs.p_ >= rhs.p_; }
144145
friend void swap(Iterator lhs, Iterator rhs) { std::swap(lhs.p_, rhs.p_); }
145146
private:
146-
T* p_ = nullptr;
147+
pointer p_ = nullptr;
147148
};
148149

149150
private:

libs/EXTERNAL/sockpp

Submodule sockpp added at 5388c4b

libs/libarchfpga/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ target_link_libraries(read_arch libarchfpga)
5757

5858
#Supress IPO link warnings if IPO is enabled
5959
get_target_property(READ_ARCH_USES_IPO read_arch INTERPROCEDURAL_OPTIMIZATION)
60-
if (READ_ARCH_USES_IPO)
60+
if(READ_ARCH_USES_IPO)
6161
set_property(TARGET read_arch APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS})
6262
endif()
6363

@@ -70,3 +70,8 @@ install(FILES ${LIB_HEADERS} DESTINATION include/libarchfpga)
7070
file(GLOB_RECURSE TEST_SOURCES test/*.cpp)
7171
add_executable(test_archfpga ${TEST_SOURCES})
7272
target_link_libraries(test_archfpga Catch2::Catch2WithMain libarchfpga)
73+
74+
add_test(NAME test_archfpga
75+
COMMAND test_archfpga
76+
--colour-mode ansi
77+
)

0 commit comments

Comments
 (0)