Go to the source code of this file.
Data Structures | |
struct | s_clb_grid |
struct | s_arch |
Typedefs | |
typedef struct s_arch | t_arch |
Functions | |
void | XmlReadArch (IN const char *ArchFile, IN boolean timing_enabled, OUT struct s_arch *arch, OUT t_type_descriptor **Types, OUT int *NumTypes) |
void | EchoArch (IN const char *EchoFile, IN const t_type_descriptor *Types, IN int NumTypes) |
Definition at line 9 of file xml_arch.h.
void EchoArch | ( | IN const char * | EchoFile, | |
IN const t_type_descriptor * | Types, | |||
IN int | NumTypes | |||
) |
Definition at line 2080 of file xml_arch.c.
02083 { 02084 int i, j, k; 02085 02086 FILE * Echo; 02087 Echo = my_fopen(EchoFile, "w"); 02088 for(i = 0; i < NumTypes; ++i) 02089 { 02090 fprintf(Echo, "Type: \"%s\"\n", Types[i].name); 02091 fprintf(Echo, "\tcapacity: %d\n", Types[i].capacity); 02092 fprintf(Echo, "\theight: %d\n", Types[i].height); 02093 if(Types[i].num_pins > 0) 02094 { 02095 for(j = 0; j < Types[i].height; ++j) 02096 { 02097 fprintf(Echo, 02098 "\tpinloc[%d] TOP LEFT BOTTOM RIGHT:\n", 02099 j); 02100 for(k = 0; k < Types[i].num_pins; ++k) 02101 { 02102 fprintf(Echo, "\t\t%d %d %d %d\n", 02103 Types[i].pinloc[j][TOP][k], 02104 Types[i].pinloc[j][LEFT][k], 02105 Types[i].pinloc[j][BOTTOM][k], 02106 Types[i].pinloc[j][RIGHT][k]); 02107 } 02108 } 02109 } 02110 fprintf(Echo, "\tnum_pins (scaled for capacity): %d\n", 02111 Types[i].num_pins); 02112 if(Types[i].num_pins > 0) 02113 { 02114 fprintf(Echo, "\tPins: NAME CLASS IS_GLOBAL\n"); 02115 for(j = 0; j < Types[i].num_pins; ++j) 02116 { 02117 fprintf(Echo, "\t\t%d %d %s\n", j, 02118 Types[i].pin_class[j], 02119 (Types[i]. 02120 is_global_pin[j] ? "TRUE" : "FALSE")); 02121 } 02122 } 02123 fprintf(Echo, "\tnum_class: %d\n", Types[i].num_class); 02124 if(Types[i].num_class > 0) 02125 { 02126 for(j = 0; j < Types[i].num_class; ++j) 02127 { 02128 switch (Types[i].class_inf[j].type) 02129 { 02130 case RECEIVER: 02131 fprintf(Echo, "\t\tType: RECEIVER\n"); 02132 break; 02133 case DRIVER: 02134 fprintf(Echo, "\t\tType: DRIVER\n"); 02135 break; 02136 case OPEN: 02137 fprintf(Echo, "\t\tType: OPEN\n"); 02138 break; 02139 default: 02140 fprintf(Echo, "\t\tType: UNKNOWN\n"); 02141 break; 02142 } 02143 fprintf(Echo, "\t\t\tnum_pins: %d\n", 02144 Types[i].class_inf[j].num_pins); 02145 fprintf(Echo, "\t\t\tpins: "); /* No \n */ 02146 for(k = 0; k < Types[i].class_inf[j].num_pins; 02147 ++k) 02148 { 02149 fprintf(Echo, "%d ", Types[i].class_inf[j].pinlist[k]); /* No \n */ 02150 } 02151 fprintf(Echo, "\n"); /* End current line */ 02152 } 02153 } 02154 fprintf(Echo, "\tis_Fc_frac: %s\n", 02155 (Types[i].is_Fc_frac ? "TRUE" : "FALSE")); 02156 fprintf(Echo, "\tis_Fc_out_full_flex: %s\n", 02157 (Types[i].is_Fc_out_full_flex ? "TRUE" : "FALSE")); 02158 fprintf(Echo, "\tFc_in: %f\n", Types[i].Fc_in); 02159 fprintf(Echo, "\tFc_out: %f\n", Types[i].Fc_out); 02160 fprintf(Echo, "\tmax_subblocks: %d\n", Types[i].max_subblocks); 02161 fprintf(Echo, "\tmax_subblock_inputs: %d\n", 02162 Types[i].max_subblock_inputs); 02163 fprintf(Echo, "\tmax_subblock_outputs: %d\n", 02164 Types[i].max_subblock_outputs); 02165 fprintf(Echo, "\tnum_drivers: %d\n", Types[i].num_drivers); 02166 fprintf(Echo, "\tnum_receivers: %d\n", Types[i].num_receivers); 02167 fprintf(Echo, "\tindex: %d\n", Types[i].index); 02168 fprintf(Echo, "\n"); 02169 } 02170 fclose(Echo); 02171 }
void XmlReadArch | ( | IN const char * | ArchFile, | |
IN boolean | timing_enabled, | |||
OUT struct s_arch * | arch, | |||
OUT t_type_descriptor ** | Types, | |||
OUT int * | NumTypes | |||
) |
Definition at line 1629 of file xml_arch.c.
01634 { 01635 ezxml_t Cur, Next; 01636 01637 /* Parse the file */ 01638 Cur = ezxml_parse_file(ArchFile); 01639 if(NULL == Cur) 01640 { 01641 printf(ERRTAG "Unable to load architecture file '%s'.\n", 01642 ArchFile); 01643 } 01644 01645 /* Root node should be architecture */ 01646 CheckElement(Cur, "architecture"); 01647 01648 /* Process layout */ 01649 Next = FindElement(Cur, "layout", TRUE); 01650 ProcessLayout(Next, arch); 01651 FreeNode(Next); 01652 01653 /* Process device */ 01654 Next = FindElement(Cur, "device", TRUE); 01655 ProcessDevice(Next, arch, timing_enabled); 01656 FreeNode(Next); 01657 01658 /* Process types */ 01659 Next = FindElement(Cur, "typelist", TRUE); 01660 ProcessTypes(Next, Types, NumTypes, timing_enabled); 01661 FreeNode(Next); 01662 01663 /* Process switches */ 01664 Next = FindElement(Cur, "switchlist", TRUE); 01665 ProcessSwitches(Next, &(arch->Switches), &(arch->num_switches), 01666 timing_enabled); 01667 FreeNode(Next); 01668 01669 /* Process segments. This depends on switches */ 01670 Next = FindElement(Cur, "segmentlist", TRUE); 01671 ProcessSegments(Next, &(arch->Segments), &(arch->num_segments), 01672 arch->Switches, arch->num_switches, timing_enabled); 01673 FreeNode(Next); 01674 01675 /* Release the full XML tree */ 01676 FreeNode(Cur); 01677 }