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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Mpm_Man_tMpm_ManStart (Mig_Man_t *pMig, Mpm_Par_t *pPars)
 DECLARATIONS ///.
 
void Mpm_ManStop (Mpm_Man_t *p)
 
void Mpm_ManPrintStatsInit (Mpm_Man_t *p)
 
void Mpm_ManPrintStats (Mpm_Man_t *p)
 

Function Documentation

◆ Mpm_ManPrintStats()

void Mpm_ManPrintStats ( Mpm_Man_t * p)

Definition at line 173 of file mpmMan.c.

174{
175 printf( "Memory usage: Mig = %.2f MB Map = %.2f MB Cut = %.2f MB Total = %.2f MB. ",
176 1.0 * Mig_ManObjNum(p->pMig) * sizeof(Mig_Obj_t) / (1 << 20),
177 1.0 * Mig_ManObjNum(p->pMig) * 48 / (1 << 20),
178 1.0 * Mmr_StepMemory(p->pManCuts) / (1 << 17),
179 1.0 * Mig_ManObjNum(p->pMig) * sizeof(Mig_Obj_t) / (1 << 20) +
180 1.0 * Mig_ManObjNum(p->pMig) * 48 / (1 << 20) +
181 1.0 * Mmr_StepMemory(p->pManCuts) / (1 << 17) );
182 if ( p->timeDerive )
183 {
184 printf( "\n" );
185 p->timeTotal = Abc_Clock() - p->timeTotal;
186 p->timeOther = p->timeTotal - p->timeDerive;
187
188 Abc_Print( 1, "Runtime breakdown:\n" );
189 ABC_PRTP( "Complete cut computation ", p->timeDerive , p->timeTotal );
190 ABC_PRTP( "- Merging cuts ", p->timeMerge , p->timeTotal );
191 ABC_PRTP( "- Evaluating cut parameters ", p->timeEval , p->timeTotal );
192 ABC_PRTP( "- Checking cut containment ", p->timeCompare, p->timeTotal );
193 ABC_PRTP( "- Adding cuts to storage ", p->timeStore , p->timeTotal );
194 ABC_PRTP( "Other ", p->timeOther , p->timeTotal );
195 ABC_PRTP( "TOTAL ", p->timeTotal , p->timeTotal );
196 }
197 else
198 Abc_PrintTime( 1, "Time", Abc_Clock() - p->timeTotal );
199}
#define ABC_PRTP(a, t, T)
Definition abc_global.h:258
Cube * p
Definition exorList.c:222
struct Mig_Obj_t_ Mig_Obj_t
Definition mpmMig.h:54
Here is the caller graph for this function:

◆ Mpm_ManPrintStatsInit()

void Mpm_ManPrintStatsInit ( Mpm_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 166 of file mpmMan.c.

167{
168 printf( "K = %d. C = %d. Cand = %d. XOR = %d. MUX = %d. Choice = %d. CutMin = %d. Truth = %d. DSD = %d.\n",
169 p->nLutSize, p->nNumCuts, Mig_ManCandNum(p->pMig),
170 Mig_ManXorNum(p->pMig), Mig_ManMuxNum(p->pMig), p->pMig->nChoices,
171 p->pPars->fCutMin, p->pPars->fUseTruth, p->pPars->fUseDsd );
172}
int Mig_ManMuxNum(Mig_Man_t *p)
Definition mpmMig.c:106
int Mig_ManXorNum(Mig_Man_t *p)
Definition mpmMig.c:102
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mpm_ManStart()

ABC_NAMESPACE_IMPL_START Mpm_Man_t * Mpm_ManStart ( Mig_Man_t * pMig,
Mpm_Par_t * pPars )

DECLARATIONS ///.

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

FileName [mpm.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Configurable technology mapper.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 1, 2013.]

Revision [

Id
mpm.c,v 1.00 2013/06/01 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file mpmMan.c.

46{
47 Mpm_Man_t * p;
48 int i;
49 assert( sizeof(Mpm_Uni_t) % sizeof(word) == 0 ); // aligned info to word boundary
50 assert( pPars->nNumCuts <= MPM_CUT_MAX );
51 assert( !pPars->fUseTruth || pPars->pLib->LutMax <= 16 );
52 assert( !pPars->fUseDsd || pPars->pLib->LutMax <= 6 );
53 Mig_ManSetRefs( pMig );
54 // alloc
55 p = ABC_CALLOC( Mpm_Man_t, 1 );
56 p->pMig = pMig;
57 p->pPars = pPars;
58 p->pLibLut = pPars->pLib;
59 p->nLutSize = pPars->pLib->LutMax;
60 p->nTruWords = pPars->fUseTruth ? Abc_Truth6WordNum(p->nLutSize) : 0;
61 p->nNumCuts = pPars->nNumCuts;
62 // cuts
63 assert( Mpm_CutWordNum(32) < 32 ); // using 5 bits for word count
64 p->pManCuts = Mmr_StepStart( 13, Abc_Base2Log(Mpm_CutWordNum(p->nLutSize) + 1) );
65 Vec_PtrGrow( &p->vFreeUnits, p->nNumCuts + 1 );
66 for ( i = p->nNumCuts; i >= 0; i-- )
67 Vec_PtrPush( &p->vFreeUnits, p->pCutUnits + i );
68 p->vTemp = Vec_PtrAlloc( 1000 );
69 // mapping attributes
70 Vec_IntFill( &p->vCutBests, Mig_ManObjNum(pMig), 0 );
71 Vec_IntFill( &p->vCutLists, Mig_ManObjNum(pMig), 0 );
72 Vec_IntFill( &p->vMigRefs, Mig_ManObjNum(pMig), 0 );
73 Vec_IntFill( &p->vMapRefs, Mig_ManObjNum(pMig), 0 );
74 Vec_IntFill( &p->vEstRefs, Mig_ManObjNum(pMig), 0 );
75 Vec_IntFill( &p->vRequireds, Mig_ManObjNum(pMig), ABC_INFINITY );
76 Vec_IntFill( &p->vTimes, Mig_ManObjNum(pMig), 0 );
77 Vec_IntFill( &p->vAreas, Mig_ManObjNum(pMig), 0 );
78 Vec_IntFill( &p->vEdges, Mig_ManObjNum(pMig), 0 );
79 // start DSD manager
80 assert( !p->pPars->fUseTruth || !p->pPars->fUseDsd );
81 if ( p->pPars->fUseTruth )
82 {
83 p->vTtMem = Vec_MemAlloc( p->nTruWords, 12 ); // 32 KB/page for 6-var functions
84 Vec_MemHashAlloc( p->vTtMem, 10000 );
85 p->funcCst0 = Vec_MemHashInsert( p->vTtMem, p->Truth );
86 Abc_TtUnit( p->Truth, p->nTruWords, 0 );
87 p->funcVar0 = Vec_MemHashInsert( p->vTtMem, p->Truth );
88 }
89 else if ( p->pPars->fUseDsd )
90 {
92 p->funcVar0 = 1;
93 }
94 // finish
95 p->timeTotal = Abc_Clock();
96 pMig->pMan = p;
97 return p;
98}
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
void Mpm_ManPrecomputePerms(Mpm_Man_t *p)
Definition mpmDsd.c:755
struct Mpm_Uni_t_ Mpm_Uni_t
Definition mpmInt.h:71
struct Mpm_Man_t_ Mpm_Man_t
Definition mpmInt.h:94
#define MPM_CUT_MAX
INCLUDES ///.
Definition mpmInt.h:50
void Mig_ManSetRefs(Mig_Man_t *p)
Definition mpmMig.c:123
void * pMan
Definition mpmMig.h:80
int LutMax
Definition mpm.h:50
int fUseDsd
Definition mpm.h:65
int nNumCuts
Definition mpm.h:61
Mpm_LibLut_t * pLib
Definition mpm.h:59
int fUseTruth
Definition mpm.h:64
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mpm_ManStop()

void Mpm_ManStop ( Mpm_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 111 of file mpmMan.c.

112{
113 if ( p->pPars->fUseTruth && p->pPars->fVeryVerbose )
114 {
115 char * pFileName = "truths.txt";
116 FILE * pFile = fopen( pFileName, "wb" );
117 Vec_MemDump( pFile, p->vTtMem );
118 fclose( pFile );
119 printf( "Dumped %d %d-var truth tables into file \"%s\" (%.2f MB).\n",
120 Vec_MemEntryNum(p->vTtMem), p->nLutSize, pFileName,
121 (16.0 * p->nTruWords + 1.0) * Vec_MemEntryNum(p->vTtMem) / (1 << 20) );
122 }
123 if ( p->pPars->fUseDsd && p->pPars->fVerbose )
125 if ( p->vTtMem )
126 {
127 Vec_MemHashFree( p->vTtMem );
128 Vec_MemFree( p->vTtMem );
129 }
130 if ( p->pHash )
131 {
132 Vec_WrdFree( p->vPerm6 );
133 Vec_IntFree( p->vMap2Perm );
134 Vec_IntFree( p->vConfgRes );
135 Vec_IntFree( p->pHash->vData );
136 Hsh_IntManStop( p->pHash );
137 }
138 Vec_WecFreeP( &p->vNpnConfigs );
139 Vec_PtrFree( p->vTemp );
140 Mmr_StepStop( p->pManCuts );
141 ABC_FREE( p->vFreeUnits.pArray );
142 // mapping attributes
143 ABC_FREE( p->vCutBests.pArray );
144 ABC_FREE( p->vCutLists.pArray );
145 ABC_FREE( p->vMigRefs.pArray );
146 ABC_FREE( p->vMapRefs.pArray );
147 ABC_FREE( p->vEstRefs.pArray );
148 ABC_FREE( p->vRequireds.pArray );
149 ABC_FREE( p->vTimes.pArray );
150 ABC_FREE( p->vAreas.pArray );
151 ABC_FREE( p->vEdges.pArray );
152 ABC_FREE( p );
153}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Mpm_ManPrintDsdStats(Mpm_Man_t *p)
Definition mpmDsd.c:665
Here is the call graph for this function:
Here is the caller graph for this function: