Skip to content

Commit 5fea296

Browse files
Merge branch 'master' into temp_arch_read_
2 parents 6778109 + 817a956 commit 5fea296

File tree

172 files changed

+7297
-3493
lines changed

Some content is hidden

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

172 files changed

+7297
-3493
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)

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

blifexplorer/src/container.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -929,25 +929,23 @@ void Container::showActivity()
929929

930930
void Container::getActivityInformation()
931931
{
932-
//right now it is a dummy function. the activity values are
933-
//generated randomly
932+
// Right now, it is a dummy function. The activity values are
933+
// generated randomly.
934934
QHash<QString, nnode_t *>::const_iterator blockIterator = odinTable.constBegin();
935935

936936
while(blockIterator != odinTable.constEnd()){
937-
QString name = blockIterator.key();
938-
LogicUnit* visNode = unithashtable[name];
939-
//get all connections outgoing and advise them to
940-
//represent the activity by color
941-
QList<Wire*> outgoingWires = visNode->getOutCons();
942-
foreach(Wire* wire, outgoingWires){
943-
int act = qrand() % 255;
944-
wire->setActivity(act);
945-
946-
}
937+
QString name = blockIterator.key();
938+
LogicUnit* visNode = unithashtable[name];
939+
// Get all connections outgoing and advise them to
940+
// represent the activity by color.
941+
QList<Wire*> outgoingWires = visNode->getOutCons();
942+
foreach(Wire* wire, outgoingWires){
943+
int act = QRandomGenerator::global()->bounded(255); // Use QRandomGenerator
944+
wire->setActivity(act);
945+
}
947946
++blockIterator;
948947
}
949948
}
950-
951949
/*---------------------------------------------------------------------------------------------
952950
* (function: showSimulationStep)
953951
*-------------------------------------------------------------------------------------------*/

blifexplorer/src/mainwindow.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,10 @@ void MainWindow::fontSizeChanged(const QString &)
271271
*-------------------------------------------------------------------------------------------*/
272272
void MainWindow::sceneScaleChanged(int scale)
273273
{
274-
double newScale = scale/100.0;
275-
QMatrix oldMatrix = view->matrix();
276-
view->resetMatrix();
277-
view->translate(oldMatrix.dx(), oldMatrix.dy());
274+
double newScale = scale / 100.0;
275+
QTransform oldTransform = view->transform(); // Use transform() instead of matrix()
276+
view->resetTransform(); // Changed from resetMatrix() to resetTransform()
277+
view->translate(oldTransform.dx(), oldTransform.dy()); // Use dx() and dy() from QTransform
278278
view->scale(newScale, newScale);
279279
}
280280

@@ -915,7 +915,7 @@ void MainWindow::openFileWithOdin(){
915915
tr("Open BLIF"),
916916
QDir::homePath(),
917917
tr("BLIF files (*.blif);;All files (*.*)"),
918-
0,
918+
nullptr, // No parent,
919919
QFileDialog::DontUseNativeDialog);
920920

921921
myContainer->setFilename(actBlifFilename);
@@ -925,10 +925,10 @@ void MainWindow::openFileWithOdin(){
925925
//An error occured
926926
QMessageBox msgBox(QMessageBox::Warning, tr("No Structure Found in File"),
927927
"The file you tried to explore does not contain any structures or could not be opened. Please select another file."
928-
, 0, this);
929-
msgBox.addButton(tr("Open &Again"), QMessageBox::AcceptRole);
930-
msgBox.addButton(tr("&Continue"), QMessageBox::RejectRole);
931-
if (msgBox.exec() == QMessageBox::AcceptRole)
928+
929+
, QMessageBox::Open | QMessageBox::Cancel, this);
930+
msgBox.setDefaultButton(QMessageBox::Open);
931+
if (msgBox.exec() == QMessageBox::Open)
932932
openFileWithOdin();
933933

934934
}else{

0 commit comments

Comments
 (0)