File tree 5 files changed +22
-1
lines changed
5 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ bool NegativeFirstRouting::is_turn_legal(const std::array<std::reference_wrapper
119
119
const int x3 = noc_routers[2 ].get ().get_router_grid_position_x ();
120
120
const int y3 = noc_routers[2 ].get ().get_router_grid_position_y ();
121
121
122
+ // check if the given routers can be traversed one after another
122
123
VTR_ASSERT (x2 == x1 || y2 == y1 );
123
124
VTR_ASSERT (x3 == x2 || y3 == y2);
124
125
@@ -127,10 +128,16 @@ bool NegativeFirstRouting::is_turn_legal(const std::array<std::reference_wrapper
127
128
return false ;
128
129
}
129
130
131
+ /* In negative-first routing algorithm, a traffic flow
132
+ * can't take a downward turn if it is travelling toward right direction.
133
+ */
130
134
if (x2 > x1 && y3 < y2) {
131
135
return false ;
132
136
}
133
137
138
+ /* In negative-first routing algorithm, a traffic flow
139
+ * can't take a left turn if it is travelling upwards.
140
+ */
134
141
if (y2 > y1 && x3 < x2) {
135
142
return false ;
136
143
}
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ bool NorthLastRouting::is_turn_legal(const std::array<std::reference_wrapper<con
108
108
const int x3 = noc_routers[2 ].get ().get_router_grid_position_x ();
109
109
const int y3 = noc_routers[2 ].get ().get_router_grid_position_y ();
110
110
111
+ // check if the given routers can be traversed one after another
111
112
VTR_ASSERT (x2 == x1 || y2 == y1 );
112
113
VTR_ASSERT (x3 == x2 || y3 == y2);
113
114
@@ -116,6 +117,11 @@ bool NorthLastRouting::is_turn_legal(const std::array<std::reference_wrapper<con
116
117
return false ;
117
118
}
118
119
120
+ /* In the north-last algorithm, once the north direction is taken, no other
121
+ * direction can be followed. Therefore, if the first link moves upward, the
122
+ * second one cannot move horizontally. The case where the second link goes
123
+ * back to the first router was checked in the previous if statement.
124
+ */
119
125
if (y2 > y1 && x2 != x3) {
120
126
return false ;
121
127
}
Original file line number Diff line number Diff line change @@ -171,13 +171,13 @@ bool OddEvenRouting::is_turn_legal(const std::array<std::reference_wrapper<const
171
171
const int x3 = noc_routers[2 ].get ().get_router_grid_position_x ();
172
172
const int y3 = noc_routers[2 ].get ().get_router_grid_position_y ();
173
173
174
+ // check if the given routers can be traversed one after another
174
175
VTR_ASSERT (x2 == x1 || y2 == y1 );
175
176
VTR_ASSERT (x3 == x2 || y3 == y2);
176
177
177
178
// get the position of the second NoC routers
178
179
const auto router2_pos = noc_routers[1 ].get ().get_router_physical_location ();
179
180
180
-
181
181
// Get the logical block type for router
182
182
const auto router_block_type = cluster_ctx.clb_nlist .block_type (noc_ctx.noc_traffic_flows_storage .get_router_clusters_in_netlist ()[0 ]);
183
183
@@ -192,6 +192,7 @@ bool OddEvenRouting::is_turn_legal(const std::array<std::reference_wrapper<const
192
192
return false ;
193
193
}
194
194
195
+ // check if the turn is compatible with odd-even routing algorithm turn restrictions
195
196
if (is_odd (compressed_2_loc.x )) {
196
197
if (y2 != y1 && x3 < x2) {
197
198
return false ;
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ bool WestFirstRouting::is_turn_legal(const std::array<std::reference_wrapper<con
105
105
const int x3 = noc_routers[2 ].get ().get_router_grid_position_x ();
106
106
const int y3 = noc_routers[2 ].get ().get_router_grid_position_y ();
107
107
108
+ // check if the given routers can be traversed one after another
108
109
VTR_ASSERT (x2 == x1 || y2 == y1 );
109
110
VTR_ASSERT (x3 == x2 || y3 == y2);
110
111
@@ -113,6 +114,11 @@ bool WestFirstRouting::is_turn_legal(const std::array<std::reference_wrapper<con
113
114
return false ;
114
115
}
115
116
117
+ /* In the west-first routing algorithm, once the traffic flow
118
+ * moved in a vertical direction, it is no longer allowed to move
119
+ * towards west. Therefore, if the first link was travelling in a
120
+ * vertical direction, the second link can't move towards left.
121
+ */
116
122
if (y2 != y1 && x3 < x2) {
117
123
return false ;
118
124
}
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ bool XYRouting::is_turn_legal(const std::array<std::reference_wrapper<const NocR
92
92
const int x3 = noc_routers[2 ].get ().get_router_grid_position_x ();
93
93
const int y3 = noc_routers[2 ].get ().get_router_grid_position_y ();
94
94
95
+ // check if the given routers can be traversed one after another
95
96
VTR_ASSERT (x2 == x1 || y2 == y1 );
96
97
VTR_ASSERT (x3 == x2 || y3 == y2);
97
98
You can’t perform that action at this time.
0 commit comments