Skip to content

Commit c69b432

Browse files
Merge branch 'master' into noc_pack_part
2 parents 71064cb + c9fcf98 commit c69b432

Some content is hidden

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

62 files changed

+445
-276
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 \

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ jobs:
197197
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=off',
198198
suite: 'vtr_reg_basic'
199199
},
200+
{
201+
name: 'Basic with CAPNPROTO disabled',
202+
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_CAPNPROTO=off',
203+
suite: 'vtr_reg_basic'
204+
},
200205
{
201206
name: 'Basic with VTR_ENABLE_DEBUG_LOGGING',
202207
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on',

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/vpr/command_line_usage.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,13 @@ 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+
Controls the directedness of the timing-driven router's exploration when doing router delay profiling of an architecture.
1303+
The router delay profiling step is currently used to calculate the place delay matrix lookup.
1304+
Values between 1 and 2 are resonable; higher values trade some quality for reduced run-time.
1305+
1306+
**Default:** ``1.2``
1307+
13011308
.. option:: --max_criticality <float>
13021309

13031310
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/libargparse/src/argparse.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include <algorithm>
2-
#include <array>
32
#include <list>
43
#include <cassert>
54
#include <string>
65
#include <set>
76
#include <limits>
7+
#include <utility>
88

99
#include "argparse.hpp"
1010
#include "argparse_util.hpp"
@@ -16,16 +16,16 @@ namespace argparse {
1616
* ArgumentParser
1717
*/
1818

19-
ArgumentParser::ArgumentParser(std::string prog_name, std::string description_str, std::ostream& os)
20-
: description_(description_str)
19+
ArgumentParser::ArgumentParser(const std::string& prog_name, std::string description_str, std::ostream& os)
20+
: description_(std::move(description_str))
2121
, formatter_(new DefaultFormatter())
2222
, os_(os)
2323
{
2424
prog(prog_name);
2525
argument_groups_.push_back(ArgumentGroup("arguments"));
2626
}
2727

28-
ArgumentParser& ArgumentParser::prog(std::string prog_name, bool basename_only) {
28+
ArgumentParser& ArgumentParser::prog(const std::string& prog_name, bool basename_only) {
2929
if (basename_only) {
3030
prog_ = basename(prog_name);
3131
} else {
@@ -35,17 +35,17 @@ namespace argparse {
3535
}
3636

3737
ArgumentParser& ArgumentParser::version(std::string version_str) {
38-
version_ = version_str;
38+
version_ = std::move(version_str);
3939
return *this;
4040
}
4141

4242
ArgumentParser& ArgumentParser::epilog(std::string epilog_str) {
43-
epilog_ = epilog_str;
43+
epilog_ = std::move(epilog_str);
4444
return *this;
4545
}
4646

4747
ArgumentGroup& ArgumentParser::add_argument_group(std::string description_str) {
48-
argument_groups_.push_back(ArgumentGroup(description_str));
48+
argument_groups_.push_back(ArgumentGroup(std::move(description_str)));
4949
return argument_groups_[argument_groups_.size() - 1];
5050
}
5151

@@ -72,7 +72,7 @@ namespace argparse {
7272
void ArgumentParser::parse_args_throw(int argc, const char* const* argv) {
7373
std::vector<std::string> arg_strs;
7474
for (int i = 1; i < argc; ++i) {
75-
arg_strs.push_back(argv[i]);
75+
arg_strs.emplace_back(argv[i]);
7676
}
7777

7878
parse_args_throw(arg_strs);
@@ -241,7 +241,7 @@ namespace argparse {
241241
} else if (arg->nargs() == '+' || arg->nargs() == '*') {
242242
if (arg->nargs() == '+') {
243243
assert(nargs_read >= 1);
244-
assert(values.size() >= 1);
244+
assert(!values.empty());
245245
}
246246

247247
for (const auto& value : values) {
@@ -410,11 +410,11 @@ namespace argparse {
410410
* ArgumentGroup
411411
*/
412412
ArgumentGroup::ArgumentGroup(std::string name_str)
413-
: name_(name_str)
413+
: name_(std::move(name_str))
414414
{}
415415

416416
ArgumentGroup& ArgumentGroup::epilog(std::string str) {
417-
epilog_ = str;
417+
epilog_ = std::move(str);
418418
return *this;
419419
}
420420
std::string ArgumentGroup::name() const { return name_; }
@@ -425,10 +425,10 @@ namespace argparse {
425425
* Argument
426426
*/
427427
Argument::Argument(std::string long_opt, std::string short_opt)
428-
: long_opt_(long_opt)
429-
, short_opt_(short_opt) {
428+
: long_opt_(std::move(long_opt))
429+
, short_opt_(std::move(short_opt)) {
430430

431-
if (long_opt_.size() < 1) {
431+
if (long_opt_.empty()) {
432432
throw ArgParseError("Argument must be at least one character long");
433433
}
434434

@@ -445,7 +445,7 @@ namespace argparse {
445445
}
446446

447447
Argument& Argument::help(std::string help_str) {
448-
help_ = help_str;
448+
help_ = std::move(help_str);
449449
return *this;
450450
}
451451

@@ -476,12 +476,12 @@ namespace argparse {
476476
}
477477

478478
Argument& Argument::metavar(std::string metavar_str) {
479-
metavar_ = metavar_str;
479+
metavar_ = std::move(metavar_str);
480480
return *this;
481481
}
482482

483483
Argument& Argument::choices(std::vector<std::string> choice_values) {
484-
choices_ = choice_values;
484+
choices_ = std::move(choice_values);
485485
return *this;
486486
}
487487

@@ -536,7 +536,7 @@ namespace argparse {
536536
}
537537

538538
Argument& Argument::group_name(std::string grp) {
539-
group_name_ = grp;
539+
group_name_ = std::move(grp);
540540
return *this;
541541
}
542542

libs/EXTERNAL/libargparse/src/argparse.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ namespace argparse {
3434
class ArgumentParser {
3535
public:
3636
//Initializes an argument parser
37-
ArgumentParser(std::string prog_name, std::string description_str=std::string(), std::ostream& os=std::cout);
37+
ArgumentParser(const std::string& prog_name, std::string description_str=std::string(), std::ostream& os=std::cout);
3838

3939
//Overrides the program name
40-
ArgumentParser& prog(std::string prog, bool basename_only=true);
40+
ArgumentParser& prog(const std::string& prog, bool basename_only=true);
4141

4242
//Sets the program version
4343
ArgumentParser& version(std::string version);

libs/EXTERNAL/libcatch2

Submodule libcatch2 updated 110 files

libs/libarchfpga/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ target_link_libraries(libarchfpga
2222
libvtrutil
2323
libpugixml
2424
libpugiutil
25-
libvtrcapnproto
2625
)
2726

27+
if(${VTR_ENABLE_CAPNPROTO})
28+
target_link_libraries(libarchfpga libvtrcapnproto)
29+
target_compile_definitions(libarchfpga PRIVATE VTR_ENABLE_CAPNPROTO)
30+
endif()
31+
2832
# Using filesystem library requires additional compiler/linker options for GNU implementation prior to 9.1
2933
# and LLVM implementation prior to LLVM 9.0;
3034
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
3+
#include "read_fpga_interchange_arch.h"
4+
#include "vtr_error.h"
5+
6+
#ifdef VTR_ENABLE_CAPNPROTO
7+
18
#include <algorithm>
29
#include <kj/std/iostream.h>
310
#include <limits>
@@ -21,7 +28,6 @@
2128
#include "arch_util.h"
2229
#include "arch_types.h"
2330

24-
#include "read_fpga_interchange_arch.h"
2531

2632
/*
2733
* FPGA Interchange Device frontend
@@ -2497,11 +2503,14 @@ struct ArchReader {
24972503
}
24982504
};
24992505

2506+
#endif // VTR_ENABLE_CAPNPROTO
2507+
25002508
void FPGAInterchangeReadArch(const char* FPGAInterchangeDeviceFile,
25012509
const bool /*timing_enabled*/,
25022510
t_arch* arch,
25032511
std::vector<t_physical_tile_type>& PhysicalTileTypes,
25042512
std::vector<t_logical_block_type>& LogicalBlockTypes) {
2513+
#ifdef VTR_ENABLE_CAPNPROTO
25052514
// Decompress GZipped capnproto device file
25062515
gzFile file = gzopen(FPGAInterchangeDeviceFile, "r");
25072516
VTR_ASSERT(file != Z_NULL);
@@ -2542,4 +2551,12 @@ void FPGAInterchangeReadArch(const char* FPGAInterchangeDeviceFile,
25422551

25432552
ArchReader reader(arch, device_reader, FPGAInterchangeDeviceFile, PhysicalTileTypes, LogicalBlockTypes);
25442553
reader.read_arch();
2554+
#else // VTR_ENABLE_CAPNPROTO
2555+
// If CAPNPROTO is disabled, throw an error.
2556+
(void)FPGAInterchangeDeviceFile;
2557+
(void)arch;
2558+
(void)PhysicalTileTypes;
2559+
(void)LogicalBlockTypes;
2560+
throw vtr::VtrError("Unable to read FPGA interchange if CAPNPROTO is not enabled", __FILE__, __LINE__);
2561+
#endif // VTR_ENABLE_CAPNPROTO
25452562
}

libs/libarchfpga/src/read_fpga_interchange_arch.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33

44
#include "arch_types.h"
55

6+
#ifdef VTR_ENABLE_CAPNPROTO
7+
68
#include "DeviceResources.capnp.h"
79
#include "LogicalNetlist.capnp.h"
810
#include "capnp/serialize.h"
911
#include "capnp/serialize-packed.h"
1012
#include <fcntl.h>
1113
#include <unistd.h>
1214

15+
#endif // VTR_ENABLE_CAPNPROTO
16+
1317
#ifdef __cplusplus
1418
extern "C" {
1519
#endif

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ class t_rr_graph_storage {
336336
return ret;
337337
}
338338

339+
/** @brief Get the source node for the specified edge. */
340+
RRNodeId edge_src_node(const RREdgeId& edge) const {
341+
return edge_src_node_[edge];
342+
}
343+
339344
/** @brief Get the destination node for the specified edge. */
340345
RRNodeId edge_sink_node(const RREdgeId& edge) const {
341346
return edge_dest_node_[edge];

libs/librrgraph/src/base/rr_graph_view.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ class RRGraphView {
321321
inline short edge_switch(RRNodeId id, t_edge_size iedge) const {
322322
return node_storage_.edge_switch(id, iedge);
323323
}
324+
325+
/** @brief Get the source node for the specified edge. */
326+
inline RRNodeId edge_src_node(const RREdgeId edge_id) const {
327+
return node_storage_.edge_src_node(edge_id);
328+
}
329+
324330
/** @brief Get the destination node for the iedge'th edge from specified RRNodeId.
325331
* This method should generally not be used, and instead first_edge and
326332
* last_edge should be used.*/

libs/libvtrutil/cmake/modules/configure_version.cmake

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
#Figure out the git revision
55
find_package(Git QUIET)
66
if(GIT_FOUND)
7-
exec_program(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}
8-
ARGS describe --always --long --dirty
9-
OUTPUT_VARIABLE VTR_VCS_REVISION
10-
RETURN_VALUE GIT_DESCRIBE_RETURN_VALUE)
7+
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty
8+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
9+
OUTPUT_VARIABLE VTR_VCS_REVISION
10+
OUTPUT_STRIP_TRAILING_WHITESPACE
11+
RESULT_VARIABLE GIT_DESCRIBE_RETURN_VALUE)
1112

1213
if(NOT GIT_DESCRIBE_RETURN_VALUE EQUAL 0)
1314
#Git describe failed, usually this means we
@@ -18,10 +19,12 @@ if(GIT_FOUND)
1819

1920
#Call again with exclude to get the revision excluding any tags
2021
#(i.e. just the commit ID and dirty flag)
21-
exec_program(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}
22-
ARGS describe --always --long --dirty --exclude '*'
23-
OUTPUT_VARIABLE VTR_VCS_REVISION_SHORT
24-
RETURN_VALUE GIT_DESCRIBE_RETURN_VALUE)
22+
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty --exclude '*'
23+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
24+
OUTPUT_VARIABLE VTR_VCS_REVISION_SHORT
25+
OUTPUT_STRIP_TRAILING_WHITESPACE
26+
RESULT_VARIABLE GIT_DESCRIBE_RETURN_VALUE)
27+
2528
if(NOT GIT_DESCRIBE_RETURN_VALUE EQUAL 0)
2629
#Git describe failed, usually this means we
2730
#aren't in a git repo -- so don't set a VCS

0 commit comments

Comments
 (0)