Skip to content

Commit 9c4057a

Browse files
authored
Merge branch 'master' into placement_search_range
2 parents a1d67f7 + d5dc5f7 commit 9c4057a

File tree

207 files changed

+3791
-2222
lines changed

Some content is hidden

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

207 files changed

+3791
-2222
lines changed

.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ IndentCaseLabels: true
6969
IndentWidth: 4
7070
IndentWrappedFunctionNames: false
7171
IndentPPDirectives: None
72+
InsertNewlineAtEOF: true
7273
JavaScriptQuotes: Leave
7374
JavaScriptWrapImports: true
7475
KeepEmptyLinesAtTheStartOfBlocks: true

.github/workflows/stale.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Close Stale Issues'
2+
on:
3+
schedule:
4+
# Run everyday at 1 PM UTC
5+
- cron: '0 13 * * *'
6+
7+
jobs:
8+
stale:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/stale@v9
12+
with:
13+
# The message to be shown for stale issues
14+
stale-issue-message: 'This issue has been inactive for a year and has been marked as stale. It will be closed in 15 days if it continues to be stale. If you believe this is still an issue, please add a comment.'
15+
close-issue-message: 'This issue has been marked stale for 15 days and has been automatically closed.'
16+
# If you want to exempt an issue from being marked stale/deleted, label it as 'no-stale'
17+
exempt-issue-labels: 'no-stale'
18+
days-before-issue-stale: 365
19+
days-before-issue-close: 15
20+
# Start from the oldest issues
21+
ascending: true
22+
23+
# The configuration below can be used to allow the same behaviour with PRs.
24+
# Since we currently don't want to close old PRs, it is commented out but
25+
# left here in case we change our mind.
26+
27+
# stale-pr-message: 'This PR has been inactive for a year and has been marked as stale. It will be closed in 15 days if it continues to be stale. If you are still working on this PR, please add a comment.'
28+
# close-pr-message: 'This PR has been marked stale for 15 days and has been automatically closed.'
29+
# exempt-pr-labels: 'no-stale'
30+
# days-before-pr-stale: 365
31+
# days-before-pr-close: 15

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ This information helps us to quickly reproduce (and hopefully fix) the issue:
7777

7878
Tell us what version of VTR you are using (e.g. the output of `vpr --version`), which Operating System and compiler you are using, or any other relevant information about where or how you are building/running VTR.
7979

80-
Once you've gathered all the information [open an Issue](https://github.com/verilog-to-routing/vtr-verilog-to-routing/issues/new?template=bug_report.md) on our issue tracker.
80+
Once you've gathered all the information [open an Issue](https://github.com/verilog-to-routing/vtr-verilog-to-routing/issues/new?template=bug_report.md) on our issue tracker. Issues that do not have any activity for a year will be automatically marked as stale and will be closed after 15 days of being marked as stale.
8181

8282
If you know how to fix the issue, or already have it coded-up, please also consider [submitting the fix](#submitting-code-to-vtr).
8383
This is likely the fastest way to get bugs fixed!

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ ifeq ($(VERBOSE),1)
4848
override CMAKE_PARAMS := -DVTR_ENABLE_VERBOSE=on ${CMAKE_PARAMS}
4949
endif
5050

51-
# -s : Suppresss makefile output (e.g. entering/leaving directories)
51+
# -s : Suppresses makefile output (e.g. entering/leaving directories)
5252
# --output-sync target : For parallel compilation ensure output for each target is synchronized (make version >= 4.0)
5353
MAKEFLAGS := -s
5454

5555
SOURCE_DIR := $(PWD)
5656
BUILD_DIR ?= build
5757

58-
#Check for the cmake exectuable
58+
#Check for the cmake executable
5959
CMAKE := $(shell command -v cmake 2> /dev/null)
6060

6161
#Show test log on failures with 'make test'

doc/src/api/vtrutil/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ VTRUTIL API
1111
container_utils
1212
logging
1313
geometry
14+
parallel
1415
other

doc/src/api/vtrutil/parallel.rst

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=====
2+
Parallel
3+
=====
4+
5+
vtr_thread_pool
6+
-------------
7+
.. doxygenfile:: vtr_thread_pool.h
8+
:project: vtr
9+
:sections: briefdescription detaileddescription func innernamespace enum
10+
11+
.. doxygenclass:: vtr::thread_pool
12+
:project: vtr
13+
:members:

doc/src/vpr/command_line_usage.rst

+18-1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,14 @@ Use the options below to override this default naming behaviour.
379379

380380
.. seealso:: :ref:`Routing Resource XML File <vpr_route_resource_file>`.
381381

382+
.. option:: --read_rr_edge_override <file>
383+
384+
Reads a file that overrides the intrinsic delay of specific edges in RR graph.
385+
386+
This option should be used with both :option:`--read_rr_graph` and :option:`--write_rr_graph`. When used this way,
387+
VPR reads the RR graph, updates the delays of selected edges using :option:`--read_rr_edge_override`,
388+
and writes the updated RR graph. The modified RR graph can then be used in later VPR runs.
389+
382390
.. option:: --read_vpr_constraints <file>
383391

384392
Reads the :ref:`VPR constraints <vpr_constraints>` that the flow must respect from the specified XML file.
@@ -1214,7 +1222,7 @@ Analytical Placement is generally split into three stages:
12141222
Uses the legalized solution as anchor-points to pull the solution to a
12151223
more legal solution (similar to the approach from SimPL :cite:`Kim2013_SimPL`).
12161224

1217-
**Default:** ``qp-hybrid``
1225+
**Default:** ``lp-b2b``
12181226

12191227
.. option:: --ap_partial_legalizer {bipartitioning | flow-based}
12201228

@@ -1253,6 +1261,15 @@ Analytical Placement is generally split into three stages:
12531261

12541262
**Default:** ``annealer``
12551263

1264+
.. option:: --ap_timing_tradeoff <float>
1265+
1266+
Controls the trade-off between wirelength (HPWL) and delay minimization in the AP flow.
1267+
1268+
A value of 0.0 makes the AP flow focus completely on wirelength minimization,
1269+
while a value of 1.0 makes the AP flow focus completely on timing optimization.
1270+
1271+
**Default:** ``0.5``
1272+
12561273
.. option:: --ap_verbosity <int>
12571274

12581275
Controls the verbosity of the AP flow output.

doc/src/vpr/file_formats.rst

+22
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,28 @@ To aid in handling large graphs, rr_graph files can also be :ref:`saved in <file
11001100

11011101
.. _end:
11021102

1103+
RR Graph Edge Attribute Override File Format (.txt)
1104+
---------------------------------------------------
1105+
This file lets users override attributes of specific edges in the RR graph. Currently, only the intrinsic delay (Tdel)
1106+
can be changed. The expected format is:
1107+
1108+
.. code-block:: none
1109+
1110+
# edge Tdel
1111+
64812 5.9e-11
1112+
9981 4.2e-11
1113+
1234 7.1e-11
1114+
4321 9.4e-11
1115+
(42, 64) 7.3e-11
1116+
1117+
.. _end:
1118+
1119+
Lines starting with # are comments and ignored. Each other line should specify either: an edge ID and its new delay, or
1120+
a source/sink node pair and its delay.
1121+
1122+
This allows more accurate modeling of switch delays in the RR graph without creating many switch types
1123+
in the architecture file and limiting them to small regions. This can be useful for more detailed modeling of
1124+
a fabricated FPGA where layout differences lead to small delay differences in the same type of routing switch.
11031125

11041126
Network-on-Chip (NoC) Traffic Flows Format (.flows)
11051127
---------------------------------------------------

libs/EXTERNAL/libcatch2

libs/libarchfpga/src/cad_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct t_cluster_placement_primitive {
126126
t_pb_graph_node* pb_graph_node;
127127
bool valid;
128128
float base_cost; /* cost independent of current status of packing */
129-
float incremental_cost; /* cost dependant on current status of packing */
129+
float incremental_cost; /* cost dependent on current status of packing */
130130
};
131131

132132
#endif

libs/libarchfpga/src/device_grid.h

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ class DeviceGrid {
8080
inline int get_height_offset(const t_physical_tile_loc& tile_loc) const {
8181
return grid_[tile_loc.layer_num][tile_loc.x][tile_loc.y].height_offset;
8282
}
83+
///@brief Returns true if the given location is the root location (bottom left corner) of a tile.
84+
inline bool is_root_location(const t_physical_tile_loc& tile_loc) const {
85+
return get_width_offset(tile_loc) == 0 && get_height_offset(tile_loc) == 0;
86+
}
8387

8488
///@brief Returns a rectangle which represents the bounding box of the tile at the given location.
8589
inline vtr::Rect<int> get_tile_bb(const t_physical_tile_loc& tile_loc) const {

libs/libarchfpga/src/physical_types.cpp

+37-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,42 @@ bool t_rr_switch_inf::configurable() const {
7171
return switch_type_is_configurable(type());
7272
}
7373

74+
bool t_rr_switch_inf::operator==(const t_rr_switch_inf& other) const {
75+
return R == other.R
76+
&& Cin == other.Cin
77+
&& Cout == other.Cout
78+
&& Cinternal == other.Cinternal
79+
&& Tdel == other.Tdel
80+
&& mux_trans_size == other.mux_trans_size
81+
&& buf_size == other.buf_size
82+
&& power_buffer_type == other.power_buffer_type
83+
&& power_buffer_size == other.power_buffer_size
84+
&& intra_tile == other.intra_tile
85+
&& type() == other.type();
86+
}
87+
88+
std::size_t t_rr_switch_inf::Hasher::operator()(const t_rr_switch_inf& s) const {
89+
std::size_t hash_val = 0;
90+
91+
auto hash_combine = [&hash_val](auto&& val) {
92+
hash_val ^= std::hash<std::decay_t<decltype(val)>>{}(val) + 0x9e3779b9 + (hash_val << 6) + (hash_val >> 2);
93+
};
94+
95+
hash_combine(s.R);
96+
hash_combine(s.Cin);
97+
hash_combine(s.Cout);
98+
hash_combine(s.Cinternal);
99+
hash_combine(s.Tdel);
100+
hash_combine(s.mux_trans_size);
101+
hash_combine(s.buf_size);
102+
hash_combine(static_cast<int>(s.power_buffer_type));
103+
hash_combine(s.power_buffer_size);
104+
hash_combine(s.intra_tile);
105+
hash_combine(static_cast<int>(s.type()));
106+
107+
return hash_val;
108+
}
109+
74110
void t_rr_switch_inf::set_type(SwitchType type_val) {
75111
type_ = type_val;
76112
}
@@ -360,4 +396,4 @@ const t_physical_tile_port* t_sub_tile::get_port_by_pin(int pin) const {
360396
}
361397

362398
return nullptr;
363-
}
399+
}

libs/libarchfpga/src/physical_types.h

+40-9
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,13 @@ struct t_port_power {
540540
bool reverse_scaled; /* Scale by (1-prob) */
541541
};
542542

543-
//The type of Fc specification
543+
/**
544+
* @enum e_fc_type
545+
* @brief The type of Fc specification
546+
*/
544547
enum class e_fc_type {
545-
IN, //The fc specification for an input pin
546-
OUT //The fc specification for an output pin
548+
IN, /**< Fc specification for an input pin. */
549+
OUT /**< Fc specification for an output pin. */
547550
};
548551

549552
//The value type of the Fc specification
@@ -1562,6 +1565,7 @@ enum e_directionality {
15621565
UNI_DIRECTIONAL,
15631566
BI_DIRECTIONAL
15641567
};
1568+
15651569
/* X_AXIS: Data that describes an x-directed wire segment (CHANX) *
15661570
* Y_AXIS: Data that describes an y-directed wire segment (CHANY) *
15671571
* BOTH_AXIS: Data that can be applied to both x-directed and y-directed wire segment */
@@ -1584,16 +1588,31 @@ enum class SegResType {
15841588
NUM_RES_TYPES
15851589
};
15861590

1587-
constexpr std::array<const char*, static_cast<size_t>(SegResType::NUM_RES_TYPES)> RES_TYPE_STRING = {{"GCLK", "GENERAL"}}; //String versions of segment resource types
1591+
/// String versions of segment resource types
1592+
constexpr std::array<const char*, static_cast<size_t>(SegResType::NUM_RES_TYPES)> RES_TYPE_STRING{"GCLK", "GENERAL"};
15881593

1594+
/// Defines the type of switch block used in FPGA routing.
15891595
enum e_switch_block_type {
1596+
/// If the type is SUBSET, I use a Xilinx-like switch block where track i in one channel always
1597+
/// connects to track i in other channels.
15901598
SUBSET,
1599+
1600+
/// If type is WILTON, I use a switch block where track i
1601+
/// does not always connect to track i in other channels.
1602+
/// See Steve Wilton, PhD Thesis, University of Toronto, 1996.
15911603
WILTON,
1604+
1605+
/// The UNIVERSAL switch block is from Y. W. Chang et al, TODAES, Jan. 1996, pp. 80 - 101.
15921606
UNIVERSAL,
1607+
1608+
/// The FULL switch block type allows for complete connectivity between tracks.
15931609
FULL,
1610+
1611+
/// A CUSTOM switch block has also been added which allows a user to describe custom permutation functions and connection patterns.
1612+
/// See comment at top of SRC/route/build_switchblocks.c
15941613
CUSTOM
15951614
};
1596-
typedef enum e_switch_block_type t_switch_block_type;
1615+
15971616
enum e_Fc_type {
15981617
ABSOLUTE,
15991618
FRACTIONAL
@@ -1902,16 +1921,28 @@ struct t_rr_switch_inf {
19021921
bool intra_tile = false;
19031922

19041923
public:
1905-
//Returns the type of switch
1924+
/// Returns the type of switch
19061925
SwitchType type() const;
19071926

1908-
//Returns true if this switch type isolates its input and output into
1909-
//separate DC-connected subcircuits
1927+
/// Returns true if this switch type isolates its input and output into
1928+
/// separate DC-connected subcircuits
19101929
bool buffered() const;
19111930

1912-
//Returns true if this switch type is configurable
1931+
/// Returns true if this switch type is configurable
19131932
bool configurable() const;
19141933

1934+
bool operator==(const t_rr_switch_inf& other) const;
1935+
1936+
/**
1937+
* @brief Functor for computing a hash value for t_rr_switch_inf.
1938+
*
1939+
* This custom hasher enables the use of t_rr_switch_inf objects as keys
1940+
* in unordered containers such as std::unordered_map or std::unordered_set.
1941+
*/
1942+
struct Hasher {
1943+
std::size_t operator()(const t_rr_switch_inf& s) const;
1944+
};
1945+
19151946
public:
19161947
void set_type(SwitchType type_val);
19171948

libs/libarchfpga/src/read_xml_arch_file.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4818,4 +4818,4 @@ static T* get_type_by_name(std::string_view type_name, std::vector<T>& types) {
48184818

48194819
archfpga_throw(__FILE__, __LINE__,
48204820
"Could not find type: %s\n", type_name);
4821-
}
4821+
}

libs/libarchfpga/src/read_xml_arch_file_noc_tag.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -684,4 +684,4 @@ static void process_noc_overrides(pugi::xml_node noc_overrides_tag,
684684
bad_tag(override_tag, loc_data, noc_overrides_tag, {"router", "link"});
685685
}
686686
}
687-
}
687+
}

libs/libarchfpga/src/write_models_bb.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ void DeclareModel_bb(FILE* Echo, const t_model* model) {
116116

117117
// endmodule
118118
fprintf(Echo, "endmodule\n\n");
119-
}
119+
}

libs/libarchfpga/test/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#define CATCH_CONFIG_MAIN
2-
#include "catch2/catch_test_macros.hpp"
2+
#include "catch2/catch_test_macros.hpp"

libs/libarchfpga/test/test_read_xml_arch_file.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,4 @@ TEST_CASE("Verifying mesh topology creation", "[NoC Arch Tests]") {
269269
REQUIRE(vtr::isclose(golden_results_y[expected_router_id], test_noc.router_list[expected_router_id].device_y_position));
270270
}
271271
}
272-
}
272+
}

libs/liblog/src/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ int main() {
1515

1616
log_print_info("Test complete\n");
1717
return 0;
18-
}
18+
}

libs/librrgraph/src/base/check_rr_graph.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ void check_rr_graph(const RRGraphView& rr_graph,
5353
const vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data,
5454
const DeviceGrid& grid,
5555
const t_chan_width& chan_width,
56-
const t_graph_type graph_type,
56+
const e_graph_type graph_type,
5757
bool is_flat) {
5858
e_route_type route_type = DETAILED;
59-
if (graph_type == GRAPH_GLOBAL) {
59+
if (graph_type == e_graph_type::GLOBAL) {
6060
route_type = GLOBAL;
6161
}
6262

libs/librrgraph/src/base/check_rr_graph.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void check_rr_graph(const RRGraphView& rr_graph,
1010
const vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data,
1111
const DeviceGrid& grid,
1212
const t_chan_width& chan_width,
13-
const t_graph_type graph_type,
13+
const e_graph_type graph_type,
1414
bool is_flat);
1515

1616
void check_rr_node(const RRGraphView& rr_graph,

libs/librrgraph/src/base/get_parallel_segs.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include "get_parallel_segs.h"
22

3-
/*Gets t_segment_inf for parallel segments as defined by the user.
4-
*Segments that have BOTH_AXIS attribute value are always included in the returned vector.*/
53
std::vector<t_segment_inf> get_parallel_segs(const std::vector<t_segment_inf>& segment_inf,
64
t_unified_to_parallel_seg_index& seg_index_map,
75
enum e_parallel_axis parallel_axis) {

0 commit comments

Comments
 (0)