Skip to content

Commit cd2381e

Browse files
more detailed comments
1 parent 844fe90 commit cd2381e

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

libs/libarchfpga/src/device_grid.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,16 @@ class DeviceGrid {
197197
return &grid_.get(n);
198198
}
199199

200-
/// Returns the list of horizontal interposer cut locations for each layer.
200+
/// Returns the list of horizontal interposer cut locations for each layer,
201+
/// i.e. y value of the tile row just below each cut
202+
/// Accessed as [layer][cut_idx]
201203
inline const std::vector<std::vector<int>>& get_horizontal_interposer_cuts() const {
202204
return horizontal_interposer_cuts_;
203205
}
204206

205-
/// Returns the list of vertical interposer cut locations for each layer.
207+
/// Returns the list of vertical interposer cut locations for each layer,
208+
/// i.e. x value of the tile column just to the left each cut
209+
/// Accessed as [layer][cut_idx]
206210
inline const std::vector<std::vector<int>>& get_vertical_interposer_cuts() const {
207211
return vertical_interposer_cuts_;
208212
}
@@ -229,8 +233,12 @@ class DeviceGrid {
229233

230234
std::vector<t_logical_block_type_ptr> limiting_resources_;
231235

232-
/// Horizontal interposer cut locations in each layer.
236+
/// Horizontal interposer cut locations in each layer,
237+
/// i.e. y value of the tile row just below each cut
238+
/// Accessed as [layer][cut_idx]
233239
std::vector<std::vector<int>> horizontal_interposer_cuts_;
234-
/// Vertical interposer cust location in each layer.
240+
/// Vertical interposer cut location in each layer,
241+
/// i.e. x value of the tile column just to the left each cut
242+
/// Accessed as [layer][cut_idx]
235243
std::vector<std::vector<int>> vertical_interposer_cuts_;
236244
};

vpr/src/draw/draw_interposer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ void draw_interposer_cuts(ezgl::renderer* g) {
4343
for (int cut_y : horizontal_cuts[layer]) {
4444
float y;
4545
if (draw_state->pic_on_screen == e_pic_type::PLACEMENT) {
46+
// Draw the interposer line exactly in the middle of routing channel.
4647
y = (draw_coords->tile_y[cut_y + 1] + draw_coords->tile_y[cut_y] + draw_coords->get_tile_height()) / 2.0f;
4748
} else if (draw_state->pic_on_screen == e_pic_type::ROUTING) {
49+
// Draw the interposer above the last track and below the next tile.
50+
// The row below the cut owns the channel, so the cut is drawn closer
51+
// to the row above the cut to make this ownership explicit.
4852
y = draw_coords->tile_y[cut_y + 1] - 0.5f;
4953
} else {
5054
VTR_ASSERT(false);
@@ -56,8 +60,12 @@ void draw_interposer_cuts(ezgl::renderer* g) {
5660
for (int cut_x : vertical_cuts[layer]) {
5761
float x;
5862
if (draw_state->pic_on_screen == e_pic_type::PLACEMENT) {
63+
// Draw the interposer line exactly in the middle of routing channel.
5964
x = (draw_coords->tile_x[cut_x + 1] + draw_coords->tile_x[cut_x] + draw_coords->get_tile_width()) / 2.0f;
6065
} else if (draw_state->pic_on_screen == e_pic_type::ROUTING) {
66+
// Draw the interposer line between the last track and the next column.
67+
// The channel belongs to the column on the left of the cut, so the cut is
68+
// positioned closer to the column on the right to make this ownership clear.
6169
x = draw_coords->tile_x[cut_x + 1] - 0.5f;
6270
} else {
6371
VTR_ASSERT(false);

0 commit comments

Comments
 (0)