33 int inode, iedge, to_node, num_edges, error, num_sinks;
46 for (iedge = 0; iedge < num_edges; iedge++) {
48 if (to_node < 0 || to_node >= num_tnodes) {
49 vpr_printf(TIO_MESSAGE_ERROR,
"in alloc_and_load_tnode_fanin_and_check_edges:\n");
50 vpr_printf(TIO_MESSAGE_ERROR,
"\ttnode #%d edge #%d goes to illegal node #%d.\n",
51 inode, iedge, to_node);
55 tnode_num_fanin[to_node]++;
59 else if (num_edges == 0) {
64 vpr_printf(TIO_MESSAGE_ERROR,
"in alloc_and_load_tnode_fanin_and_check_edges:\n");
65 vpr_printf(TIO_MESSAGE_ERROR,
"\ttnode #%d has %d edges.\n",
73 vpr_printf(TIO_MESSAGE_ERROR,
"Found %d Errors in the timing graph. Aborting.\n", error);
77 *num_sinks_ptr = num_sinks;
78 return (tnode_num_fanin);
88 int inode, num_at_level, iedge, to_node, num_edges, num_sinks, num_levels,
95 int *tnode_fanin_left;
99 free_list_head = NULL;
100 nodes_at_level_head = NULL;
114 for (inode = 0; inode <
num_tnodes; inode++) {
115 if (tnode_fanin_left[inode] == 0) {
123 &tnodes_at_level[0], &free_list_head);
127 while (num_at_level != 0) {
131 for (i = 0; i < tnodes_at_level[num_levels - 1].
nelem; i++) {
132 inode = tnodes_at_level[num_levels - 1].
list[i];
136 for (iedge = 0; iedge < num_edges; iedge++) {
137 to_node = tedge[iedge].
to_node;
138 tnode_fanin_left[to_node]--;
140 if (tnode_fanin_left[to_node] == 0) {
143 nodes_at_level_head, to_node, &free_list_head);
149 &tnodes_at_level[num_levels], &free_list_head);
153 num_levels *
sizeof(
struct s_ivec));
156 free(tnode_fanin_left);
171 int num_tnodes_check, ilevel, error;
174 num_tnodes_check = 0;
179 num_tnodes_check += tnodes_at_level[ilevel].
nelem;
182 vpr_printf(TIO_MESSAGE_ERROR,
"Error in check_timing_graph: %d tnodes appear in the tnode level structure. Expected %d.\n",
184 vpr_printf(TIO_MESSAGE_INFO,
"Check the netlist for combinational cycles.\n");
194 vpr_printf(TIO_MESSAGE_ERROR,
"Found %d Errors in the timing graph. Aborting.\n", error);
203 int inode, iblk, inet, downstream_node;
206 static const char *tnode_type_names[] = {
"TN_INPAD_SOURCE",
"TN_INPAD_OPIN",
207 "TN_OUTPAD_IPIN",
"TN_OUTPAD_SINK",
"TN_CB_IPIN",
"TN_CB_OPIN",
208 "TN_INTERMEDIATE_NODE",
"TN_PRIMITIVE_IPIN",
"TN_PRIMITIVE_OPIN",
"TN_FF_IPIN",
209 "TN_FF_OPIN",
"TN_FF_SINK",
"TN_FF_SOURCE",
"TN_FF_CLOCK",
"TN_CONSTANT_GEN_SOURCE" };
214 inode = critical_path_node->
data;
219 fprintf(fp,
"Node: %d %s Block #%d (%s)\n", inode, tnode_type_names[type],
220 iblk,
block[iblk].name);
222 if (pb_graph_pin == NULL) {
227 if (pb_graph_pin != NULL) {
235 fprintf(fp,
"T_arr: %g T_req: %g ",
tnode[inode].T_arr,
238 next_crit_node = critical_path_node->
next;
239 if (next_crit_node != NULL) {
240 downstream_node = next_crit_node->
data;
242 fprintf(fp,
"Tdel: %g\n", Tdel);
252 fprintf(fp,
"External-to-Block Net: #%d (%s). Pins on net: %d.\n",
254 }
else if (pb_graph_pin != NULL) {
257 fprintf(fp,
"Internal Net: #%d (%s). Pins on net: %d.\n", inet,
267 boolean *found_tnode;
268 int ilevel, i, inode;
273 for (i = 0; i < tnodes_at_level[ilevel].
nelem; i++) {
274 inode = tnodes_at_level[ilevel].
list[i];
275 found_tnode[inode] =
TRUE;
279 vpr_printf(TIO_MESSAGE_INFO,
"\tProblematic nodes:\n");
281 if (found_tnode[i] ==
FALSE) {
282 vpr_printf(TIO_MESSAGE_INFO,
"\t\ttnode %d ", i);
283 if (
tnode[i].pb_graph_pin == NULL) {
struct s_ivec * tnodes_at_level
void check_timing_graph(int num_sinks)
struct s_rr_node * rr_graph
static int * alloc_and_load_tnode_fanin_and_check_edges(int *num_sinks_ptr)
t_linked_int * insert_in_int_list(t_linked_int *head, int data, t_linked_int **free_list_head_ptr)
void alloc_ivector_and_copy_int_list(t_linked_int **list_head_ptr, int num_items, struct s_ivec *ivec, t_linked_int **free_list_head_ptr)
void * my_calloc(size_t nelem, size_t size)
struct s_pb ** rr_node_to_pb_mapping
static void show_combinational_cycle_candidates()
t_prepacked_tnode_data * prepacked_data
static void * my_malloc(int ibytes)
int * vpack_to_clb_net_mapping
struct s_pb_graph_node * parent_node
void free_int_list(t_linked_int **int_list_head_ptr)
t_pb_graph_pin * pb_graph_pin
struct s_pb_type * pb_type
static void * my_realloc(void *memblk, int ibytes)
struct s_linked_int * next
float print_critical_path_node(FILE *fp, t_linked_int *critical_path_node)
struct s_logical_block * logical_block
int alloc_and_load_timing_graph_levels(void)