#include "vec.h"
Go to the source code of this file.
Data Structures | |
struct | FxuDataStruct |
Typedefs | |
typedef struct FxuDataStruct | Fxu_Data_t |
Functions | |
int | Fxu_FastExtract (Fxu_Data_t *pData) |
typedef struct FxuDataStruct Fxu_Data_t |
CFile****************************************************************
FileName [fxu.h]
PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]
Synopsis [External declarations of fast extract for unate covers.]
Author [MVSIS Group]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - February 1, 2003.]
Revision [
] INCLUDES /// PARAMETERS /// STRUCTURE DEFINITIONS ///
int Fxu_FastExtract | ( | Fxu_Data_t * | pData | ) |
MACRO DEFINITIONS /// FUNCTION DEFINITIONS ///
FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Performs fast_extract on a set of covers.]
Description [All the covers are given in the array p->vSops. The resulting covers are returned in the array p->vSopsNew. The entries in these arrays correspond to objects in the network. The entries corresponding to the PI and objects with trivial covers are NULL. The number of extracted covers (not exceeding p->nNodesExt) is returned. Two other things are important for the correct operation of this procedure: (1) The input covers do not have duplicated fanins and are SCC-free. (2) The fanins array contains the numbers of the fanin objects.]
SideEffects []
SeeAlso []
Definition at line 55 of file fxu.c.
00056 { 00057 Fxu_Matrix * p; 00058 Fxu_Single * pSingle; 00059 Fxu_Double * pDouble; 00060 int Weight1, Weight2, Weight3; 00061 int Counter = 0; 00062 00063 s_MemoryTotal = 0; 00064 s_MemoryPeak = 0; 00065 00066 // create the matrix 00067 p = Fxu_CreateMatrix( pData ); 00068 if ( p == NULL ) 00069 return -1; 00070 // if ( pData->fVerbose ) 00071 // printf( "Memory usage after construction: Total = %d. Peak = %d.\n", s_MemoryTotal, s_MemoryPeak ); 00072 //Fxu_MatrixPrint( NULL, p ); 00073 00074 if ( pData->fOnlyS ) 00075 { 00076 pData->nNodesNew = 0; 00077 do 00078 { 00079 Weight1 = Fxu_HeapSingleReadMaxWeight( p->pHeapSingle ); 00080 if ( pData->fVerbose ) 00081 printf( "Div %5d : Best single = %5d.\r", Counter++, Weight1 ); 00082 if ( Weight1 > 0 || Weight1 == 0 && pData->fUse0 ) 00083 Fxu_UpdateSingle( p ); 00084 else 00085 break; 00086 } 00087 while ( ++pData->nNodesNew < pData->nNodesExt ); 00088 } 00089 else if ( pData->fOnlyD ) 00090 { 00091 pData->nNodesNew = 0; 00092 do 00093 { 00094 Weight2 = Fxu_HeapDoubleReadMaxWeight( p->pHeapDouble ); 00095 if ( pData->fVerbose ) 00096 printf( "Div %5d : Best double = %5d.\r", Counter++, Weight2 ); 00097 if ( Weight2 > 0 || Weight2 == 0 && pData->fUse0 ) 00098 Fxu_UpdateDouble( p ); 00099 else 00100 break; 00101 } 00102 while ( ++pData->nNodesNew < pData->nNodesExt ); 00103 } 00104 else if ( !pData->fUseCompl ) 00105 { 00106 pData->nNodesNew = 0; 00107 do 00108 { 00109 Weight1 = Fxu_HeapSingleReadMaxWeight( p->pHeapSingle ); 00110 Weight2 = Fxu_HeapDoubleReadMaxWeight( p->pHeapDouble ); 00111 00112 if ( pData->fVerbose ) 00113 printf( "Div %5d : Best double = %5d. Best single = %5d.\r", Counter++, Weight2, Weight1 ); 00114 //Fxu_Select( p, &pSingle, &pDouble ); 00115 00116 if ( Weight1 >= Weight2 ) 00117 { 00118 if ( Weight1 > 0 || Weight1 == 0 && pData->fUse0 ) 00119 Fxu_UpdateSingle( p ); 00120 else 00121 break; 00122 } 00123 else 00124 { 00125 if ( Weight2 > 0 || Weight2 == 0 && pData->fUse0 ) 00126 Fxu_UpdateDouble( p ); 00127 else 00128 break; 00129 } 00130 } 00131 while ( ++pData->nNodesNew < pData->nNodesExt ); 00132 } 00133 else 00134 { // use the complement 00135 pData->nNodesNew = 0; 00136 do 00137 { 00138 Weight1 = Fxu_HeapSingleReadMaxWeight( p->pHeapSingle ); 00139 Weight2 = Fxu_HeapDoubleReadMaxWeight( p->pHeapDouble ); 00140 00141 // select the best single and double 00142 Weight3 = Fxu_Select( p, &pSingle, &pDouble ); 00143 if ( pData->fVerbose ) 00144 printf( "Div %5d : Best double = %5d. Best single = %5d. Best complement = %5d.\r", 00145 Counter++, Weight2, Weight1, Weight3 ); 00146 00147 if ( Weight3 > 0 || Weight3 == 0 && pData->fUse0 ) 00148 Fxu_Update( p, pSingle, pDouble ); 00149 else 00150 break; 00151 } 00152 while ( ++pData->nNodesNew < pData->nNodesExt ); 00153 } 00154 00155 if ( pData->fVerbose ) 00156 printf( "Total single = %3d. Total double = %3d. Total compl = %3d. \n", 00157 p->nDivs1, p->nDivs2, p->nDivs3 ); 00158 00159 // create the new covers 00160 if ( pData->nNodesNew ) 00161 Fxu_CreateCovers( p, pData ); 00162 Fxu_MatrixDelete( p ); 00163 // printf( "Memory usage after deallocation: Total = %d. Peak = %d.\n", s_MemoryTotal, s_MemoryPeak ); 00164 if ( pData->nNodesNew == pData->nNodesExt ) 00165 printf( "Warning: The limit on the number of extracted divisors has been reached.\n" ); 00166 return pData->nNodesNew; 00167 }