43 OUTP struct s_net **ext_nets,
INP char **circuit_clocks);
81 struct s_net *ext_nlist;
82 struct s_hash **vpack_net_hash, **logical_block_hash, *temp_hash;
83 char **circuit_inputs, **circuit_outputs, **circuit_clocks;
86 int num_primitives = 0;
89 vpr_printf(TIO_MESSAGE_INFO,
"Begin parsing packed FPGA netlist file.\n");
92 vpr_printf(TIO_MESSAGE_ERROR,
"Unable to load netlist file '%s'.\n", net_file);
95 vpr_printf(TIO_MESSAGE_INFO,
"Finished parsing packed FPGA netlist file.\n");
102 vpr_printf(TIO_MESSAGE_INFO,
"Netlist generated from file '%s'.\n", Prop);
106 if (strcmp(Prop,
"FPGA_packed_netlist[0]") != 0) {
107 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Expected instance to be \"FPGA_packed_netlist[0]\", found %s.",
126 circuit_clocks = NULL;
141 assert(temp_hash->
count == 1);
146 assert(temp_hash->
count == 1);
154 if (0 == strcmp(Cur->
name,
"block")) {
156 processComplexBlock(Cur, blist, i, &num_primitives, arch, vpack_net_hash, logical_block_hash);
166 assert(num_primitives == num_logical_blocks);
171 vpr_printf(TIO_MESSAGE_ERROR,
".blif file and .net file do not match, .net file missing atom %s.\n",
181 &ext_nlist, circuit_clocks);
201 for (i = 0; i < ext_ncount; i++) {
203 assert(temp_hash != NULL);
209 *L_num_blocks = bcount;
211 *L_num_nets = ext_ncount;
212 *net_list = ext_nlist;
252 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown syntax for instance %s in %s. Expected pb_type[instance_number].\n",
253 Parent->line, Prop, Parent->name);
256 assert(
my_atoi(tokens[2].data) == index);
261 pb_type = cb[index].type->pb_type;
267 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown cb type %s for cb %s #%d.\n",
268 Parent->line, Prop, cb[index].name, index);
273 cb[index].pb->logical_block =
OPEN;
274 cb[index].pb->pb_graph_node = cb[index].type->pb_graph_head;
275 num_rr_nodes = cb[index].pb->pb_graph_node->total_pb_pins;
277 + cb[index].type->pb_type->num_output_pins + cb[index].type->pb_type->num_clock_pins,
282 cb[index].pb->rr_graph =
rr_node;
288 for (i = 0; i < pb_type->
num_modes; i++) {
289 if (strcmp(Prop, pb_type->
modes[i].
name) == 0) {
290 cb[index].pb->mode = i;
295 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown mode %s for cb %s #%d.\n",
296 Parent->line, Prop, cb[index].name, index);
300 processPb(Parent, cb[index].
pb, cb[index].pb->
rr_graph, cb[index].pb->rr_node_to_pb_mapping, num_primitives, vpack_net_hash, logical_block_hash, index);
303 for (i = 0; i < cb[index].type->num_pins; i++) {
304 cb[index].nets[i] =
OPEN;
307 cb[index].pb->rr_graph, 1);
309 cb[index].pb->rr_graph, 2);
312 cb[index].pb->rr_graph, &i);
316 for (i = 0; i < cb[index].pb->num_local_nets; i++) {
317 vpr_printf(TIO_MESSAGE_INFO,
"local net %s: ", cb[index].pb->name);
318 for (j = 0; j <= cb[index].pb->local_nets[i].num_sinks; j++) {
319 vpr_printf(TIO_MESSAGE_INFO,
"%d ", cb[index].pb->local_nets[i].node_block[j]);
338 const char *instance_type;
347 processPorts(Cur, pb, rr_graph, rr_node_to_pb_mapping, vpack_net_hash);
350 processPorts(Cur, pb, rr_graph, rr_node_to_pb_mapping, vpack_net_hash);
353 processPorts(Cur, pb, rr_graph, rr_node_to_pb_mapping, vpack_net_hash);
356 pb_type = pb->pb_graph_node->pb_type;
359 if (strcmp(pb_type->
blif_model,
".names") == 0) {
362 pb->lut_pin_remap[i] =
OPEN;
365 pb->lut_pin_remap = NULL;
368 if (temp_hash == NULL) {
369 vpr_printf(TIO_MESSAGE_ERROR,
".net file and .blif file do not match, encountered unknown primitive %s in .net file.\n", pb->name);
372 pb->logical_block = temp_hash->
index;
387 pb->child_pbs[i][j].logical_block =
OPEN;
394 if (0 == strcmp(Cur->
name,
"block")) {
404 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown syntax for instance %s in %s. Expected pb_type[instance_number].\n",
405 Cur->
line, instance_type, Cur->
name);
415 tokens[0].
data) == 0) {
418 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Instance number exceeds # of pb available for instance %s in %s.\n",
419 Cur->
line, instance_type, Cur->
name);
422 pb_index =
my_atoi(tokens[2].data);
423 if (pb->child_pbs[i][pb_index].pb_graph_node != NULL) {
424 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] node is used by two different blocks %s and %s.\n",
425 Cur->
line, instance_type,
426 pb->child_pbs[i][pb_index].name);
429 pb->child_pbs[i][pb_index].pb_graph_node =
430 &pb->pb_graph_node->child_pb_graph_nodes[pb->mode][i][pb_index];
436 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown pb type %s.\n",
437 Cur->
line, instance_type);
443 if (0 != strcmp(Prop,
"open")) {
444 pb->child_pbs[i][pb_index].name =
my_strdup(Prop);
447 pb->child_pbs[i][pb_index].logical_block =
OPEN;
453 pb->child_pbs[i][pb_index].mode = 0;
457 < pb->child_pbs[i][pb_index].pb_graph_node->pb_type->num_modes;
460 pb->child_pbs[i][pb_index].pb_graph_node->pb_type->modes[j].name)
462 pb->child_pbs[i][pb_index].mode = j;
467 && pb->child_pbs[i][pb_index].pb_graph_node->pb_type->num_modes
469 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown mode %s for cb %s #%d.\n",
470 Cur->
line, Prop, pb->child_pbs[i][pb_index].name, pb_index);
473 pb->child_pbs[i][pb_index].parent_pb = pb;
474 pb->child_pbs[i][pb_index].rr_graph = pb->rr_graph;
476 processPb(Cur, &pb->child_pbs[i][pb_index], rr_graph, rr_node_to_pb_mapping, num_primitives, vpack_net_hash, logical_block_hash, cb_index);
479 pb->child_pbs[i][pb_index].name = NULL;
480 pb->child_pbs[i][pb_index].logical_block =
OPEN;
482 if (lookahead != NULL) {
488 pb->child_pbs[i][pb_index].mode = 0;
492 < pb->child_pbs[i][pb_index].pb_graph_node->pb_type->num_modes;
495 pb->child_pbs[i][pb_index].pb_graph_node->pb_type->modes[j].name)
497 pb->child_pbs[i][pb_index].mode = j;
502 && pb->child_pbs[i][pb_index].pb_graph_node->pb_type->num_modes
504 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown mode %s for cb %s #%d.\n",
505 Cur->
line, Prop, pb->child_pbs[i][pb_index].name, pb_index);
508 pb->child_pbs[i][pb_index].parent_pb = pb;
509 pb->child_pbs[i][pb_index].rr_graph = pb->rr_graph;
510 processPb(Cur, &pb->child_pbs[i][pb_index], rr_graph, rr_node_to_pb_mapping, num_primitives, vpack_net_hash, logical_block_hash, cb_index);
542 while (curr_net != NULL) {
543 assert(nlist[curr_net->
index].
name == NULL);
548 curr_net->
count *
sizeof(
int));
550 curr_net->
count *
sizeof(
int));
552 for (i = 0; i < curr_net->
count; i++) {
569 if (strcmp(net_name,
"open") == 0) {
574 if (hash_value->
count == 1) {
575 assert(*ncount == hash_value->
index);
578 return hash_value->
index;
584 int i, j, in_port, out_port, clock_port, num_tokens;
588 char *port_name, *interconnect_name;
591 int *num_ptrs, num_sets;
597 if (0 == strcmp(Cur->
name,
"port")) {
603 in_port = out_port = clock_port = 0;
605 for (i = 0; i < pb->pb_graph_node->pb_type->num_ports; i++) {
607 == strcmp(pb->pb_graph_node->pb_type->ports[i].name,
612 if (pb->pb_graph_node->pb_type->ports[i].is_clock
613 && pb->pb_graph_node->pb_type->ports[i].type
616 }
else if (!pb->pb_graph_node->pb_type->ports[i].is_clock
617 && pb->pb_graph_node->pb_type->ports[i].type
622 pb->pb_graph_node->pb_type->ports[i].type ==
OUT_PORT);
627 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown port %s for pb %s[%d].\n",
628 Cur->
line, Prop, pb->pb_graph_node->pb_type->name,
629 pb->pb_graph_node->placement_index);
635 if (0 == strcmp(Parent->name,
"inputs")) {
636 if (num_tokens != pb->pb_graph_node->num_input_pins[in_port]) {
637 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Incorrect # pins %d found for port %s for pb %s[%d].\n",
638 Cur->
line, num_tokens, Prop,
639 pb->pb_graph_node->pb_type->name,
640 pb->pb_graph_node->placement_index);
643 }
else if (0 == strcmp(Parent->name,
"outputs")) {
645 != pb->pb_graph_node->num_output_pins[out_port]) {
646 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Incorrect # pins %d found for port %s for pb %s[%d].\n",
647 Cur->
line, num_tokens, Prop,
648 pb->pb_graph_node->pb_type->name,
649 pb->pb_graph_node->placement_index);
654 != pb->pb_graph_node->num_clock_pins[clock_port]) {
655 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Incorrect # pins %d found for port %s for pb %s[%d].\n",
656 Cur->
line, num_tokens, Prop,
657 pb->pb_graph_node->pb_type->name,
658 pb->pb_graph_node->placement_index);
662 if (0 == strcmp(Parent->name,
"inputs")
663 || 0 == strcmp(Parent->name,
"clocks")) {
664 if (pb->parent_pb == NULL) {
666 for (i = 0; i < num_tokens; i++) {
667 if (0 == strcmp(Parent->name,
"inputs"))
669 pb->pb_graph_node->input_pins[in_port][i].pin_count_in_cluster;
672 pb->pb_graph_node->clock_pins[clock_port][i].pin_count_in_cluster;
673 if (strcmp(pins[i],
"open") != 0) {
675 if (temp_hash == NULL) {
676 vpr_printf(TIO_MESSAGE_ERROR,
".blif and .net do not match, unknown net %s found in .net file.\n.", pins[i]);
680 rr_node_to_pb_mapping[rr_node_index] = pb;
683 for (i = 0; i < num_tokens; i++) {
684 if (0 == strcmp(pins[i],
"open")) {
687 interconnect_name = strstr(pins[i],
"->");
688 *interconnect_name =
'\0';
689 interconnect_name += 2;
693 pb->pb_graph_node->pb_type->parent_mode->interconnect[0].line_num,
694 pb->pb_graph_node->parent_pb_graph_node,
695 pb->pb_graph_node->parent_pb_graph_node->child_pb_graph_nodes[pb->parent_pb->mode],
696 port_name, &num_ptrs, &num_sets,
TRUE,
698 assert(num_sets == 1 && num_ptrs[0] == 1);
699 if (0 == strcmp(Parent->name,
"inputs"))
701 pb->pb_graph_node->input_pins[in_port][i].pin_count_in_cluster;
704 pb->pb_graph_node->clock_pins[clock_port][i].pin_count_in_cluster;
707 rr_node_to_pb_mapping[rr_node_index] = pb;
711 == strcmp(interconnect_name,
712 pin_node[0][0]->output_edges[j]->interconnect->name)) {
717 for (j = 0; j < num_sets; j++) {
723 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown interconnect %s connecting to pin %s.\n",
724 Cur->
line, interconnect_name, port_name);
731 if (0 == strcmp(Parent->name,
"outputs")) {
732 if (pb->pb_graph_node->pb_type->num_modes == 0) {
734 for (i = 0; i < num_tokens; i++) {
736 pb->pb_graph_node->output_pins[out_port][i].pin_count_in_cluster;
737 if (strcmp(pins[i],
"open") != 0) {
739 if (temp_hash == NULL) {
740 vpr_printf(TIO_MESSAGE_ERROR,
".blif and .net do not match, unknown net %s found in .net file.\n", pins[i]);
744 rr_node_to_pb_mapping[rr_node_index] = pb;
747 for (i = 0; i < num_tokens; i++) {
748 if (0 == strcmp(pins[i],
"open")) {
751 interconnect_name = strstr(pins[i],
"->");
752 *interconnect_name =
'\0';
753 interconnect_name += 2;
757 pb->pb_graph_node->pb_type->modes[pb->mode].interconnect->line_num,
759 pb->pb_graph_node->child_pb_graph_nodes[pb->mode],
760 port_name, &num_ptrs, &num_sets,
TRUE,
762 assert(num_sets == 1 && num_ptrs[0] == 1);
764 pb->pb_graph_node->output_pins[out_port][i].pin_count_in_cluster;
767 rr_node_to_pb_mapping[rr_node_index] = pb;
771 == strcmp(interconnect_name,
772 pin_node[0][0]->output_edges[j]->interconnect->name)) {
777 for (j = 0; j < num_sets; j++) {
783 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Unknown interconnect %s connecting to pin %s.\n",
784 Cur->
line, interconnect_name, port_name);
787 interconnect_name -= 2;
788 *interconnect_name =
'-';
810 OUTP struct s_net **ext_nets,
INP char **circuit_clocks) {
812 struct s_hash **ext_nhash;
816 int netnum, num_tokens;
824 for (i = 0; i < L_num_blocks; i++) {
826 if (block_list[i].type->pb_type->num_input_pins
827 + block_list[i].type->pb_type->num_output_pins
828 + block_list[i].type->pb_type->num_clock_pins
829 != block_list[i].type->num_pins
830 / block_list[i].type->capacity) {
837 block_list[i].type->pb_type->num_input_pins + block_list[i].type->pb_type->num_output_pins + block_list[i].type->pb_type->num_clock_pins == block_list[i].type->num_pins / block_list[i].type->capacity);
839 rr_graph = block_list[i].pb->rr_graph;
840 for (j = 0; j < block_list[i].pb->pb_graph_node->num_input_ports; j++) {
841 for (k = 0; k < block_list[i].pb->pb_graph_node->num_input_pins[j];
844 &block_list[i].pb->pb_graph_node->input_pins[j][k];
848 block_list[i].nets[ipin] =
853 block_list[i].nets[ipin] =
OPEN;
858 for (j = 0; j < block_list[i].pb->pb_graph_node->num_output_ports;
860 for (k = 0; k < block_list[i].pb->pb_graph_node->num_output_pins[j];
863 &block_list[i].pb->pb_graph_node->output_pins[j][k];
867 block_list[i].nets[ipin] =
872 block_list[i].nets[ipin] =
OPEN;
877 for (j = 0; j < block_list[i].pb->pb_graph_node->num_clock_ports; j++) {
878 for (k = 0; k < block_list[i].pb->pb_graph_node->num_clock_pins[j];
881 &block_list[i].pb->pb_graph_node->clock_pins[j][k];
885 block_list[i].nets[ipin] =
890 block_list[i].nets[ipin] =
OPEN;
895 for (j = ipin; j < block_list[i].type->num_pins; j++) {
896 block_list[i].nets[ipin] =
OPEN;
905 count = (
int *)
my_calloc(*ext_ncount,
sizeof(
int));
908 for (i = 0; i < L_num_blocks; i++) {
910 rr_graph = block_list[i].pb->rr_graph;
911 for (j = 0; j < block_list[i].type->num_pins; j++) {
912 netnum = block_list[i].nets[j];
913 if (netnum !=
OPEN) {
915 == block_list[i].type->class_inf[block_list[i].type->pin_class[j]].type) {
917 if(count[netnum] > (*ext_nets)[netnum].num_sinks) {
918 vpr_printf(TIO_MESSAGE_ERROR,
"net %s #%d inconsistency, expected %d terminals but encountered %d terminals, it is likely net terminal is disconnected in netlist file.\n",
919 (*ext_nets)[netnum].
name, netnum, count[netnum], (*ext_nets)[netnum].num_sinks);
923 (*ext_nets)[netnum].node_block[count[netnum]] = i;
924 (*ext_nets)[netnum].node_block_pin[count[netnum]] = j;
926 (*ext_nets)[netnum].is_global = block_list[i].type->is_global_pin[j];
929 DRIVER == block_list[i].type->class_inf[block_list[i].type->pin_class[j]].type);
930 assert((*ext_nets)[netnum].node_block[0] ==
OPEN);
931 (*ext_nets)[netnum].node_block[0] = i;
932 (*ext_nets)[netnum].node_block_pin[0] = j;
938 for (i = 0; i < *ext_ncount; i++) {
939 for (j = 1; j <= (*ext_nets)[i].num_sinks; j++) {
940 if (block_list[(*ext_nets)[i].node_block[j]].type->is_global_pin[(*ext_nets)[i].node_block_pin[j]] != (*ext_nets)[i].is_global) {
941 vpr_printf(TIO_MESSAGE_ERROR,
"Netlist attempts to connect net %s to both global and non-global pins.\n",
942 (*ext_nets)[i].
name);
946 for (j = 0; j < num_tokens; j++) {
947 if (strcmp(circuit_clocks[j], (*ext_nets)[i].
name) == 0) {
962 for (i = 0; i < cur_rr_node->num_edges; i++) {
963 if (&rr_graph[rr_graph[cur_rr_node->edges[i]].prev_node]
966 rr_graph[cur_rr_node->edges[i]].net_num ==
OPEN || rr_graph[cur_rr_node->edges[i]].net_num == cur_rr_node->net_num);
968 &rr_graph[cur_rr_node->edges[i]], rr_graph);
987 for (i = 0; i < cur_rr_node->num_edges; i++) {
988 if (&rr_graph[rr_graph[cur_rr_node->edges[i]].prev_node]
993 rr_graph[cur_rr_node->edges[i]].net_num ==
OPEN || rr_graph[cur_rr_node->edges[i]].net_num == cur_rr_node->net_num);
994 rr_graph[cur_rr_node->edges[i]].net_num = cur_rr_node->net_num;
995 rr_graph[cur_rr_node->edges[i]].prev_edge = i;
997 rr_graph, nets, curr_net, curr_sink);
1001 if (terminal ==
TRUE) {
1003 nets[*curr_net].node_block[*curr_sink] =
1004 cur_rr_node->pb_graph_pin->pin_count_in_cluster;
1005 nets[*curr_net].node_block_pin[*curr_sink] =
OPEN;
1006 nets[*curr_net].node_block_port[*curr_sink] =
OPEN;
1018 struct s_net * nets;
1020 pb_type = pb_graph_node->pb_type;
1022 nets = top_level->local_nets;
1026 if (pb_graph_node->parent_pb_graph_node == NULL) {
1028 for (i = 0; i < pb_graph_node->num_input_ports; i++) {
1029 for (j = 0; j < pb_graph_node->num_input_pins[i]; j++) {
1030 if (rr_graph[pb_graph_node->input_pins[i][j].pin_count_in_cluster].net_num
1033 &rr_graph[pb_graph_node->input_pins[i][j].pin_count_in_cluster],
1034 rr_graph, nets, curr_net, &temp);
1035 assert(temp == nets[*curr_net].
num_sinks);
1038 strlen(pb_graph_node->pb_type->name)
1039 + pb_graph_node->placement_index / 10
1041 + pb_graph_node->input_pins[i][j].pin_count_in_cluster
1043 nets[*curr_net].
name = (
char *)
my_calloc(size,
sizeof(
char));
1044 sprintf(nets[*curr_net].
name,
1045 "%s[%d].input[%d][%d].pin[%d]",
1046 pb_graph_node->pb_type->name,
1047 pb_graph_node->placement_index, i, j,
1048 pb_graph_node->input_pins[i][j].pin_count_in_cluster);
1053 for (i = 0; i < pb_graph_node->num_clock_ports; i++) {
1054 for (j = 0; j < pb_graph_node->num_clock_pins[i]; j++) {
1055 if (rr_graph[pb_graph_node->clock_pins[i][j].pin_count_in_cluster].net_num
1058 &rr_graph[pb_graph_node->clock_pins[i][j].pin_count_in_cluster],
1059 rr_graph, nets, curr_net, &temp);
1060 assert(temp == nets[*curr_net].
num_sinks);
1064 strlen(pb_graph_node->pb_type->name)
1065 + pb_graph_node->placement_index / 10
1067 + pb_graph_node->clock_pins[i][j].pin_count_in_cluster
1069 nets[*curr_net].
name = (
char *)
my_calloc(size,
sizeof(
char));
1070 sprintf(nets[*curr_net].
name,
1071 "%s[%d].clock[%d][%d].pin[%d]",
1072 pb_graph_node->pb_type->name,
1073 pb_graph_node->placement_index, i, j,
1074 pb_graph_node->clock_pins[i][j].pin_count_in_cluster);
1083 for (i = 0; i < pb_graph_node->num_output_ports; i++) {
1084 for (j = 0; j < pb_graph_node->num_output_pins[i]; j++) {
1085 if (rr_graph[pb_graph_node->output_pins[i][j].pin_count_in_cluster].net_num
1088 &rr_graph[pb_graph_node->output_pins[i][j].pin_count_in_cluster],
1089 rr_graph, nets, curr_net, &temp);
1090 assert(temp == nets[*curr_net].
num_sinks);
1093 strlen(pb_graph_node->pb_type->name)
1094 + pb_graph_node->placement_index / 10
1096 + pb_graph_node->output_pins[i][j].pin_count_in_cluster
1098 nets[*curr_net].
name = (
char *)
my_calloc(size,
sizeof(
char));
1099 sprintf(nets[*curr_net].
name,
1100 "%s[%d].output[%d][%d].pin[%d]",
1101 pb_graph_node->pb_type->name,
1102 pb_graph_node->placement_index, i, j,
1103 pb_graph_node->output_pins[i][j].pin_count_in_cluster);
1110 for (i = 0; i < pb_type->
num_modes; i++) {
1115 &pb_graph_node->child_pb_graph_nodes[i][j][k],
1116 rr_graph, curr_net);
1122 if (pb_graph_node->parent_pb_graph_node == NULL) {
1123 assert(*curr_net == top_level->num_local_nets);
1137 pb_type = pb_graph_node->pb_type;
1139 if (pb_graph_node->parent_pb_graph_node == NULL) {
1140 top_level->num_local_nets = 0;
1142 top_level->local_nets = NULL;
1143 for (i = 0; i < pb_graph_node->num_input_ports; i++) {
1144 for (j = 0; j < pb_graph_node->num_input_pins[i]; j++) {
1145 if (rr_graph[pb_graph_node->input_pins[i][j].pin_count_in_cluster].net_num
1150 &rr_graph[pb_graph_node->input_pins[i][j].pin_count_in_cluster],
1152 top_level->local_nets[top_level->num_local_nets].num_sinks =
1154 top_level->local_nets[top_level->num_local_nets].node_block = (
int *)
1156 top_level->local_nets[top_level->num_local_nets].node_block_port = (
int *)
1158 top_level->local_nets[top_level->num_local_nets].node_block_pin = (
int *)
1161 top_level->num_local_nets++;
1165 for (i = 0; i < pb_graph_node->num_clock_ports; i++) {
1166 for (j = 0; j < pb_graph_node->num_clock_pins[i]; j++) {
1167 if (rr_graph[pb_graph_node->clock_pins[i][j].pin_count_in_cluster].net_num
1172 &rr_graph[pb_graph_node->clock_pins[i][j].pin_count_in_cluster],
1174 top_level->local_nets[top_level->num_local_nets].num_sinks =
1176 top_level->local_nets[top_level->num_local_nets].node_block = (
int *)
1178 top_level->local_nets[top_level->num_local_nets].node_block_port = (
int *)
1180 top_level->local_nets[top_level->num_local_nets].node_block_pin = (
int *)
1183 top_level->num_local_nets++;
1191 for (i = 0; i < pb_graph_node->num_output_ports; i++) {
1192 for (j = 0; j < pb_graph_node->num_output_pins[i]; j++) {
1193 if (rr_graph[pb_graph_node->output_pins[i][j].pin_count_in_cluster].net_num
1198 &rr_graph[pb_graph_node->output_pins[i][j].pin_count_in_cluster],
1200 top_level->local_nets[top_level->num_local_nets].num_sinks =
1202 top_level->local_nets[top_level->num_local_nets].node_block = (
int *)
1204 top_level->local_nets[top_level->num_local_nets].node_block_port = (
int *)
1206 top_level->local_nets[top_level->num_local_nets].node_block_pin = (
int *)
1209 top_level->num_local_nets++;
1215 for (i = 0; i < pb_type->
num_modes; i++) {
1220 &pb_graph_node->child_pb_graph_nodes[i][j][k],
1227 if (pb_graph_node->parent_pb_graph_node == NULL) {
1229 top_level->local_nets = (
struct s_net *)
my_calloc(top_level->num_local_nets,
1230 sizeof(
struct s_net));
1239 for (i = 0; i < L_num_blocks; i++) {
1241 block_list[i].pb->rr_graph, nlist);
1250 if (pb->pb_graph_node->pb_type->blif_model == NULL) {
1253 < pb->pb_graph_node->pb_type->modes[pb->mode].num_pb_type_children;
1256 &(pb->pb_graph_node->pb_type->modes[pb->mode].pb_type_children[i]);
1257 for (j = 0; j < pb_type->
num_pb; j++) {
1258 if (pb->child_pbs[i][j].name != NULL) {
1264 }
else if (strcmp(pb->pb_graph_node->pb_type->name,
"inpad") != 0) {
1266 for (i = 0; i < pb->pb_graph_node->num_input_ports && const_gen ==
TRUE;
1269 j < pb->pb_graph_node->num_input_pins[i]
1270 && const_gen ==
TRUE; j++) {
1271 if (rr_graph[pb->pb_graph_node->input_pins[i][j].pin_count_in_cluster].net_num
1277 for (i = 0; i < pb->pb_graph_node->num_clock_ports && const_gen ==
TRUE;
1280 j < pb->pb_graph_node->num_clock_pins[i]
1281 && const_gen ==
TRUE; j++) {
1282 if (rr_graph[pb->pb_graph_node->clock_pins[i][j].pin_count_in_cluster].net_num
1288 if (const_gen ==
TRUE) {
1289 vpr_printf(TIO_MESSAGE_INFO,
"%s is a constant generator.\n", pb->name);
1290 for (i = 0; i < pb->pb_graph_node->num_output_ports; i++) {
1291 for (j = 0; j < pb->pb_graph_node->num_output_pins[i]; j++) {
1292 if (rr_graph[pb->pb_graph_node->output_pins[i][j].pin_count_in_cluster].net_num
1294 nlist[rr_graph[pb->pb_graph_node->output_pins[i][j].pin_count_in_cluster].net_num].is_const_gen =
1328 while (tvptr != NULL) {
1352 while (tvptr != NULL) {
void free_logical_blocks(void)
struct s_hash ** alloc_hash_table(void)
struct s_hash_iterator start_hash_table_iterator(void)
static void mark_constant_generators_rec(INP t_pb *pb, INP t_rr_node *rr_graph, INOUTP struct s_net nlist[])
struct s_pb_type * pb_type_children
void FreeTokens(INOUTP char ***TokensPtr)
struct s_rr_node * rr_graph
int * clb_to_vpack_net_mapping
struct s_hash * get_hash_entry(struct s_hash **hash_table, char *name)
int hash_value(char *name)
void alloc_and_load_rr_graph_for_pb_graph_node(INP t_pb_graph_node *pb_graph_node, INP const t_arch *arch, int mode)
void * my_calloc(size_t nelem, size_t size)
struct s_model_ports * next
static void load_internal_cb_nets(INOUTP t_pb *top_level, INP t_pb_graph_node *pb_graph_node, INOUTP t_rr_node *rr_graph, INOUTP int *curr_net)
struct s_linked_vptr * packed_molecules
struct s_linked_vptr * truth_table
t_token * GetTokensFromString(INP const char *inString, OUTP int *num_tokens)
static void processComplexBlock(INOUTP ezxml_t Parent, INOUTP t_block *cb, INP int index, INOUTP int *num_primitives, INP const t_arch *arch, INP struct s_hash **vpack_net_hash, INP struct s_hash **logical_block_hash)
static void processPb(INOUTP ezxml_t Parent, INOUTP t_pb *pb, INOUTP t_rr_node *rr_graph, INOUTP t_pb **rr_node_to_pb_mapping, INOUTP int *num_primitives, INP struct s_hash **vpack_net_hash, INP struct s_hash **logical_block_hash, INP int cb_index)
void free_hash_table(struct s_hash **hash_table)
ezxml_t ezxml_set_attr(ezxml_t xml, char *name, char *value)
int CountTokens(INP char **Tokens)
static void * my_malloc(int ibytes)
ezxml_t FindElement(INP ezxml_t Parent, INP const char *Name, INP boolean Required)
int * vpack_to_clb_net_mapping
void FreeNode(INOUTP ezxml_t Node)
static void load_external_nets_and_cb(INP int L_num_blocks, INP struct s_block block_list[], INP int ncount, INP struct s_net nlist[], OUTP int *ext_ncount, OUTP struct s_net **ext_nets, INP char **circuit_clocks)
static void alloc_internal_cb_nets(INOUTP t_pb *top_level, INP t_pb_graph_node *pb_graph_node, INOUTP t_rr_node *rr_graph, INP int pass)
struct s_linked_vptr * next
ezxml_t FindFirstElement(INP ezxml_t Parent, INP const char *Name, INP boolean Required)
void CountTokensInString(INP const char *Str, OUTP int *Num, OUTP int *Len)
char ** GetNodeTokens(INP ezxml_t Node)
static void mark_constant_generators(INP int L_num_blocks, INP struct s_block block_list[], INP int ncount, INOUTP struct s_net nlist[])
static int count_sinks_internal_cb_rr_graph_net_nums(INP t_rr_node *cur_rr_node, INP t_rr_node *rr_graph)
struct s_hash * get_next_hash(struct s_hash **hash_table, struct s_hash_iterator *hash_iterator)
t_pb_graph_pin *** alloc_and_load_port_pin_ptrs_from_string(INP int line_num, INP const t_pb_graph_node *pb_graph_parent_node, INP t_pb_graph_node **pb_graph_children_nodes, INP const char *port_string, OUTP int **num_ptrs, OUTP int *num_sets, INP boolean is_input_to_interc, INP boolean interconnect_error_check)
void read_netlist(INP const char *net_file, INP const t_arch *arch, OUTP int *L_num_blocks, OUTP struct s_block *block_list[], OUTP int *L_num_nets, OUTP struct s_net *net_list[])
static void processPorts(INOUTP ezxml_t Parent, INOUTP t_pb *pb, INOUTP t_rr_node *rr_graph, INOUTP t_pb **rr_node_to_pb_mapping, INP struct s_hash **vpack_net_hash)
static struct s_net * alloc_and_init_netlist_from_hash(INP int ncount, INOUTP struct s_hash **nhash)
ezxml_t ezxml_parse_file(const char *file)
static void load_internal_cb_rr_graph_net_nums(INP t_rr_node *cur_rr_node, INP t_rr_node *rr_graph, INOUTP struct s_net *nets, INOUTP int *curr_net, INOUTP int *curr_sink)
t_pb_graph_node * pb_graph_head
int CountChildren(INP ezxml_t Node, INP const char *Name, INP int min_count)
struct s_type_descriptor * type_descriptors
static int add_net_to_hash(INOUTP struct s_hash **nhash, INP char *net_name, INOUTP int *ncount)
void freeTokens(INP t_token *tokens, INP int num_tokens)
int my_atoi(const char *str)
char * my_strdup(const char *str)
t_pb_graph_node * pb_graph_node
struct s_hash * insert_in_hash_table(struct s_hash **hash_table, char *name, int next_free_index)
void CheckElement(INP ezxml_t Node, INP const char *Name)
const char * FindProperty(INP ezxml_t Parent, INP const char *Name, INP boolean)
void free_logical_nets(void)
struct s_logical_block * logical_block
struct s_rr_node t_rr_node