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 =
'-';
void FreeTokens(INOUTP char ***TokensPtr)
struct s_hash * get_hash_entry(struct s_hash **hash_table, char *name)
ezxml_t ezxml_set_attr(ezxml_t xml, char *name, char *value)
int CountTokens(INP char **Tokens)
void FreeNode(INOUTP ezxml_t Node)
char ** GetNodeTokens(INP ezxml_t Node)
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 CheckElement(INP ezxml_t Node, INP const char *Name)
const char * FindProperty(INP ezxml_t Parent, INP const char *Name, INP boolean)