Skip to content

Commit 2fa709e

Browse files
committed
2 parents 778f336 + 8f20622 commit 2fa709e

File tree

8 files changed

+97
-77
lines changed

8 files changed

+97
-77
lines changed

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

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{

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

libs/libarchfpga/src/echo_arch.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
using vtr::t_linked_vptr;
1515

16+
/// @brief indices to lookup IPIN connection block switch name
17+
constexpr int ipin_cblock_switch_index_within_die = 0;
18+
constexpr int ipin_cblock_switch_index_between_dice = 1;
19+
1620
void PrintArchInfo(FILE* Echo, const t_arch* arch);
1721
static void PrintPb_types_rec(FILE* Echo, const t_pb_type* pb_type, int level);
1822
static void PrintPb_types_recPower(FILE* Echo,
@@ -231,10 +235,14 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
231235
break;
232236
}
233237

234-
fprintf(Echo, "\tInput Connect Block Switch Name Within a Same Die: %s\n", arch->ipin_cblock_switch_name[0].c_str());
238+
fprintf(Echo, "\tInput Connect Block Switch Name Within a Same Die: %s\n", arch->ipin_cblock_switch_name[ipin_cblock_switch_index_within_die].c_str());
239+
235240
//if there is more than one layer available, print the connection block switch name that is used for connection between two dice
236-
if (arch->grid_layouts.size() > 1) {
237-
fprintf(Echo, "\tInput Connect Block Switch Name Between Two Dice: %s\n", arch->ipin_cblock_switch_name[1].c_str());
241+
for(const auto& layout : arch->grid_layouts){
242+
int num_layers = (int)layout.layers.size();
243+
if(num_layers > 1){
244+
fprintf(Echo, "\tInput Connect Block Switch Name Between Two Dice: %s\n", arch->ipin_cblock_switch_name[ipin_cblock_switch_index_between_dice].c_str());
245+
}
238246
}
239247

240248
fprintf(Echo, "*************************************************\n\n");
@@ -287,9 +295,12 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
287295
fprintf(Echo, "\t\t\t\ttype unidir mux_name for within die connections: %s\n",
288296
arch->Switches[seg.arch_wire_switch].name.c_str());
289297
//if there is more than one layer available, print the segment switch name that is used for connection between two dice
290-
if (arch->grid_layouts.size() > 1) {
291-
fprintf(Echo, "\t\t\t\ttype unidir mux_name for between two dice connections: %s\n",
298+
for(const auto& layout : arch->grid_layouts){
299+
int num_layers = (int)layout.layers.size();
300+
if(num_layers > 1){
301+
fprintf(Echo, "\t\t\t\ttype unidir mux_name for between two dice connections: %s\n",
292302
arch->Switches[seg.arch_opin_between_dice_switch].name.c_str());
303+
}
293304
}
294305
} else { //Should be bidir
295306
fprintf(Echo, "\t\t\t\ttype bidir wire_switch %s arch_opin_switch %s\n",

libs/libvqm/vqm_dll.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ VQM_DLL_API t_module *vqm_parse_file(char *filename)
112112

113113
VQM_DLL_API int vqm_get_error_message(char *message_buffer, int length)
114114
{
115-
int result = -1;
116-
int temp = strlen(most_recent_error);
115+
int result = -1;
116+
int temp = strlen(most_recent_error);
117117

118-
if (temp <= length)
119-
{
120-
strcpy(message_buffer, message_buffer);
121-
result = temp;
122-
}
123-
return result;
118+
if (temp < length) // Note: Changed to '<' to avoid buffer overflow
119+
{
120+
strcpy(message_buffer, most_recent_error); // Copy 'most_recent_error' to 'message_buffer'
121+
result = temp;
122+
}
123+
return result;
124124
}

libs/libvqm/vqm_parser.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ extern int yylex(void);
3838

3939
%union
4040
{
41-
uintptr_t value;
42-
char *string;
41+
uintptr_t value;
42+
char *string;
4343
}
4444
%parse-param {t_parse_info* parse_info}
45-
%error-verbose
45+
%define parse.error verbose
4646
/********************************************************/
4747
/**** DEFINE TOKENS *************************************/
4848
/********************************************************/

odin_ii/src/ast/ast_loop_unroll.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,19 +312,18 @@ bool is_unsupported_post(ast_node_t* node, ast_node_t* symbol) {
312312

313313
post_condition_function resolve_binary_operation(ast_node_t* node) {
314314
if (node->type == NUMBERS) {
315-
return [=](long value) {
316-
/*
317-
* this lambda triggers a warning for unused variable unless
318-
* we use value to generate a 0
319-
*/
320-
return node->types.vnumber->get_value() + (value - value);
315+
return [=](long value) noexcept {
316+
(void)value; // Indicate that value is unused
317+
return node->types.vnumber->get_value();
321318
};
322319
} else if (node->type == IDENTIFIERS) {
323-
return [=](long value) {
320+
return [=](long value) noexcept {
321+
(void)value; // Indicate that value is unused
324322
return value;
325323
};
326324
} else {
327-
return [=](long value) {
325+
return [=](long value) noexcept {
326+
(void)value; // Indicate that value is unused
328327
post_condition_function left_func = resolve_binary_operation(node->children[0]);
329328
post_condition_function right_func = resolve_binary_operation(node->children[1]);
330329
switch (node->types.operation.op) {
@@ -343,6 +342,7 @@ post_condition_function resolve_binary_operation(ast_node_t* node) {
343342
}
344343
}
345344

345+
346346
/*
347347
* (function: resolve_post_condition)
348348
* return a lambda which gives the next value

0 commit comments

Comments
 (0)