📄 check_rr_graph.c
字号:
xhigh, yhigh); exit(1); } break; case CHANX: if(xlow < 1 || xhigh > nx || yhigh > ny || yhigh != ylow) { printf("Error in check_node: CHANX out of range.\n"); printf("Endpoints: (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh); exit(1); } if(route_type == GLOBAL && xlow != xhigh) { printf ("Error in check_node: node %d spans multiple channel segments\n" "which is not allowed with global routing.\n", inode); exit(1); } break; case CHANY: if(xhigh > nx || ylow < 1 || yhigh > ny || xlow != xhigh) { printf("Error in check_node: CHANY out of range.\n"); printf("Endpoints: (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh); exit(1); } if(route_type == GLOBAL && ylow != yhigh) { printf ("Error in check_node: node %d spans multiple channel segments\n" "which is not allowed with global routing.\n", inode); exit(1); } break; default: printf("Error in check_node: Unexpected segment type: %d\n", rr_type); exit(1); }/* Check that it's capacities and such make sense. */ switch (rr_type) { case SOURCE: if(ptc_num >= type->num_class || type->class_inf[ptc_num].type != DRIVER) { printf ("Error in check_node. Inode %d (type %d) had a ptc_num\n" "of %d.\n", inode, rr_type, ptc_num); exit(1); } if(type->class_inf[ptc_num].num_pins != capacity) { printf ("Error in check_node. Inode %d (type %d) had a capacity\n" "of %d.\n", inode, rr_type, capacity); exit(1); } break; case SINK: if(ptc_num >= type->num_class || type->class_inf[ptc_num].type != RECEIVER) { printf ("Error in check_node. Inode %d (type %d) had a ptc_num\n" "of %d.\n", inode, rr_type, ptc_num); exit(1); } if(type->class_inf[ptc_num].num_pins != capacity) { printf ("Error in check_node. Inode %d (type %d) has a capacity\n" "of %d.\n", inode, rr_type, capacity); exit(1); } break; case OPIN: if(ptc_num >= type->num_pins || type->class_inf[type->pin_class[ptc_num]].type != DRIVER) { printf ("Error in check_node. Inode %d (type %d) had a ptc_num\n" "of %d.\n", inode, rr_type, ptc_num); exit(1); } if(capacity != 1) { printf ("Error in check_node: Inode %d (type %d) has a capacity\n" "of %d.\n", inode, rr_type, capacity); exit(1); } break; case IPIN: if(ptc_num >= type->num_pins || type->class_inf[type->pin_class[ptc_num]].type != RECEIVER) { printf ("Error in check_node. Inode %d (type %d) had a ptc_num\n" "of %d.\n", inode, rr_type, ptc_num); exit(1); } if(capacity != 1) { printf ("Error in check_node: Inode %d (type %d) has a capacity\n" "of %d.\n", inode, rr_type, capacity); exit(1); } break; case CHANX: if(route_type == DETAILED) { nodes_per_chan = chan_width_x[ylow]; tracks_per_node = 1; } else { nodes_per_chan = 1; tracks_per_node = chan_width_x[ylow]; } if(ptc_num >= nodes_per_chan) { printf ("Error in check_node: Inode %d (type %d) has a ptc_num\n" "of %d.\n", inode, rr_type, ptc_num); exit(1); } if(capacity != tracks_per_node) { printf ("Error in check_node: Inode %d (type %d) has a capacity\n" "of %d.\n", inode, rr_type, capacity); exit(1); } break; case CHANY: if(route_type == DETAILED) { nodes_per_chan = chan_width_y[xlow]; tracks_per_node = 1; } else { nodes_per_chan = 1; tracks_per_node = chan_width_y[xlow]; } if(ptc_num >= nodes_per_chan) { printf ("Error in check_node: Inode %d (type %d) has a ptc_num\n" "of %d.\n", inode, rr_type, ptc_num); exit(1); } if(capacity != tracks_per_node) { printf ("Error in check_node: Inode %d (type %d) has a capacity\n" "of %d.\n", inode, rr_type, capacity); exit(1); } break; default: printf("Error in check_node: Unexpected segment type: %d\n", rr_type); exit(1); }/* Check that the number of (out) edges is reasonable. */ num_edges = rr_node[inode].num_edges; if(rr_type != SINK) { if(num_edges <= 0) { printf("Error: in check_node: node %d has no edges.\n", inode); exit(1); } } else { /* SINK -- remove this check if feedthroughs allowed */ if(num_edges != 0) { printf("Error in check_node: node %d is a sink, but has " "%d edges.\n", inode, num_edges); exit(1); } }/* Check that the capacitance, resistance and cost_index are reasonable. */ C = rr_node[inode].C; R = rr_node[inode].R; if(rr_type == CHANX || rr_type == CHANY) { if(C < 0. || R < 0.) { printf ("Error in check_node: node %d of type %d has R = %g " "and C = %g.\n", inode, rr_type, R, C); exit(1); } } else { if(C != 0. || R != 0.) { printf ("Error in check_node: node %d of type %d has R = %g " "and C = %g.\n", inode, rr_type, R, C); exit(1); } } cost_index = rr_node[inode].cost_index; if(cost_index < 0 || cost_index >= num_rr_indexed_data) { printf("Error in check_node: node %d cost index (%d) is out of " "range.\n", inode, cost_index); exit(1); }}static voidcheck_pass_transistors(int from_node){/* This routine checks that all pass transistors in the routing truly are * * bidirectional. It may be a slow check, so don't use it all the time. */ int from_edge, to_node, to_edge, from_num_edges, to_num_edges; t_rr_type from_rr_type, to_rr_type; short from_switch_type; boolean trans_matched; from_rr_type = rr_node[from_node].type; if(from_rr_type != CHANX && from_rr_type != CHANY) return; from_num_edges = rr_node[from_node].num_edges; for(from_edge = 0; from_edge < from_num_edges; from_edge++) { to_node = rr_node[from_node].edges[from_edge]; to_rr_type = rr_node[to_node].type; if(to_rr_type != CHANX && to_rr_type != CHANY) continue; from_switch_type = rr_node[from_node].switches[from_edge]; if(switch_inf[from_switch_type].buffered) continue; /* We know that we have a pass transitor from from_node to to_node. Now * * check that there is a corresponding edge from to_node back to * * from_node. */ to_num_edges = rr_node[to_node].num_edges; trans_matched = FALSE; for(to_edge = 0; to_edge < to_num_edges; to_edge++) { if(rr_node[to_node].edges[to_edge] == from_node && rr_node[to_node].switches[to_edge] == from_switch_type) { trans_matched = TRUE; break; } } if(trans_matched == FALSE) { printf ("Error in check_pass_transistors: Connection from node %d to\n" "node %d uses a pass transistor (switch type %d), but there is\n" "no corresponding pass transistor edge in the other direction.\n", from_node, to_node, from_switch_type); exit(1); } } /* End for all from_node edges */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -