@@ -80,7 +80,7 @@ static bool check_pb_route_for_block(ClusterBlockId clb_id,
8080 PB_route_error& err) {
8181 err.reset ();
8282 err.clb_id_ = clb_id;
83- err.clbLoc_ = plCon.block_locs [clb_id];
83+ err.clbLoc_ = plCon.block_locs () [clb_id];
8484
8585 const t_pb& clb = *clCon.clb_nlist .block_pb (clb_id);
8686 VTR_ASSERT (clb.name );
@@ -260,7 +260,7 @@ static void update_cluster_pin_with_post_routing_results(const Netlist<>& net_li
260260 * Deposit all the sides
261261 */
262262 if (wanted_sides.empty ()) {
263- for (e_side side : {TOP, BOTTOM, LEFT, RIGHT} ) {
263+ for (e_side side : TOTAL_2D_SIDES ) {
264264 wanted_sides.push_back (side);
265265 }
266266 }
@@ -309,55 +309,49 @@ static void update_cluster_pin_with_post_routing_results(const Netlist<>& net_li
309309 ParentNetId routing_net_id = ParentNetId::INVALID ();
310310 std::vector<RRNodeId> visited_rr_nodes;
311311 short valid_routing_net_cnt = 0 ;
312- int addToY = 0 , addToX = 0 ;
313- addToY = physical_tile->height ;
314- addToX = physical_tile->width ;
315- for (int ix = 0 ; ix < addToX; ix++) {
316- for (int iy = 0 ; iy < addToY; iy++) {
317- for (const e_side& pin_side : pin_sides) {
318- /* Find the net mapped to this pin in routing results */
319- RRNodeId rr_node = node_lookup.find_node (coord_layer, coord_x + ix, coord_y + iy, rr_node_type, physical_pin, pin_side);
320-
321- /* Bypass invalid nodes, after that we must have a valid rr_node id */
322- if (!rr_node) {
323- continue ;
324- }
325- VTR_ASSERT ((size_t )rr_node < device_ctx.rr_graph .num_nodes ());
312+ for (const e_side& pin_side : pin_sides) {
313+ /* Find the net mapped to this pin in routing results */
314+ RRNodeId rr_node = node_lookup.find_node (coord_layer, coord_x, coord_y, rr_node_type, physical_pin, pin_side);
326315
327- /* If the node has been visited on the other side, we just skip it */
328- if (visited_rr_nodes.end () != std::find (visited_rr_nodes.begin (), visited_rr_nodes.end (), RRNodeId (rr_node))) {
329- continue ;
330- }
316+ /* Bypass invalid nodes, after that we must have a valid rr_node id */
317+ if (!rr_node) {
318+ continue ;
319+ }
320+ VTR_ASSERT ((size_t )rr_node < device_ctx.rr_graph .num_nodes ());
331321
332- /* Get the cluster net id which has been mapped to this net
333- * In general, there is only one valid rr_node among all the sides.
334- * However, we have an exception in the Stratix-IV arch modeling,
335- * where a pb_pin may exist in two different sides but
336- * router will only map to 1 rr_node
337- * Therefore, it is better to compare the routing nets
338- * for all the sides and pick
339- * - The unique valid net id (others should be all invalid)
340- * assume that this pin is used by router
341- * - A invalid net id (others should be all invalid as well)
342- * assume that this pin is not used by router
343- */
344- if (rr_node_nets[rr_node]) {
345- if (routing_net_id) {
346- if (routing_net_id != rr_node_nets[rr_node]) {
347- VTR_LOG_ERROR (" Pin '%s' is mapped to two nets: '%s' and '%s'\n " ,
348- pb_graph_pin->to_string ().c_str (),
349- net_list.net_name (routing_net_id).c_str (),
350- net_list.net_name (rr_node_nets[rr_node]).c_str ());
351- }
352- VTR_ASSERT (routing_net_id == rr_node_nets[rr_node]);
353- }
354- routing_net_id = rr_node_nets[rr_node];
355- valid_routing_net_cnt++;
356- visited_rr_nodes.push_back (rr_node);
322+ /* If the node has been visited on the other side, we just skip it */
323+ if (visited_rr_nodes.end () != std::find (visited_rr_nodes.begin (), visited_rr_nodes.end (), RRNodeId (rr_node))) {
324+ continue ;
325+ }
326+
327+ /* Get the cluster net id which has been mapped to this net
328+ * In general, there is only one valid rr_node among all the sides.
329+ * However, we have an exception in the Stratix-IV arch modeling,
330+ * where a pb_pin may exist in two different sides but
331+ * router will only map to 1 rr_node
332+ * Therefore, it is better to compare the routing nets
333+ * for all the sides and pick
334+ * - The unique valid net id (others should be all invalid)
335+ * assume that this pin is used by router
336+ * - A invalid net id (others should be all invalid as well)
337+ * assume that this pin is not used by router
338+ */
339+ if (rr_node_nets[rr_node]) {
340+ if (routing_net_id) {
341+ if (routing_net_id != rr_node_nets[rr_node]) {
342+ VTR_LOG_ERROR (" Pin '%s' is mapped to two nets: '%s' and '%s'\n " ,
343+ pb_graph_pin->to_string ().c_str (),
344+ net_list.net_name (routing_net_id).c_str (),
345+ net_list.net_name (rr_node_nets[rr_node]).c_str ());
357346 }
347+ VTR_ASSERT (routing_net_id == rr_node_nets[rr_node]);
358348 }
349+ routing_net_id = rr_node_nets[rr_node];
350+ valid_routing_net_cnt++;
351+ visited_rr_nodes.push_back (rr_node);
359352 }
360353 }
354+
361355 VTR_ASSERT ((0 == valid_routing_net_cnt) || (1 == valid_routing_net_cnt));
362356
363357 /* Find the net mapped to this pin in clustering results*/
@@ -935,8 +929,7 @@ static void update_cluster_regular_routing_traces_with_post_routing_results(Atom
935929 */
936930 VTR_ASSERT (sink_pb_route == sink_pb_pin_to_add->pin_count_in_cluster );
937931 t_pb_graph_pin* new_sink_pb_pin_to_add = sink_pb_pin_to_add;
938- // VTR_ASSERT(is_single_fanout_pb_pin(const_cast<const t_pb_graph_pin*>(new_sink_pb_pin_to_add)));
939- VTR_ASSERT (new_sink_pb_pin_to_add->output_edges [0 ]->num_output_pins == 1 );
932+ VTR_ASSERT (is_single_fanout_pb_pin (const_cast <const t_pb_graph_pin*>(new_sink_pb_pin_to_add)));
940933 int new_driver_pb_pin = pb_graph_pin->pin_count_in_cluster ;
941934 while (1 ) {
942935 int new_sink_pb_route_id = new_sink_pb_pin_to_add->pin_count_in_cluster ;
@@ -1045,7 +1038,7 @@ static void update_cluster_regular_routing_traces_with_post_routing_results(Atom
10451038 for (int & sink_pb_route : new_pb_route.sink_pb_pin_ids ) {
10461039 usedItems.push_back (sink_pb_route);
10471040 }
1048-
1041+
10491042 VTR_LOGV (verbose,
10501043 " Remap clustered block '%s' routing trace[%d] to net '%s'\n " ,
10511044 clustering_ctx.clb_nlist .block_pb (blk_id)->name ,
@@ -1264,18 +1257,15 @@ void sync_netlists_to_routing(const Netlist<>& net_list,
12641257 clb_blk_id = convert_to_cluster_block_id (blk_id);
12651258 }
12661259 VTR_ASSERT (clb_blk_id != ClusterBlockId::INVALID ());
1267- // vtr::Point<size_t> grid_coord(placement_ctx.block_locs[clb_blk_id].loc.x,
1268- // placement_ctx.block_locs[clb_blk_id].loc.y);
12691260
12701261 if (seen_block_ids.insert (clb_blk_id).second ) {
12711262 update_cluster_pin_with_post_routing_results (net_list,
12721263 atom_ctx,
12731264 device_ctx,
12741265 clustering_ctx,
12751266 rr_node_nets,
1276- placement_ctx.block_locs [clb_blk_id].loc ,
1267+ placement_ctx.block_locs () [clb_blk_id].loc ,
12771268 clb_blk_id,
1278- // placement_ctx.block_locs[clb_blk_id].loc.sub_tile,
12791269 num_mismatches,
12801270 verbose,
12811271 is_flat);
0 commit comments