Changeset 104 for vis_dev/vis-2.3
- Timestamp:
- Jul 23, 2012, 5:36:38 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vis_dev/vis-2.3/src/debug/debug.c
r101 r104 67 67 static int CommandGenerateNetworkCNF(Hrc_Manager_t ** hmgr,int argc, char ** argv); 68 68 static int CommandBuildCexBdd(Hrc_Manager_t ** hmgr,int argc, char ** argv); 69 static int CommandComposeWithCex(Hrc_Manager_t ** hmgr,int argc, char ** argv); 70 69 71 70 72 … … 98 100 Cmd_CommandAdd("_cexbdd", CommandBuildCexBdd, 0); 99 101 Cmd_CommandAdd("print_network_cnf", CommandGenerateNetworkCNF, 0); 102 Cmd_CommandAdd("_compose", CommandComposeWithCex, 1); 100 103 101 104 } … … 1046 1049 mdd_FunctionPrintMain (mddManager ,init,"INIT",vis_stdout); 1047 1050 1051 return 0; /* normal exit */ 1052 1053 usage: 1054 (void) fprintf(vis_stderr, "usage: _BddCex [-h] [-v]\n"); 1055 (void) fprintf(vis_stderr, " -h\t\tprint the command usage\n"); 1056 (void) fprintf(vis_stderr, " -v\t\tverbose\n"); 1057 return 1; /* error exit */ 1058 1059 } 1060 1061 1062 static int CommandComposeWithCex(Hrc_Manager_t ** hmgr,int argc, char ** argv) 1063 { 1064 1065 char * cexName; 1066 char * cexModelName; 1067 char * rootName; 1068 char * newName; 1069 FILE * cexFile; 1070 Hrc_Node_t * rootNode; 1071 Hrc_Node_t * cexNode; 1072 Hrc_Model_t * rootModel; 1073 Hrc_Model_t * cexModel; 1074 Hrc_Model_t * newModel; 1075 Hrc_Manager_t * hmgrCex; 1076 // Ntk_Network_t * networkCex; 1077 array_t *cexActualInputArray, *cexActualOutputArray; 1078 array_t *actualInputArray, *actualOutputArray; 1079 1080 rootNode = Hrc_ManagerReadRootNode(*hmgr); 1081 if(rootNode == NIL(Hrc_Node_t)){ 1082 printf("Please build the network first\n"); 1083 return 1; 1084 } 1085 rootName = Hrc_NodeReadModelName(rootNode); 1086 rootModel = Hrc_ManagerFindModelByName(*hmgr,rootName); 1087 if (argc - util_optind > 0) 1088 { 1089 cexName = util_strsav(argv[util_optind]); 1090 cexFile = Cmd_FileOpen(cexName, "r", NIL(char *), 0); 1091 if(cexFile == NULL) 1092 (void) fprintf(vis_stderr, "%s not Found\n",cexName); 1093 1094 } 1095 else 1096 goto usage; 1097 1098 1099 1100 // Read_blif_mv 1101 hmgrCex = Io_BlifMvRead(cexFile,hmgrCex,0,0,0); 1102 if(hmgrCex == NIL(Hrc_Manager_t)){ 1103 fprintf(vis_stderr, "cannot open the hierrachy %\n",cexName); 1104 return 1; 1105 } 1106 st_table * modelTable = Hrc_ManagerReadModelTable(hmgrCex); 1107 if( st_count(modelTable) != 1){ 1108 fprintf(vis_stderr, "cannot open more than one cex model\n"); 1109 return 1; 1110 } 1111 st_generator * gen; 1112 Hrc_ManagerForEachModel( hmgrCex,gen,cexModelName,cexModel){} 1113 fprintf(vis_stderr, "Compose %s with %s\n",rootName, cexModelName); 1114 1115 cexNode = Hrc_ManagerReadRootNode(hmgrCex); 1116 actualInputArray = array_dup(Hrc_NodeReadFormalInputs(rootNode)); 1117 actualOutputArray = array_dup(Hrc_NodeReadFormalOutputs(rootNode)); 1118 Hrc_ModelAddSubckt(rootModel,cexModel,cexModelName,actualInputArray, actualOutputArray); 1119 1120 1121 1122 1123 1124 1125 1126 /* 1127 modelName = Hrc_NodeReadModelName(rootNode); 1128 newRootName = ALLOC(char, strlen(cexName)+ strlen(modelName) + 2); 1129 sprintf(newRootName,"%s_%s",modelName,cexName); 1130 Hrc_Model_t * newRootModel = Hrc_ModelAlloc(*hmgr,rootName); 1131 */ 1132 1133 fclose(cexFile); 1134 return 0; /* normal exit */ 1135 1136 usage: 1137 (void) fprintf(vis_stderr, "usage: _compose <cexFileName>\n"); 1138 return 1; /* error exit */ 1139 1140 1048 1141 /* 1049 1142 // Read_blif_mv … … 1103 1196 printf(" modele %s , cex %s \n",Part_PartitionReadName(part), Part_PartitionReadName(partition)); 1104 1197 */ 1105 return 0; /* normal exit */ 1106 1107 usage: 1108 (void) fprintf(vis_stderr, "usage: _BddCex [-h] [-v]\n"); 1109 (void) fprintf(vis_stderr, " -h\t\tprint the command usage\n"); 1110 (void) fprintf(vis_stderr, " -v\t\tverbose\n"); 1111 return 1; /* error exit */ 1112 1113 } 1114 1115 1198 1199 1200 }
Note: See TracChangeset
for help on using the changeset viewer.