Skip to content

Commit 39c54b0

Browse files
committed
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-verilog-to-routing into run_flat_graphic_warning
2 parents 761ac68 + 9cc02c3 commit 39c54b0

Some content is hidden

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

42 files changed

+396
-328
lines changed

.github/scripts/install_dependencies.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ sudo apt install -y \
2929
libncurses5-dev \
3030
libx11-dev \
3131
libxft-dev \
32+
libxml2-utils \
3233
libxml++2.6-dev \
3334
libreadline-dev \
3435
tcllib \

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,13 @@ if(${WITH_PARMYS}) # define cmake params to compile Yosys
418418
set(MAKE_PROGRAM "make")
419419
endif()
420420

421-
if(NOT DEFINED "${CMAKE_BUILD_PARALLEL_LEVEL}")
422-
set(CUSTOM_BUILD_PARALLEL_LEVEL 16)
423-
else()
424-
set(CUSTOM_BUILD_PARALLEL_LEVEL "${CMAKE_BUILD_PARALLEL_LEVEL}")
425-
endif()
421+
# Commented out since a make file should not call another make command with
422+
# threads. It should pass this information from the parent automatically.
423+
# if(NOT DEFINED "${CMAKE_BUILD_PARALLEL_LEVEL}")
424+
# set(CUSTOM_BUILD_PARALLEL_LEVEL 16)
425+
# else()
426+
# set(CUSTOM_BUILD_PARALLEL_LEVEL "${CMAKE_BUILD_PARALLEL_LEVEL}")
427+
# endif()
426428
add_subdirectory(yosys)
427429
endif()
428430

blifexplorer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
22

33
project("blifexplorer")
44

5-
set(CMAKE_CXX_STANDARD 14)
5+
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
set(CMAKE_CXX_EXTENSIONS OFF)
88

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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,14 @@ The following options are only valid when the router is in timing-driven mode (t
12981298

12991299
**Default:** ``1.2``
13001300

1301+
.. option:: --router_profiler_astar_fac <float>
1302+
1303+
Controls the directedness of the timing-driven router's exploration when doing router delay profiling of an architecture.
1304+
The router delay profiling step is currently used to calculate the place delay matrix lookup.
1305+
Values between 1 and 2 are resonable; higher values trade some quality for reduced run-time.
1306+
1307+
**Default:** ``1.2``
1308+
13011309
.. option:: --max_criticality <float>
13021310

13031311
Sets the maximum fraction of routing cost that can come from delay (vs. coming from routability) for any net.

doc/src/vtr/benchmarks.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ These designs use many precisions including binary, different fixed point types
102102
proxy Proxy/synthetic benchmarks
103103
================= ======================================
104104

105-
The VTR benchmarks are provided as Verilog (enabling full flexibility to modify and change how the designs are implemented) under: ::
105+
The Koios benchmarks are provided as Verilog (enabling full flexibility to modify and change how the designs are implemented) under: ::
106106

107107
$VTR_ROOT/vtr_flow/benchmarks/verilog/koios
108108

@@ -207,4 +207,4 @@ real application domains. On the other hand, MLP benchmarks include modules that
207207
and move data. Pre-synthesized netlists for the synthetic benchmarks are added to VTR project, but MLP netlists should
208208
be downloaded separately.
209209

210-
.. note:: The NoC MLP benchmarks are not included with the VTR release (due to their size). However they can be downloaded and extracted by running ``make get_noc_mlp_benchmarks`` from the root of the VTR tree. They can also be `downloaded manually <https://www.eecg.utoronto.ca/~vaughn/titan/>`_.
210+
.. note:: The NoC MLP benchmarks are not included with the VTR release (due to their size). However they can be downloaded and extracted by running ``make get_noc_mlp_benchmarks`` from the root of the VTR tree. They can also be `downloaded manually <https://www.eecg.utoronto.ca/~vaughn/titan/>`_.

libs/EXTERNAL/libcatch2

Submodule libcatch2 updated 110 files

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/librrgraph/src/base/rr_graph_storage.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ class edge_sort_iterator {
155155
using pointer = edge_swapper*;
156156
using difference_type = ssize_t;
157157

158+
// In order for this class to be used as an iterator within the std library,
159+
// it needs to "act" like a pointer. One thing that it should do is that a
160+
// const variable of this type should be de-referenceable. Therefore, this
161+
// method should be const method; however, this requires modifying the class
162+
// and may yield worst performance. For now the std::stable_sort allows this
163+
// but in the future it may not. If this breaks, this is why.
164+
// See issue #2517 and PR #2522
158165
edge_swapper& operator*() {
159166
return this->swapper_;
160167
}
@@ -419,7 +426,7 @@ size_t t_rr_graph_storage::count_rr_switches(
419426
// values.
420427
//
421428
// This sort is safe to do because partition_edges() has not been invoked yet.
422-
std::sort(
429+
std::stable_sort(
423430
edge_sort_iterator(this, 0),
424431
edge_sort_iterator(this, edge_dest_node_.size()),
425432
edge_compare_dest_node());
@@ -527,7 +534,7 @@ void t_rr_graph_storage::partition_edges(const vtr::vector<RRSwitchId, t_rr_swit
527534
// by assign_first_edges()
528535
// - Edges within a source node have the configurable edges before the
529536
// non-configurable edges.
530-
std::sort(
537+
std::stable_sort(
531538
edge_sort_iterator(this, 0),
532539
edge_sort_iterator(this, edge_src_node_.size()),
533540
edge_compare_src_node_and_configurable_first(rr_switches));

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)

libs/libvtrutil/src/vtr_util.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static int cont; /* line continued? (used by strtok)*/
2626
*
2727
* The split strings (excluding the delimiters) are returned
2828
*/
29-
std::vector<std::string> split(const char* text, const std::string& delims) {
29+
std::vector<std::string> split(const char* text, std::string_view delims) {
3030
if (text) {
3131
std::string text_str(text);
3232
return split(text_str, delims);
@@ -39,13 +39,13 @@ std::vector<std::string> split(const char* text, const std::string& delims) {
3939
*
4040
* The split strings (excluding the delimiters) are returned
4141
*/
42-
std::vector<std::string> split(const std::string& text, const std::string& delims) {
42+
std::vector<std::string> split(std::string_view text, std::string_view delims) {
4343
std::vector<std::string> tokens;
4444

4545
std::string curr_tok;
4646
for (char c : text) {
4747
if (delims.find(c) != std::string::npos) {
48-
//Delimeter character
48+
//Delimiter character
4949
if (!curr_tok.empty()) {
5050
//At the end of the token
5151

@@ -58,7 +58,7 @@ std::vector<std::string> split(const std::string& text, const std::string& delim
5858
//Pass
5959
}
6060
} else {
61-
//Non-delimeter append to token
61+
//Non-delimiter append to token
6262
curr_tok += c;
6363
}
6464
}
@@ -72,18 +72,18 @@ std::vector<std::string> split(const std::string& text, const std::string& delim
7272
}
7373

7474
///@brief Returns 'input' with the first instance of 'search' replaced with 'replace'
75-
std::string replace_first(const std::string& input, const std::string& search, const std::string& replace) {
75+
std::string replace_first(std::string_view input, std::string_view search, std::string_view replace) {
7676
auto pos = input.find(search);
7777

7878
std::string output(input, 0, pos);
7979
output += replace;
80-
output += std::string(input, pos + search.size());
80+
output += input.substr(pos + search.size());
8181

8282
return output;
8383
}
8484

8585
///@brief Returns 'input' with all instances of 'search' replaced with 'replace'
86-
std::string replace_all(const std::string& input, const std::string& search, const std::string& replace) {
86+
std::string replace_all(std::string_view input, std::string_view search, std::string_view replace) {
8787
std::string output;
8888

8989
size_t last = 0;
@@ -101,8 +101,8 @@ std::string replace_all(const std::string& input, const std::string& search, con
101101
return output;
102102
}
103103

104-
///@brief Retruns true if str starts with prefix
105-
bool starts_with(const std::string& str, const std::string& prefix) {
104+
///@brief Returns true if str starts with prefix
105+
bool starts_with(const std::string& str, std::string_view prefix) {
106106
return str.find(prefix) == 0;
107107
}
108108

@@ -195,7 +195,7 @@ char* strdup(const char* str) {
195195
* and/or correct 'unexpected' behaviour of the standard c-functions
196196
*/
197197
template<class T>
198-
T atoT(const std::string& value, const std::string& type_name) {
198+
T atoT(const std::string& value, std::string_view type_name) {
199199
//The c version of atof doesn't catch errors.
200200
//
201201
//This version uses stringstream to detect conversion errors
@@ -461,8 +461,8 @@ bool file_exists(const char* filename) {
461461
*
462462
* Returns true if the extension is correct, and false otherwise.
463463
*/
464-
bool check_file_name_extension(const std::string& file_name,
465-
const std::string& file_extension) {
464+
bool check_file_name_extension(std::string_view file_name,
465+
std::string_view file_extension) {
466466
auto ext = std::filesystem::path(file_name).extension();
467467
return ext == file_extension;
468468
}

libs/libvtrutil/src/vtr_util.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <algorithm>
55
#include <vector>
66
#include <string>
7+
#include <string_view>
78
#include <cstdarg>
89
#include <array>
910

@@ -14,17 +15,17 @@ namespace vtr {
1415
*
1516
* The split strings (excluding the delimiters) are returned
1617
*/
17-
std::vector<std::string> split(const char* text, const std::string& delims = " \t\n");
18-
std::vector<std::string> split(const std::string& text, const std::string& delims = " \t\n");
18+
std::vector<std::string> split(const char* text, std::string_view string_view = " \t\n");
19+
std::vector<std::string> split(std::string_view text, std::string_view delims = " \t\n");
1920

2021
///@brief Returns 'input' with the first instance of 'search' replaced with 'replace'
21-
std::string replace_first(const std::string& input, const std::string& search, const std::string& replace);
22+
std::string replace_first(std::string_view input, std::string_view search, std::string_view replace);
2223

2324
///@brief Returns 'input' with all instances of 'search' replaced with 'replace'
24-
std::string replace_all(const std::string& input, const std::string& search, const std::string& replace);
25+
std::string replace_all(std::string_view input, std::string_view search, std::string_view replace);
2526

2627
///@brief Retruns true if str starts with prefix
27-
bool starts_with(const std::string& str, const std::string& prefix);
28+
bool starts_with(const std::string& str, std::string_view prefix);
2829

2930
///@brief Returns a std::string formatted using a printf-style format string
3031
std::string string_fmt(const char* fmt, ...);
@@ -39,13 +40,13 @@ std::string vstring_fmt(const char* fmt, va_list args);
3940
* would return "home/user/my_files/test.blif"
4041
*/
4142
template<typename Iter>
42-
std::string join(Iter begin, Iter end, std::string delim);
43+
std::string join(Iter begin, Iter end, std::string_view delim);
4344

4445
template<typename Container>
45-
std::string join(Container container, std::string delim);
46+
std::string join(Container container, std::string_view delim);
4647

4748
template<typename T>
48-
std::string join(std::initializer_list<T> list, std::string delim);
49+
std::string join(std::initializer_list<T> list, std::string_view delim);
4950

5051
template<typename Container>
5152
void uniquify(Container container);
@@ -69,7 +70,7 @@ double atod(const std::string& value);
6970
*/
7071
int get_file_line_number_of_last_opened_file();
7172
bool file_exists(const char* filename);
72-
bool check_file_name_extension(const std::string& file_name, const std::string& file_extension);
73+
bool check_file_name_extension(std::string_view file_name, std::string_view file_extension);
7374

7475
extern std::string out_file_prefix;
7576

@@ -82,7 +83,7 @@ std::vector<std::string> ReadLineTokens(FILE* InFile, int* LineNum);
8283
* @brief Template join function implementation
8384
*/
8485
template<typename Iter>
85-
std::string join(Iter begin, Iter end, std::string delim) {
86+
std::string join(Iter begin, Iter end, std::string_view delim) {
8687
std::string joined_str;
8788
for (auto iter = begin; iter != end; ++iter) {
8889
joined_str += *iter;
@@ -94,12 +95,12 @@ std::string join(Iter begin, Iter end, std::string delim) {
9495
}
9596

9697
template<typename Container>
97-
std::string join(Container container, std::string delim) {
98+
std::string join(Container container, std::string_view delim) {
9899
return join(std::begin(container), std::end(container), delim);
99100
}
100101

101102
template<typename T>
102-
std::string join(std::initializer_list<T> list, std::string delim) {
103+
std::string join(std::initializer_list<T> list, std::string_view delim) {
103104
return join(list.begin(), list.end(), delim);
104105
}
105106

0 commit comments

Comments
 (0)