Skip to content

Commit 1309a04

Browse files
Merge branch 'master' into 3d_track_to_track_conn
2 parents a3a3599 + f4bd1be commit 1309a04

30 files changed

+336
-270
lines changed

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{

doc/src/quickstart/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ On most unix-like systems you can run:
4848
4949
> make
5050
51+
The default front-end for VTR is :ref:`Parmys<parmys>`, but you can build with ODIN II instead using the command below. This is required to run :ref:`Synthesizing with ODIN II<synthesizing_with_odin_ii>`.
52+
53+
.. code-block:: bash
54+
55+
> make CMAKE_PARAMS="-DWITH_ODIN=on"
56+
5157
from the VTR root directory (hereafter referred to as :term:`$VTR_ROOT`) to build VTR.
5258

5359
.. note::
@@ -63,6 +69,8 @@ from the VTR root directory (hereafter referred to as :term:`$VTR_ROOT`) to buil
6369
* define VTR_ROOT as a variable in your shell (e.g. if ``~/trees/vtr`` is the path to the VTR source tree on your machine, run the equivalent of ``VTR_ROOT=~/trees/vtr`` in BASH) which will allow you to run the commands as written in this guide, or
6470
* manually replace `$VTR_ROOT` in the example commands below with your path to the VTR source tree.
6571

72+
73+
6674
For more details on building VTR on various operating systems/platforms see :doc:`Building VTR</BUILDING>`.
6775

6876

@@ -235,6 +243,7 @@ Next we need to run the three main sets of tools:
235243
* :ref:`ABC` performs 'logic optimization' which simplifies the circuit logic, and 'technology mapping' which converts logic equations into the Look-Up-Tables (LUTs) available on an FPGA, and
236244
* :ref:`VPR` which performs packing, placement and routing of the circuit to implement it on the targetted FPGA architecture.
237245

246+
.. _synthesizing_with_odin_ii:
238247
Synthesizing with ODIN II
239248
~~~~~~~~~~~~~~~~~~~~~~~~~
240249

doc/src/tutorials/flow/basic_flow.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,9 @@ The following steps show you to run the VTR design flow to map a sample circuit
1717
1818
$VTR_ROOT/vtr_flow/scripts/run_vtr_task.py basic_no_timing
1919
20-
The subdirectory ``regression_tests/vtr_reg_basic`` contains tests that are to be run before each commit. They check for basic functionallity to make sure nothing was extremely out of order. This command runs the VTR flow on a set of circuits and a single architecture.
20+
The subdirectory ``regression_tests/vtr_reg_basic`` contains tests that are to be run before each commit. They check for basic functionality to make sure nothing was extremely out of order. This command runs the VTR flow on a set of circuits and a single architecture.
2121
The files generated from the run are stored in ``basic_no_timing/run[#]`` where ``[#]`` is the number of runs you have done.
22-
If this is your first time running the flow, the results will be stored in basic_no_timing/run001.
23-
When the script completes, enter the following command:
24-
25-
.. code-block:: shell
26-
27-
../../../scripts/python_libs/vtr/parse_vtr_task.py basic_no_timing/
28-
29-
This parses out the information of the VTR run and outputs the results in a text file called ``run[#]/parse_results.txt``.
22+
If this is your first time running the flow, the results will be stored in basic_no_timing/run001. The command parses out the information of the VTR run and outputs the results in a text file called ``run[#]/parse_results.txt``.
3023

3124
More info on how to run the flow on multiple circuits and architectures along with different options later.
3225
Before that, we need to ensure that the run that you have done works.

doc/src/vpr/basic_flow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Basic flow
44
The Place and Route process in VPR consists of several steps:
55

66
- Packing (combinines primitives into complex blocks)
7-
- Placment (places complex blocks within the FPGA grid)
7+
- Placement (places complex blocks within the FPGA grid)
88
- Routing (determines interconnections between blocks)
99
- Analysis (analyzes the implementation)
1010

doc/src/vpr/command_line_usage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@ The following options are only valid when the router is in timing-driven mode (t
12991299
**Default:** ``1.2``
13001300

13011301
.. option:: --router_profiler_astar_fac <float>
1302+
13021303
Controls the directedness of the timing-driven router's exploration when doing router delay profiling of an architecture.
13031304
The router delay profiling step is currently used to calculate the place delay matrix lookup.
13041305
Values between 1 and 2 are resonable; higher values trade some quality for reduced run-time.

libs/libarchfpga/src/device_grid.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#include "device_grid.h"
22

3+
#include <utility>
4+
35
DeviceGrid::DeviceGrid(std::string grid_name, vtr::NdMatrix<t_grid_tile, 3> grid)
4-
: name_(grid_name)
5-
, grid_(grid) {
6+
: name_(std::move(grid_name))
7+
, grid_(std::move(grid)) {
68
count_instances();
79
}
810

911
DeviceGrid::DeviceGrid(std::string grid_name, vtr::NdMatrix<t_grid_tile, 3> grid, std::vector<t_logical_block_type_ptr> limiting_res)
10-
: DeviceGrid(grid_name, grid) {
11-
limiting_resources_ = limiting_res;
12+
: DeviceGrid(std::move(grid_name), std::move(grid)) {
13+
limiting_resources_ = std::move(limiting_res);
1214
}
1315

1416
size_t DeviceGrid::num_instances(t_physical_tile_type_ptr type, int layer_num) const {

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
/********************************************************/

libs/libvtrutil/src/vtr_ndmatrix.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class NdMatrixBase {
288288
data_ = std::make_unique<T[]>(size());
289289
}
290290

291-
///@brief Returns the size of the matrix (number of elements) calucated from the current dimensions
291+
///@brief Returns the size of the matrix (number of elements) calculated from the current dimensions
292292
size_t calc_size() const {
293293
///@brief Size is the product of all dimension sizes
294294
size_t cnt = dim_size(0);
@@ -310,7 +310,7 @@ class NdMatrixBase {
310310
*
311311
* Examples:
312312
*
313-
* //A 2-dimensional matrix with indicies [0..4][0..9]
313+
* //A 2-dimensional matrix with indices [0..4][0..9]
314314
* NdMatrix<int,2> m1({5,10});
315315
*
316316
* //Accessing an element
@@ -319,17 +319,17 @@ class NdMatrixBase {
319319
* //Setting an element
320320
* m1[2][8] = 0;
321321
*
322-
* //A 3-dimensional matrix with indicies [0..4][0..9][0..19]
322+
* //A 3-dimensional matrix with indices [0..4][0..9][0..19]
323323
* NdMatrix<int,3> m2({5,10,20});
324324
*
325-
* //A 2-dimensional matrix with indicies [0..4][0..9], with all entries
325+
* //A 2-dimensional matrix with indices [0..4][0..9], with all entries
326326
* //initialized to 42
327327
* NdMatrix<int,2> m3({5,10}, 42);
328328
*
329329
* //Filling all entries with value 101
330330
* m3.fill(101);
331331
*
332-
* //Resizing an existing matrix (all values reset to default constucted value)
332+
* //Resizing an existing matrix (all values reset to default constructed value)
333333
* m3.resize({5,5})
334334
*
335335
* //Resizing an existing matrix (all elements set to value 88)

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

odin_ii/src/verilog/verilog_bison.y

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ int yylex(void);
5252
%define parse.error verbose
5353

5454
%locations
55+
%expect 2
5556

5657
%union{
5758
char *id_name;
@@ -208,6 +209,8 @@ int yylex(void);
208209
%type <node> list_of_generate_block_items generate_item generate_block_item generate loop_generate_construct if_generate_construct
209210
%type <node> case_generate_construct case_generate_item_list case_generate_items generate_block generate_localparam_declaration generate_defparam_declaration
210211

212+
213+
211214
/* capture wether an operation is signed or not */
212215
%type <op> var_signedness
213216

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ psutil
44

55
# Python linter and formatter
66
click==8.0.2 # Our version of black needs an older version of click (https://stackoverflow.com/questions/71673404/importerror-cannot-import-name-unicodefun-from-click)
7-
black==20.8b1
7+
black==21.4b0
88
pylint==2.7.4
99

1010
# Surelog

vpr/src/base/CheckSetup.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,39 @@ void CheckSetup(const t_packer_opts& PackerOpts,
3131
"This is allowed, but strange, and circuit speed will suffer.\n");
3232
}
3333

34-
if ((false == Timing.timing_analysis_enabled)
34+
if (!Timing.timing_analysis_enabled
3535
&& (PlacerOpts.place_algorithm.is_timing_driven())) {
3636
/* May work, not tested */
3737
VPR_FATAL_ERROR(VPR_ERROR_OTHER,
3838
"Timing analysis must be enabled for timing-driven placement.\n");
3939
}
4040

41-
if (!PlacerOpts.doPlacement && ("" != PlacerOpts.constraints_file)) {
41+
if (!PlacerOpts.doPlacement && (!PlacerOpts.constraints_file.empty())) {
4242
VPR_FATAL_ERROR(VPR_ERROR_OTHER,
4343
"A block location file requires that placement is enabled.\n");
4444
}
4545

46-
if (PlacerOpts.place_static_move_prob.size() != NUM_PL_MOVE_TYPES) {
46+
if (PlacerOpts.place_algorithm.is_timing_driven() &&
47+
PlacerOpts.place_static_move_prob.size() > NUM_PL_MOVE_TYPES) {
4748
VPR_FATAL_ERROR(VPR_ERROR_OTHER,
48-
"The number of placer move probabilities should equal to the total number of supported moves. %d\n", PlacerOpts.place_static_move_prob.size());
49+
"The number of provided placer move probabilities (%d) should equal or less than the total number of supported moves (%d).\n",
50+
PlacerOpts.place_static_move_prob.size(),
51+
NUM_PL_MOVE_TYPES);
4952
}
5053

51-
if (PlacerOpts.place_static_notiming_move_prob.size() != NUM_PL_NONTIMING_MOVE_TYPES) {
54+
if (!PlacerOpts.place_algorithm.is_timing_driven() &&
55+
PlacerOpts.place_static_move_prob.size() > NUM_PL_NONTIMING_MOVE_TYPES) {
5256
VPR_FATAL_ERROR(VPR_ERROR_OTHER,
53-
"The number of placer non timing move probabilities should equal to the total number of supported moves. %d\n", PlacerOpts.place_static_notiming_move_prob.size());
57+
"The number of placer non timing move probabilities (%d) should equal to or less than the total number of supported moves (%d).\n",
58+
PlacerOpts.place_static_move_prob.size(),
59+
NUM_PL_MOVE_TYPES);
5460
}
5561

5662
if (RouterOpts.doRouting) {
5763
if (!Timing.timing_analysis_enabled
5864
&& (DEMAND_ONLY != RouterOpts.base_cost_type && DEMAND_ONLY_NORMALIZED_LENGTH != RouterOpts.base_cost_type)) {
5965
VPR_FATAL_ERROR(VPR_ERROR_OTHER,
60-
"base_cost_type must be demand_only or demand_only_normailzed_length when timing analysis is disabled.\n");
66+
"base_cost_type must be demand_only or demand_only_normalized_length when timing analysis is disabled.\n");
6167
}
6268
}
6369

0 commit comments

Comments
 (0)