Skip to content

Commit a9d6ba1

Browse files
author
Nathan Shreve
committed
Merge branch 'master' into improve_map_lookahead
2 parents 9959121 + 16adbfa commit a9d6ba1

File tree

114 files changed

+241705
-5173
lines changed

Some content is hidden

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

114 files changed

+241705
-5173
lines changed

doc/src/vpr/placement_constraints.rst

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ A Placement Constraints File Example
2828
<add_atom name_pattern="n4917"/>
2929
<add_atom name_pattern="n6010"/>
3030
</partition>
31+
32+
<partition name="Part2">
33+
<add_region x_low="3" y_low="3" x_high="85" y_high="85"/> <!-- When the layer is not explicitly specified, layer 0 is assumed. -->
34+
<add_region x_low="8" y_low="5" x_high="142" y_high="29 layer_low="0" layer_high="1"/> <!-- In 3D architectures, the region can span across multiple layers. -->
35+
<add_region x_low="6" y_low="55" x_high="50" y_high="129 layer_low="2" layer_high="2"/> <!-- If the region only covers a non-zero layer, both layer_low and layer_high must be set the same value. -->
36+
<add_atom name_pattern="n135"/>
37+
<add_atom name_pattern="n7016"/>
38+
</partition>
3139
</partition_list>
3240
</vpr_constraints>
3341
@@ -75,7 +83,10 @@ The ``name_pattern`` can be the exact name of the atom from the input atom netli
7583
Region
7684
^^^^^^
7785

78-
An ``<add_region>`` tag is used to add a region to the partition. A ``region`` is a rectangular area on the chip. A partition can contain any number of independent regions - the regions within one partition must not overlap with each other (in order to ease processing when loading in the file). An ``<add_region>`` tag has the following attributes.
86+
An ``<add_region>`` tag is used to add a region to the partition. A ``region`` is a rectangular area or cubic volume
87+
on the chip. A partition can contain any number of independent regions - the regions within one partition **must not**
88+
overlap with each other (in order to ease processing when loading in the file).
89+
An ``<add_region>`` tag has the following attributes.
7990

8091
:req_param x_low:
8192
The x value of the lower left point of the rectangle.
@@ -90,11 +101,30 @@ An ``<add_region>`` tag is used to add a region to the partition. A ``region`` i
90101
The y value of the upper right point of the rectangle.
91102

92103
:opt_param subtile:
93-
Each x, y location on the grid may contain multiple locations known as subtiles. This paramter is an optional value specifying the subtile location that the atom(s) of the partition shall be constrained to.
104+
Each x, y location on the grid may contain multiple locations known as subtiles. This parameter is an optional value specifying the subtile location that the atom(s) of the partition shall be constrained to.
105+
106+
:opt_param layer_low:
107+
The lowest layer number that the region covers. The default value is 0.
108+
109+
:opt_param layer_high:
110+
The highest layer number that the region covers. The default value is 0.
94111

95112
The optional ``subtile`` attribute is commonly used when constraining an atom to a specific location on the chip (e.g. an exact I/O location). It is legal to use with larger regions, but uncommon.
96113

97-
If a user would like to specify an area on the chip with an unusual shape (e.g. L-shaped or T-shaped), they can simply add multiple ``<add_region>`` tags to cover the area specified.
114+
In 2D architectures, ``layer_low`` and ``layer_high`` can be safely ignored as their default value is 0.
115+
In 3D architectures, a region can span across multiple layers or be assigned to a specific layer.
116+
For assigning a region to a specific non-zero layer, the user should set both ``layer_low`` and ``layer_high`` to the
117+
desired layer number. If a layer range is to be covered by the region, the user set ``layer_low`` and ``layer_high`` to
118+
different values.
119+
120+
If a user would like to specify an area on the chip with an unusual shape (e.g. L-shaped or T-shaped),
121+
they can simply add multiple ``<add_region>`` tags to cover the area specified.
122+
123+
It is strongly recommended that different partitions do not overlap. The packing algorithm compares the number clustered
124+
blocks and the number of physical blocks in a region to decide pack atoms inside a partition more aggressively when
125+
there are not enough resources in a partition. Overlapping partitions causes some physical blocks to be counted in more
126+
than one partition.
127+
98128

99129

100130

libs/libarchfpga/src/echo_arch.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
236236
}
237237

238238
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-
239+
240240
//if there is more than one layer available, print the connection block switch name that is used for connection between two dice
241-
for(const auto& layout : arch->grid_layouts){
241+
for (const auto& layout : arch->grid_layouts) {
242242
int num_layers = (int)layout.layers.size();
243-
if(num_layers > 1){
243+
if (num_layers > 1) {
244244
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());
245245
}
246246
}
@@ -295,11 +295,11 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
295295
fprintf(Echo, "\t\t\t\ttype unidir mux_name for within die connections: %s\n",
296296
arch->Switches[seg.arch_wire_switch].name.c_str());
297297
//if there is more than one layer available, print the segment switch name that is used for connection between two dice
298-
for(const auto& layout : arch->grid_layouts){
298+
for (const auto& layout : arch->grid_layouts) {
299299
int num_layers = (int)layout.layers.size();
300-
if(num_layers > 1){
300+
if (num_layers > 1) {
301301
fprintf(Echo, "\t\t\t\ttype unidir mux_name for between two dice connections: %s\n",
302-
arch->Switches[seg.arch_opin_between_dice_switch].name.c_str());
302+
arch->Switches[seg.arch_opin_between_dice_switch].name.c_str());
303303
}
304304
}
305305
} else { //Should be bidir

libs/libvtrutil/src/vtr_geometry.h

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/**
1414
* @file
15-
* @brief This file include differents different geometry classes
15+
* @brief This file includes different geometry classes
1616
*/
1717

1818
namespace vtr {
@@ -95,9 +95,15 @@ class Point {
9595
/// @brief + operator
9696
Point<T> operator+(const Point<T>& rhs);
9797

98-
/// @brief -= operator
98+
/// @brief - operator
9999
Point<T> operator-(const Point<T>& rhs);
100100

101+
/// @brief += operator
102+
Point<T>& operator+=(const Point<T>& rhs);
103+
104+
/// @brief -= operator
105+
Point<T>& operator-=(const Point<T>& rhs);
106+
101107
private:
102108
T x_;
103109
T y_;
@@ -150,6 +156,12 @@ class Rect {
150156
///@brief Return the top right point
151157
Point<T> top_right() const;
152158

159+
/**
160+
* @brief Return the bottom left and top right coordinates
161+
* @return [xmin, ymin, xmax, ymax]
162+
*/
163+
std::tuple<T, T, T, T> coordinates() const;
164+
153165
///@brief Return the rectangle width
154166
T width() const;
155167

@@ -196,6 +208,12 @@ class Rect {
196208
///@brief set ymax to a point
197209
void set_ymax(T ymax_val);
198210

211+
/// @brief += operator
212+
Rect<T>& operator+=(const Point<T>& rhs);
213+
214+
/// @brief -= operator
215+
Rect<T>& operator-=(const Point<T>& rhs);
216+
199217
///@brief Equivalent to `*this = bounding_box(*this, other)`
200218
Rect<T>& expand_bounding_box(const Rect<T>& other);
201219

@@ -308,7 +326,7 @@ class RectUnion {
308326
friend bool operator!= <>(const RectUnion<T>& lhs, const RectUnion<T>& rhs);
309327

310328
private:
311-
// Note that a union of rectanges may have holes and may not be contiguous
329+
// Note that a union of rectangles may have holes and may not be contiguous
312330
std::vector<Rect<T>> rects_;
313331
};
314332

libs/libvtrutil/src/vtr_geometry.tpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ Point<T> Point<T>::operator-(const Point<T>& rhs) {
6868
return {x_ - rhs.x_, y_ - rhs.y_};
6969
}
7070

71+
template<class T>
72+
Point<T>& Point<T>::operator+=(const Point<T>& rhs) {
73+
x_ += rhs.x_;
74+
y_ += rhs.y_;
75+
return *this;
76+
}
77+
78+
template<class T>
79+
Point<T>& Point<T>::operator-=(const Point<T>& rhs) {
80+
x_ -= rhs.x_;
81+
y_ -= rhs.y_;
82+
return *this;
83+
}
84+
7185
/*
7286
* Rect
7387
*/
@@ -130,6 +144,11 @@ Point<T> Rect<T>::top_right() const {
130144
return top_right_;
131145
}
132146

147+
template<class T>
148+
std::tuple<T, T, T, T> Rect<T>::coordinates() const {
149+
return {xmin(), ymin(), xmax(), ymax()};
150+
}
151+
133152
template<class T>
134153
T Rect<T>::width() const {
135154
return xmax() - xmin();
@@ -234,6 +253,20 @@ void Rect<T>::set_ymax(T ymax_val) {
234253
top_right_.set_y(ymax_val);
235254
}
236255

256+
template<class T>
257+
Rect<T>& Rect<T>::operator+=(const Point<T>& rhs) {
258+
bottom_left_ += rhs;
259+
top_right_ += rhs;
260+
return *this;
261+
}
262+
263+
template<class T>
264+
Rect<T>& Rect<T>::operator-=(const Point<T>& rhs) {
265+
bottom_left_ -= rhs;
266+
top_right_ -= rhs;
267+
return *this;
268+
}
269+
237270
template<class T>
238271
Rect<T>& Rect<T>::expand_bounding_box(const Rect<T>& other) {
239272
*this = bounding_box(*this, other);

0 commit comments

Comments
 (0)