VIS

src/hrc/hrcMisc.c

Go to the documentation of this file.
00001 
00034 #include "hrcInt.h"
00035 
00036 static char rcsid[] UNUSED = "$Id: hrcMisc.c,v 1.4 2005/04/27 00:10:58 fabio Exp $";
00037 
00038 /*---------------------------------------------------------------------------*/
00039 /* Constant declarations                                                     */
00040 /*---------------------------------------------------------------------------*/
00041 
00042 
00043 /*---------------------------------------------------------------------------*/
00044 /* Type declarations                                                         */
00045 /*---------------------------------------------------------------------------*/
00046 
00047 
00048 /*---------------------------------------------------------------------------*/
00049 /* Stucture declarations                                                     */
00050 /*---------------------------------------------------------------------------*/
00051 
00052 
00053 /*---------------------------------------------------------------------------*/
00054 /* Variable declarations                                                     */
00055 /*---------------------------------------------------------------------------*/
00056 
00057 
00058 /*---------------------------------------------------------------------------*/
00059 /* Macro declarations                                                        */
00060 /*---------------------------------------------------------------------------*/
00061 
00062 
00065 /*---------------------------------------------------------------------------*/
00066 /* Static function prototypes                                                */
00067 /*---------------------------------------------------------------------------*/
00068 
00069 static void NodeObtainComponentModels(Hrc_Node_t *node, st_table *models);
00070 
00074 /*---------------------------------------------------------------------------*/
00075 /* Definition of exported functions                                          */
00076 /*---------------------------------------------------------------------------*/
00077 
00096 Hrc_Node_t *
00097 Hrc_ManagerFindNodeByPathName(
00098   Hrc_Manager_t *manager,  
00099   char *path,
00100   boolean pathFlag)
00101 {
00102   int position, count;
00103   int i = 0;
00104   Hrc_Node_t *presentNode;
00105   char *name;
00106   
00107   /* Check whether the pathname begins from the root node or the current node
00108      and initialize presentNode accordingly. */
00109   if(pathFlag == FALSE) {  
00110     /* Hierarchy will be traversed beginning from root node. */
00111     presentNode = manager->rootNode;
00112   }
00113   else {
00114     /* Hierarchy will be traversed beginning from current node. */
00115     presentNode = manager->currentNode;
00116   }
00117 
00118   position = i;
00119 /* The name of a particular node in the pathname begins at position.
00120    position is updated every time presentNode is updated to a child from
00121    the parent. */
00122   
00123   count = 0;
00124   while(path[i] != '\0') {
00125     if(path[i] == '.') {
00126       name = ALLOC(char, count+1);
00127       strncpy(name, path+position, count);
00128       name[count] = '\0';
00129       if((presentNode = Hrc_NodeFindChildByName(presentNode, name)) ==
00130          NIL(Hrc_Node_t)) {
00131         FREE(name);
00132         return NIL(Hrc_Node_t);
00133       }
00134       position += count + 1;
00135       count = 0;
00136       FREE(name);
00137     }
00138     else {
00139       count++;
00140     }
00141     i++;
00142   }
00143   name = ALLOC(char, count+1);
00144   strncpy(name, path+position, count);
00145   name[count] = '\0';
00146   if((presentNode = Hrc_NodeFindChildByName(presentNode, name)) ==
00147      NIL(Hrc_Node_t)) {
00148     FREE(name);
00149     return NIL(Hrc_Node_t);
00150   }
00151   FREE(name);
00152   return presentNode;
00153 }
00154 
00172 Var_Variable_t *
00173 Hrc_VariableFindActualFromFormal(
00174   Hrc_Node_t *node,
00175   Var_Variable_t *formalVar,
00176   Hrc_Node_t *referenceNode)
00177 {
00178   int position = -1;
00179   int i;
00180   Var_Variable_t *var;
00181   Hrc_Node_t *presentNode;
00182   Var_Variable_t *presentVar;
00183   char *varName;
00184   
00185   if(node == referenceNode) {
00186     return formalVar;
00187   }
00188   else {
00189     presentNode = node;
00190     presentVar = formalVar;
00191   }
00192   
00193   /* A variable at position i in formalInputs corresponds to a varible at
00194      position i in actualInputs. The variables in actualInputs in a node
00195      are actually formal variables (could be I/O or internal) of the parent
00196      of the node. Given a formal variable and a node, search for the
00197      variable in formalInputs and formalOutputs. If it is not present in
00198      either then check if it is an internal variable of the node. If it is
00199      present, get the corresponding variable from actualInputs or
00200      actualOutputs as the case may be. Update presentVar to this variable
00201      and presentNode to the parent of the node. Repeat the process until
00202      presentVar is an internal variable of presentNode or presentNode
00203      becomes the same as referenceNode. */
00204 
00205   while(presentNode != referenceNode) {
00206     Hrc_NodeForEachFormalInput(presentNode, i, var) {
00207       if(var == presentVar) {
00208         position = i;
00209       }
00210     }
00211     if(position != -1) {
00212       presentVar = array_fetch(Var_Variable_t *,
00213                                presentNode->actualInputs, position);
00214     }
00215     else {
00216       Hrc_NodeForEachFormalOutput(presentNode, i, var) {
00217         if(var == presentVar) {
00218           position = i;
00219         }
00220       }
00221       if(position != -1) {
00222         presentVar = array_fetch(Var_Variable_t *,
00223                                  presentNode->actualOutputs, position);
00224       }
00225       else {
00226         varName = Var_VariableReadName(presentVar);
00227         if(st_is_member(presentNode->varTable, varName)) {
00228           return presentVar;
00229         }
00230         else {
00231           return NIL(Var_Variable_t);
00232         }
00233       }
00234     }
00235     presentNode = presentNode->parentNode;
00236 /* The following check is just to make sure that the function does not try
00237    to access the parent of the root node. */
00238     if(presentNode == NIL(Hrc_Node_t )) {
00239       return NIL(Var_Variable_t);
00240     }
00241     position = -1;
00242   }
00243   return presentVar;
00244 }
00245 
00256 array_t *
00257 Hrc_ManagerObtainComponentModels(
00258   Hrc_Manager_t *manager)
00259 {
00260   st_generator *gen;
00261   char *modelName;
00262   char *dummy;
00263   Hrc_Model_t *model;
00264   st_table *modelTable = st_init_table(strcmp, st_strhash);
00265   array_t *modelArray = array_alloc(Hrc_Model_t *, 0);
00266   
00267   NodeObtainComponentModels(manager->currentNode, modelTable);
00268   st_foreach_item(modelTable, gen, &modelName, &dummy) {
00269     st_lookup(manager->modelTable, modelName, &model);
00270     array_insert_last(Hrc_Model_t *, modelArray, model);
00271   }
00272   st_free_table(modelTable);
00273   return modelArray;
00274 }
00275 
00295 char *
00296 Hrc_NodeFindHierarchicalName(
00297   Hrc_Node_t *node,
00298   boolean pathFlag)
00299 {
00300   Hrc_Manager_t *manager = Hrc_NodeReadManager(node);
00301   Hrc_Node_t *currentNode, *rootNode, *tempNode;
00302   char *name;
00303   char *parentName;
00304   char *temp;
00305 
00306   rootNode = Hrc_ManagerReadRootNode(manager);
00307   currentNode = Hrc_ManagerReadCurrentNode(manager);
00308   
00309   if(pathFlag == FALSE) {
00310     if(node == rootNode) {
00311       name = util_strsav("");
00312     }
00313     else {
00314       tempNode = node;
00315       name = util_strsav(Hrc_NodeReadInstanceName(tempNode));
00316       while((tempNode = Hrc_NodeReadParentNode(tempNode)) != rootNode) {
00317         parentName = util_strsav(Hrc_NodeReadInstanceName(tempNode));
00318         temp = util_strcat3(parentName, ".", name);
00319         FREE(parentName);
00320         FREE(name);
00321         name = temp;      
00322       }
00323     }
00324   }
00325   else {
00326     if(node == currentNode) {
00327     name = util_strsav("");
00328     }
00329     else {
00330       tempNode = node;
00331       name = util_strsav(Hrc_NodeReadInstanceName(tempNode));
00332       if(tempNode == rootNode) {
00333         /* return NULL. In this case, the function is being asked to find the
00334            pathname of root node relative to the current node, when the
00335            current node is not the root node */
00336         FREE(name);
00337         return NIL(char);
00338       }
00339       while((tempNode = Hrc_NodeReadParentNode(tempNode)) != currentNode) {
00340         if(tempNode == rootNode) {
00341           FREE(name);
00342           return NIL(char);
00343         }
00344         parentName = util_strsav(Hrc_NodeReadInstanceName(tempNode));
00345         temp = util_strcat3(parentName, ".", name);
00346         FREE(parentName);
00347         FREE(name);
00348         name = temp;      
00349       }
00350     }
00351   }
00352   return name;
00353 }
00354 
00370 /*st_table *
00371 Hrc_TableCreateFormalToActual(
00372   Hrc_Node_t *rootNode)
00373 {
00374 }*/
00375 
00376 
00404 boolean
00405 Hrc_TreeReplace(
00406   Hrc_Node_t *oldNode,
00407   Hrc_Node_t *newNode)
00408 {
00409   Hrc_Node_t *tempNode, *presentNode;
00410   char *newName, *instanceName;
00411   char *newInstanceName;
00412   int i, num, index;
00413   Hrc_Model_t *prevOldModel, *prevNewModel;
00414   Hrc_Model_t *oldModel, *newModel;
00415   Hrc_Model_t *calleeModel;
00416   Hrc_Subckt_t *subckt;
00417   st_table *varToDupVar;
00418   Tbl_Table_t *table, *dupTable;
00419   Var_Variable_t *var, *dupVar;
00420   char *name, *dupName;
00421   st_generator *gen;
00422   Hrc_Latch_t *latch, *dupLatch;
00423   array_t *newActualInputVars, *newActualOutputVars;
00424   char *key;
00425   ApplInfo_t *applInfo;
00426   
00427   /* It is illegal to pass NULL as newNode. */
00428   assert(newNode != NIL(Hrc_Node_t));
00429   
00430   if(oldNode == NIL(Hrc_Node_t)) {
00431     HrcNodeFreeRecursively(newNode);
00432     return TRUE;
00433   }
00434   
00435   if(Hrc_NodeTestIsInTree(newNode, oldNode->manager->rootNode)) {
00436     return FALSE;
00437   }
00438 
00439   /* free applInfo strutures all the way to the root since
00440      flattened networks get invalidated with this tree-replace. */
00441   presentNode = oldNode;
00442   while(presentNode != NIL(Hrc_Node_t)) {
00443     st_foreach_item(presentNode->applInfoTable, gen, &key, &applInfo) {
00444       (*applInfo->freeFn)(applInfo->data);
00445       FREE(key);
00446       FREE(applInfo);
00447     }
00448     st_free_table(presentNode->applInfoTable);
00449     presentNode->applInfoTable = st_init_table(strcmp, st_strhash);
00450     presentNode = Hrc_NodeReadParentNode(presentNode);
00451   }
00452 
00453   /* If oldNode is the root node of the hierarchy, simply set the root node
00454      and current node of the hierarchy to newNode. */
00455 
00456   if(oldNode->parentNode == NIL(Hrc_Node_t)) {
00457     Hrc_ManagerSetRootNode(oldNode->manager, newNode);
00458     Hrc_ManagerSetCurrentNode(oldNode->manager, newNode);
00459   }
00460   else {
00461     /* First, remove the connection between oldNode and its parent and
00462        establish connection between newNode and oldNode's parent. */
00463     tempNode = HrcNodeDeleteChild(oldNode->parentNode, oldNode->instanceName);
00464     assert(oldNode == tempNode);
00465     FREE(newNode->instanceName);
00466     newNode->instanceName = util_strsav(oldNode->instanceName);
00467     newNode->parentNode = oldNode->parentNode;
00468     st_insert(newNode->parentNode->childTable, newNode->instanceName,
00469               (char *) newNode);
00470     newNode->actualInputs = array_dup(oldNode->actualInputs);
00471     newNode->actualOutputs = array_dup(oldNode->actualOutputs);
00472 
00473     /* Starting from the parent of oldNode (now the parent of newNode), go
00474        up the hierarchy and at each node generate a new model by modifying
00475        the model corresponding to the node appropriately. The new model name
00476        is obtained from the old one by appending a '~' to it. The model names
00477        in the nodes traversed have to be modified.
00478        
00479        The three variables newInstanceName, prevOldModel and prevNewModel
00480        keep information needed to generate new models by modifying already
00481        existing ones. */
00482     newInstanceName = newNode->instanceName;
00483     presentNode = newNode->parentNode;
00484     st_lookup(presentNode->manager->modelTable, oldNode->modelName,
00485               &prevOldModel);
00486     st_lookup(presentNode->manager->modelTable, newNode->modelName,
00487               &prevNewModel);
00488     while(presentNode != NIL(Hrc_Node_t)) {
00489       oldModel = Hrc_ManagerFindModelByName(presentNode->manager,
00490                                             presentNode->modelName);
00491       newName = ALLOC(char, strlen(presentNode->modelName) + 2);
00492       strcpy(newName, presentNode->modelName);
00493       strcat(newName, "~");
00494       FREE(presentNode->modelName);
00495       presentNode->modelName = newName;
00496 
00497       /* Allocate a new model and fill up its fields by copying and
00498          modifying appropriately the fields from the old model */
00499       newModel = Hrc_ModelAlloc(presentNode->manager, presentNode->modelName);
00500 
00501       /* Fill in the entries of the master node of newModel. I couldn't
00502          use Hrc_NodeDup() to duplicate the master node of the oldModel here
00503          because that function does some other things too. All the variables
00504          of the masterNode of oldModel are duplicated. Note that masterNode
00505          and the nodes in the hierarchy corresponding to the model do not
00506          share variables. */
00507 
00508       varToDupVar = st_init_table(st_ptrcmp, st_ptrhash);
00509       Hrc_NodeForEachVariable(oldModel->masterNode, gen, name, var) {
00510         dupVar = Var_VariableDup(var, newModel->masterNode);
00511         dupName = Var_VariableReadName(dupVar);
00512         st_insert(newModel->masterNode->varTable, dupName, dupVar);
00513         st_insert(varToDupVar, var, dupVar);
00514       }
00515       Hrc_NodeForEachFormalInput(oldModel->masterNode, i, var) {
00516         st_lookup(varToDupVar, var, &dupVar);
00517         array_insert_last(Var_Variable_t *,
00518                           newModel->masterNode->formalInputs, dupVar);
00519       }
00520       Hrc_NodeForEachFormalOutput(oldModel->masterNode, i, var) {
00521         st_lookup(varToDupVar, var, &dupVar);
00522         array_insert_last(Var_Variable_t *,
00523                           newModel->masterNode->formalOutputs, dupVar);
00524       }
00525       Hrc_NodeForEachNameTable(oldModel->masterNode, i, table) {
00526         dupTable = Tbl_TableSoftDup(table);
00527         Tbl_TableForEachInputVar(dupTable, index, var) {
00528           st_lookup(varToDupVar, var, &dupVar);
00529           Tbl_TableSubstituteVar(dupTable, var, dupVar);
00530         }
00531         Tbl_TableForEachOutputVar(dupTable, index, var) {
00532           st_lookup(varToDupVar, var, &dupVar);
00533           Tbl_TableSubstituteVar(dupTable, var, dupVar);
00534         }
00535         array_insert_last(Tbl_Table_t *, newModel->masterNode->nameTables,
00536                           dupTable);
00537       }
00538       Hrc_NodeForEachLatch(oldModel->masterNode, gen, name, latch) {
00539         dupLatch = ALLOC(Hrc_Latch_t, 1);
00540         st_lookup(varToDupVar, latch->latchInput, &(dupLatch->latchInput));
00541         st_lookup(varToDupVar, latch->latchOutput, &(dupLatch->latchOutput));
00542         dupLatch->resetTable = Tbl_TableSoftDup(latch->resetTable);
00543         Tbl_TableForEachInputVar(dupLatch->resetTable, index, var) {
00544           st_lookup(varToDupVar, var, &dupVar);
00545           Tbl_TableSubstituteVar(dupLatch->resetTable, var, dupVar);
00546         }
00547         Tbl_TableForEachOutputVar(dupLatch->resetTable, index, var) {
00548           st_lookup(varToDupVar, var, &dupVar);
00549           Tbl_TableSubstituteVar(dupLatch->resetTable, var, dupVar);
00550         }
00551         dupLatch->undef = latch->undef;
00552         st_insert(newModel->masterNode->latchTable, Var_VariableReadName(dupLatch->latchOutput), dupLatch);
00553       }
00554 
00555       /* For each subckt entry in oldModel, add a corresponding entry to
00556          newModel except for the entry corresponding to the modified child
00557          of presentNode. This particular subckt is recognized by its
00558          instanceName. */
00559       Hrc_ModelForEachSubckt(oldModel, gen, name, subckt) {
00560         if(!strcmp(subckt->instanceName, newInstanceName)) {
00561           calleeModel = prevNewModel;
00562         }
00563         else {
00564           calleeModel = subckt->model;
00565         }
00566         instanceName = subckt->instanceName;
00567         newActualInputVars = array_alloc(Var_Variable_t *, 0);
00568         num = array_n(subckt->actualInputVars);
00569         for(i =0; i < num; ++i) {
00570           var = array_fetch(Var_Variable_t *, subckt->actualInputVars, i);
00571           st_lookup(varToDupVar, var, &dupVar);
00572           array_insert_last(Var_Variable_t *, newActualInputVars, dupVar);
00573         }
00574         newActualOutputVars = array_alloc(Var_Variable_t *, 0);
00575         num = array_n(subckt->actualOutputVars);
00576         for(i =0; i < num; ++i) {
00577           var = array_fetch(Var_Variable_t *, subckt->actualOutputVars, i);
00578           st_lookup(varToDupVar, var, &dupVar);
00579           array_insert_last(Var_Variable_t *, newActualOutputVars, dupVar);
00580         }
00581         Hrc_ModelAddSubckt(newModel, calleeModel, instanceName,
00582                            newActualInputVars, newActualOutputVars);
00583       }
00584       
00585       st_free_table(varToDupVar);
00586       
00587       newInstanceName = presentNode->instanceName;
00588       /* Right now, I am not modifying the instance names. */
00589       prevOldModel = oldModel;
00590       prevNewModel = newModel;
00591       presentNode = presentNode->parentNode;
00592     }
00593   }
00594   HrcNodeFreeRecursively(oldNode);
00595   return TRUE;
00596 }
00609 boolean
00610 Hrc_NodeTestIsInTree(
00611   Hrc_Node_t *node1,      
00612   Hrc_Node_t *node2)      
00613 {
00614 /* node1 is the node whose membership is to be tested */
00615 /* node2 is the root of the tree which is to be searched */
00616   st_generator *gen;
00617   char *name;
00618   Hrc_Node_t *childNode;
00619   
00620   if(node1 == node2) {
00621     return TRUE;
00622   }
00623   else {
00624     Hrc_NodeForEachChild(node2, gen, name, childNode) {
00625       if(Hrc_NodeTestIsInTree(node1, childNode)) {
00626         return TRUE;
00627       }
00628     }
00629     return FALSE;
00630   }
00631 }
00632 
00668 boolean
00669 Hrc_NodeTestIsUninterpreted(
00670   Hrc_Node_t *node )
00671 
00672 {
00673   if( st_count( Hrc_NodeReadLatchTable( node ) ) ||
00674       array_n(  Hrc_NodeReadNameTables( node ) ) ||
00675       st_count( Hrc_NodeReadChildTable( node ) ) ) return FALSE;
00676 
00677   return TRUE;
00678 
00679 }
00680 
00681 
00693 boolean
00694 Hrc_ModelTestIsUninterpreted(
00695         Hrc_Model_t* model )
00696 
00697 {
00698   Hrc_Node_t* node;
00699 
00700   node = Hrc_ModelReadMasterNode( model );
00701 
00702   if( st_count( Hrc_NodeReadLatchTable( node ) ) ||
00703       array_n(  Hrc_NodeReadNameTables( node ) ) ||
00704       st_count( Hrc_ModelReadSubcktTable( model ) ) ) return FALSE;
00705   
00706   return TRUE;
00707 }
00708 
00709 
00723 boolean
00724 Hrc_NodeTestRecursivelyIsUninterpreted(
00725         Hrc_Node_t* parent )
00726 {
00727   st_generator* gen;
00728   char*         childName;
00729   Hrc_Node_t*   child;
00730   
00731   if( Hrc_NodeTestIsUninterpreted( parent )) return TRUE;
00732   
00733   Hrc_NodeForEachChild( parent, gen, childName, child) {
00734 
00735     if( Hrc_NodeTestRecursivelyIsUninterpreted( child ) ) return TRUE;
00736 
00737   }
00738 
00739   return FALSE;
00740 
00741 }
00742 
00743 
00756 boolean
00757 Hrc_NodeTestIsUninterpretedNodeInHierarchy(
00758   Hrc_Manager_t* hmgr )
00759 
00760 {
00761 
00762   return Hrc_NodeTestRecursivelyIsUninterpreted( Hrc_ManagerReadRootNode( hmgr ) );
00763 
00764 }
00765 
00766 
00783 boolean
00784 Hrc_NodeCheckVariableConsistency(
00785   Hrc_Node_t *node)
00786 {
00787   boolean success = TRUE;
00788   int i, j;
00789   st_generator *gen;
00790   Var_Variable_t *var;
00791   Hrc_Latch_t *latch;
00792   char *latchName, *varName;
00793   st_table *varToNumFanoutTables;
00794   Tbl_Table_t *table;
00795   long num;
00796 
00797   Hrc_NodeForEachFormalInput(node,i,var){
00798     if (Var_VariableTestIsPI(var) == 0){
00799       fprintf(vis_stderr, "Input variable %s is not labeled as PI.\n",
00800         Var_VariableReadName(var));
00801       success = FALSE;
00802     }
00803   }
00804   Hrc_NodeForEachFormalOutput(node,i,var){
00805     if (Var_VariableTestIsPO(var) == 0){
00806       fprintf(vis_stderr, "Output variable %s is not labeled as PO.\n",
00807         Var_VariableReadName(var));
00808       success = FALSE;
00809     }
00810   }
00811   /* if the node is not the root node, check consistency of actual variables */
00812   if (Hrc_NodeReadParentNode(node) != NIL(Hrc_Node_t)){
00813     Hrc_NodeForEachActualInput(node,i,var){
00814       if (Var_VariableTestIsSI(var) == 0){
00815         fprintf(vis_stderr, "Subcircuit input variable %s is not labeled as SI.\n",
00816           Var_VariableReadName(var));
00817         success = FALSE;
00818       }
00819     }
00820     Hrc_NodeForEachActualOutput(node,i,var){
00821       if (Var_VariableTestIsSO(var) == 0){
00822         fprintf(vis_stderr, "Subcircuit output variable %s is not labeled as SO.\n",
00823           Var_VariableReadName(var));
00824         success = FALSE;
00825       }
00826     }
00827   }
00828 
00829   Hrc_NodeForEachLatch(node,gen,latchName,latch){
00830     var = Hrc_LatchReadOutput(latch);
00831     if (Var_VariableTestIsPS(var) == 0){
00832       fprintf(vis_stderr, "Latch output variable %s is not labeled as PS.\n",
00833         Var_VariableReadName(var));
00834       success = FALSE;
00835     }
00836     var = Hrc_LatchReadInput(latch);
00837     if (Var_VariableTestIsNS(var) == 0){
00838       fprintf(vis_stderr, "Latch input variable %s is not labeled as NS.\n",
00839         Var_VariableReadName(var));
00840       success = FALSE;
00841     }
00842   }
00843 
00844   varToNumFanoutTables = st_init_table(st_ptrcmp,st_ptrhash);
00845   Hrc_NodeForEachVariable(node,gen,varName,var){
00846     if (Var_VariableTestTypeConsistency(var) == 0){
00847       success = FALSE;
00848     }
00849     (void)st_insert(varToNumFanoutTables, (char *)var, (char *)((long)0));
00850   }
00851 
00852   Hrc_NodeForEachNameTable(node,i,table){
00853     Tbl_TableForEachInputVar(table,j,var){
00854       (void)st_lookup(varToNumFanoutTables,var,&num);
00855       st_insert(varToNumFanoutTables,var,(char *) ++num);
00856     }  
00857   }
00858 
00859   Hrc_NodeForEachVariable(node,gen,varName,var){
00860     (void)st_lookup(varToNumFanoutTables,var,&num);
00861     if (num != (long)Var_VariableReadNumFanoutTables(var)){
00862       fprintf(vis_stderr,"numFanoutTables field of variable %s is inconsistent.  (True value = %d, Registered value = %d)\n", 
00863         Var_VariableReadName(var), (int)num, Var_VariableReadNumFanoutTables(var));
00864       success = FALSE;
00865     }
00866   }
00867 
00868   st_free_table(varToNumFanoutTables);
00869   return success;
00870 }
00871 
00872 /*---------------------------------------------------------------------------*/
00873 /* Definition of internal functions                                          */
00874 /*---------------------------------------------------------------------------*/
00875 
00876 
00877 /*---------------------------------------------------------------------------*/
00878 /* Definition of static functions                                            */
00879 /*---------------------------------------------------------------------------*/
00891 static void
00892 NodeObtainComponentModels(
00893     Hrc_Node_t *node,
00894     st_table *models)
00895 {
00896     char *name;
00897     Hrc_Node_t *child;
00898     st_generator *gen;
00899     
00900     st_insert(models, node->modelName, (char *) 0);
00901     Hrc_NodeForEachChild(node, gen, name, child){
00902         NodeObtainComponentModels(child, models);
00903     }
00904 }