ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cutMan.c File Reference
#include "cutInt.h"
Include dependency graph for cutMan.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Npn_StartTruth8 (uint8 uTruths[][32])
 DECLARATIONS ///.
 
Cut_Man_tCut_ManStart (Cut_Params_t *pParams)
 FUNCTION DEFINITIONS ///.
 
void Cut_ManStop (Cut_Man_t *p)
 
void Cut_ManPrintStats (Cut_Man_t *p)
 
void Cut_ManPrintStatsToFile (Cut_Man_t *p, char *pFileName, abctime TimeTotal)
 
void Cut_ManSetFanoutCounts (Cut_Man_t *p, Vec_Int_t *vFanCounts)
 
void Cut_ManSetNodeAttrs (Cut_Man_t *p, Vec_Int_t *vNodeAttrs)
 
int Cut_ManReadVarsMax (Cut_Man_t *p)
 
Cut_Params_tCut_ManReadParams (Cut_Man_t *p)
 
Vec_Int_tCut_ManReadNodeAttrs (Cut_Man_t *p)
 
void Cut_ManIncrementDagNodes (Cut_Man_t *p)
 

Function Documentation

◆ Cut_ManIncrementDagNodes()

void Cut_ManIncrementDagNodes ( Cut_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 309 of file cutMan.c.

310{
311 p->nNodesDag++;
312}
Cube * p
Definition exorList.c:222
Here is the caller graph for this function:

◆ Cut_ManPrintStats()

void Cut_ManPrintStats ( Cut_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 155 of file cutMan.c.

156{
157 if ( p->pReady )
158 {
159 Cut_CutRecycle( p, p->pReady );
160 p->pReady = NULL;
161 }
162 printf( "Cut computation statistics:\n" );
163 printf( "Current cuts = %8d. (Trivial = %d.)\n", p->nCutsCur-p->nCutsTriv, p->nCutsTriv );
164 printf( "Peak cuts = %8d.\n", p->nCutsPeak );
165 printf( "Total allocated = %8d.\n", p->nCutsAlloc );
166 printf( "Total deallocated = %8d.\n", p->nCutsDealloc );
167 printf( "Cuts filtered = %8d.\n", p->nCutsFilter );
168 printf( "Nodes saturated = %8d. (Max cuts = %d.)\n", p->nCutsLimit, p->pParams->nKeepMax );
169 printf( "Cuts per node = %8.1f\n", ((float)(p->nCutsCur-p->nCutsTriv))/p->nNodes );
170 printf( "The cut size = %8d bytes.\n", p->EntrySize );
171 printf( "Peak memory = %8.2f MB.\n", (float)p->nCutsPeak * p->EntrySize / (1<<20) );
172 printf( "Total nodes = %8d.\n", p->nNodes );
173 if ( p->pParams->fDag || p->pParams->fTree )
174 {
175 printf( "DAG nodes = %8d.\n", p->nNodesDag );
176 printf( "Tree nodes = %8d.\n", p->nNodes - p->nNodesDag );
177 }
178 printf( "Nodes w/o cuts = %8d.\n", p->nNodesNoCuts );
179 if ( p->pParams->fMap && !p->pParams->fSeq )
180 printf( "Mapping delay = %8d.\n", p->nDelayMin );
181
182 ABC_PRT( "Merge ", p->timeMerge );
183 ABC_PRT( "Union ", p->timeUnion );
184 ABC_PRT( "Filter", p->timeFilter );
185 ABC_PRT( "Truth ", p->timeTruth );
186 ABC_PRT( "Map ", p->timeMap );
187// printf( "Nodes = %d. Multi = %d. Cuts = %d. Multi = %d.\n",
188// p->nNodes, p->nNodesMulti, p->nCutsCur-p->nCutsTriv, p->nCutsMulti );
189// printf( "Count0 = %d. Count1 = %d. Count2 = %d.\n\n", p->Count0, p->Count1, p->Count2 );
190}
#define ABC_PRT(a, t)
Definition abc_global.h:255
void Cut_CutRecycle(Cut_Man_t *p, Cut_Cut_t *pCut)
Definition cutCut.c:72
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cut_ManPrintStatsToFile()

void Cut_ManPrintStatsToFile ( Cut_Man_t * p,
char * pFileName,
abctime TimeTotal )

Function*************************************************************

Synopsis [Prints some interesting stats.]

Description []

SideEffects []

SeeAlso []

Definition at line 204 of file cutMan.c.

205{
206 FILE * pTable;
207 pTable = fopen( "cut_stats.txt", "a+" );
208 fprintf( pTable, "%-20s ", pFileName );
209 fprintf( pTable, "%8d ", p->nNodes );
210 fprintf( pTable, "%6.1f ", ((float)(p->nCutsCur))/p->nNodes );
211 fprintf( pTable, "%6.2f ", ((float)(100.0 * p->nCutsLimit))/p->nNodes );
212 fprintf( pTable, "%6.2f ", (float)p->nCutsPeak * p->EntrySize / (1<<20) );
213 fprintf( pTable, "%6.2f ", (float)(TimeTotal)/(float)(CLOCKS_PER_SEC) );
214 fprintf( pTable, "\n" );
215 fclose( pTable );
216}

◆ Cut_ManReadNodeAttrs()

Vec_Int_t * Cut_ManReadNodeAttrs ( Cut_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 293 of file cutMan.c.

294{
295 return p->vNodeAttrs;
296}
Here is the caller graph for this function:

◆ Cut_ManReadParams()

Cut_Params_t * Cut_ManReadParams ( Cut_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 277 of file cutMan.c.

278{
279 return p->pParams;
280}
Here is the caller graph for this function:

◆ Cut_ManReadVarsMax()

int Cut_ManReadVarsMax ( Cut_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 261 of file cutMan.c.

262{
263 return p->pParams->nVarsMax;
264}

◆ Cut_ManSetFanoutCounts()

void Cut_ManSetFanoutCounts ( Cut_Man_t * p,
Vec_Int_t * vFanCounts )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 229 of file cutMan.c.

230{
231 p->vFanCounts = vFanCounts;
232}
Here is the caller graph for this function:

◆ Cut_ManSetNodeAttrs()

void Cut_ManSetNodeAttrs ( Cut_Man_t * p,
Vec_Int_t * vNodeAttrs )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 245 of file cutMan.c.

246{
247 p->vNodeAttrs = vNodeAttrs;
248}
Here is the caller graph for this function:

◆ Cut_ManStart()

Cut_Man_t * Cut_ManStart ( Cut_Params_t * pParams)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Starts the cut manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file cutMan.c.

48{
49 Cut_Man_t * p;
50// extern int nTruthDsd;
51// nTruthDsd = 0;
52 assert( pParams->nVarsMax >= 3 && pParams->nVarsMax <= CUT_SIZE_MAX );
53 p = ABC_ALLOC( Cut_Man_t, 1 );
54 memset( p, 0, sizeof(Cut_Man_t) );
55 // set and correct parameters
56 p->pParams = pParams;
57 // prepare storage for cuts
58 p->vCutsNew = Vec_PtrAlloc( pParams->nIdsMax );
59 Vec_PtrFill( p->vCutsNew, pParams->nIdsMax, NULL );
60 // prepare storage for sequential cuts
61 if ( pParams->fSeq )
62 {
63 p->pParams->fFilter = 1;
64 p->vCutsOld = Vec_PtrAlloc( pParams->nIdsMax );
65 Vec_PtrFill( p->vCutsOld, pParams->nIdsMax, NULL );
66 p->vCutsTemp = Vec_PtrAlloc( pParams->nCutSet );
67 Vec_PtrFill( p->vCutsTemp, pParams->nCutSet, NULL );
68 if ( pParams->fTruth && pParams->nVarsMax > 5 )
69 {
70 pParams->fTruth = 0;
71 printf( "Skipping computation of truth tables for sequential cuts with more than 5 inputs.\n" );
72 }
73 }
74 // entry size
75 p->EntrySize = sizeof(Cut_Cut_t) + pParams->nVarsMax * sizeof(int);
76 if ( pParams->fTruth )
77 {
78 if ( pParams->nVarsMax > 14 )
79 {
80 pParams->fTruth = 0;
81 printf( "Skipping computation of truth table for more than %d inputs.\n", 14 );
82 }
83 else
84 {
85 p->nTruthWords = Cut_TruthWords( pParams->nVarsMax );
86 p->EntrySize += p->nTruthWords * sizeof(unsigned);
87 }
88 p->puTemp[0] = ABC_ALLOC( unsigned, 4 * p->nTruthWords );
89 p->puTemp[1] = p->puTemp[0] + p->nTruthWords;
90 p->puTemp[2] = p->puTemp[1] + p->nTruthWords;
91 p->puTemp[3] = p->puTemp[2] + p->nTruthWords;
92 }
93 // enable cut computation recording
94 if ( pParams->fRecord )
95 {
96 p->vNodeCuts = Vec_IntStart( pParams->nIdsMax );
97 p->vNodeStarts = Vec_IntStart( pParams->nIdsMax );
98 p->vCutPairs = Vec_IntAlloc( 0 );
99 }
100 // allocate storage for delays
101 if ( pParams->fMap && !p->pParams->fSeq )
102 {
103 p->vDelays = Vec_IntStart( pParams->nIdsMax );
104 p->vDelays2 = Vec_IntStart( pParams->nIdsMax );
105 p->vCutsMax = Vec_PtrStart( pParams->nIdsMax );
106 }
107 // memory for cuts
108 p->pMmCuts = Extra_MmFixedStart( p->EntrySize );
109 p->vTemp = Vec_PtrAlloc( 100 );
110 return p;
111}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
struct Cut_ManStruct_t_ Cut_Man_t
BASIC TYPES ///.
Definition cut.h:48
#define CUT_SIZE_MAX
Definition cut.h:39
struct Cut_CutStruct_t_ Cut_Cut_t
Definition cut.h:50
Extra_MmFixed_t * Extra_MmFixedStart(int nEntrySize)
#define assert(ex)
Definition util_old.h:213
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cut_ManStop()

void Cut_ManStop ( Cut_Man_t * p)

Function*************************************************************

Synopsis [Stops the cut manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 124 of file cutMan.c.

125{
126 if ( p->vCutsNew ) Vec_PtrFree( p->vCutsNew );
127 if ( p->vCutsOld ) Vec_PtrFree( p->vCutsOld );
128 if ( p->vCutsTemp ) Vec_PtrFree( p->vCutsTemp );
129 if ( p->vFanCounts ) Vec_IntFree( p->vFanCounts );
130 if ( p->vTemp ) Vec_PtrFree( p->vTemp );
131
132 if ( p->vCutsMax ) Vec_PtrFree( p->vCutsMax );
133 if ( p->vDelays ) Vec_IntFree( p->vDelays );
134 if ( p->vDelays2 ) Vec_IntFree( p->vDelays2 );
135 if ( p->vNodeCuts ) Vec_IntFree( p->vNodeCuts );
136 if ( p->vNodeStarts ) Vec_IntFree( p->vNodeStarts );
137 if ( p->vCutPairs ) Vec_IntFree( p->vCutPairs );
138 if ( p->puTemp[0] ) ABC_FREE( p->puTemp[0] );
139
140 Extra_MmFixedStop( p->pMmCuts );
141 ABC_FREE( p );
142}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Extra_MmFixedStop(Extra_MmFixed_t *p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Npn_StartTruth8()

ABC_NAMESPACE_IMPL_START void Npn_StartTruth8 ( uint8 uTruths[][32])
extern

DECLARATIONS ///.

CFile****************************************************************

FileName [cutMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [K-feasible cut computation package.]

Synopsis [Cut manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cutMan.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]