ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mpmInt.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "misc/mem/mem2.h"
#include "misc/vec/vec.h"
#include "misc/vec/vecMem.h"
#include "misc/vec/vecHsh.h"
#include "misc/vec/vecWec.h"
#include "misc/util/utilTruth.h"
#include "mpmMig.h"
#include "mpm.h"
Include dependency graph for mpmInt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Mpm_Cut_t_
 
struct  Mpm_Uni_t_
 
struct  Mpm_Dsd_t_
 
struct  Mpm_Man_t_
 

Macros

#define MPM_CUT_MAX   32
 INCLUDES ///.
 
#define MPM_UNIT_TIME   1
 
#define MPM_UNIT_AREA   20
 
#define MPM_UNIT_EDGE   50
 
#define MPM_UNIT_REFS   100
 
#define Mpm_ObjForEachCut(p, pObj, hCut, pCut)
 
#define Mpm_ObjForEachCutSafe(p, pObj, hCut, pCut, hNext)
 
#define Mpm_CutForEachLeafId(pCut, iLeafId, i)
 
#define Mpm_CutForEachLeafLit(pCut, iLeafLit, i)
 
#define Mpm_CutForEachLeaf(p, pCut, pLeaf, i)
 

Typedefs

typedef struct Mpm_Cut_t_ Mpm_Cut_t
 BASIC TYPES ///.
 
typedef struct Mpm_Uni_t_ Mpm_Uni_t
 
typedef struct Mpm_Dsd_t_ Mpm_Dsd_t
 
typedef struct Mpm_Man_t_ Mpm_Man_t
 

Functions

Mig_Man_tMig_ManCreate (void *pGia)
 FUNCTION DECLARATIONS ///.
 
void * Mpm_ManFromIfLogic (Mpm_Man_t *pMan)
 
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)
 
void Mpm_ManPrintDsdStats (Mpm_Man_t *p)
 
void Mpm_ManPrintPerm (unsigned s)
 
void Mpm_ManPrecomputePerms (Mpm_Man_t *p)
 
word Mpm_CutTruthFromDsd (Mpm_Man_t *pMan, Mpm_Cut_t *pCut, int iDsdLit)
 
int Mpm_CutCheckDsd6 (Mpm_Man_t *p, word t)
 
int Mpm_CutComputeDsd6 (Mpm_Man_t *p, Mpm_Cut_t *pCut, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, int Type)
 
Vec_Wec_tMpm_ManFindDsdMatches (Mpm_Man_t *p, void *pScl)
 DECLARATIONS ///.
 
Mpm_LibLut_tMpm_LibLutSetSimple (int nLutSize)
 DECLARATIONS ///.
 
void Mpm_LibLutFree (Mpm_LibLut_t *pLib)
 
void Mpm_CutPrint (Mpm_Cut_t *pCut)
 
void Mpm_ManPrepare (Mpm_Man_t *p)
 
void Mpm_ManPerform (Mpm_Man_t *p)
 
int Mpm_CutComputeTruth (Mpm_Man_t *p, Mpm_Cut_t *pCut, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, int Type)
 
void Kit_DsdPrintFromTruth (unsigned *pTruth, int nVars)
 

Macro Definition Documentation

◆ MPM_CUT_MAX

#define MPM_CUT_MAX   32

INCLUDES ///.

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

FileName [mpmInt.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Configurable technology mapper.]

Synopsis [Interal declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id
mpmInt.h,v 1.00 2013/06/01 00:00:00 alanmi Exp

] PARAMETERS ///

Definition at line 50 of file mpmInt.h.

◆ Mpm_CutForEachLeaf

#define Mpm_CutForEachLeaf ( p,
pCut,
pLeaf,
i )
Value:
for ( i = 0; i < (int)pCut->nLeaves && (pLeaf = Mig_ManObj(p, Abc_Lit2Var(pCut->pLeaves[i]))); i++ )
Cube * p
Definition exorList.c:222

Definition at line 222 of file mpmInt.h.

222#define Mpm_CutForEachLeaf( p, pCut, pLeaf, i ) \
223 for ( i = 0; i < (int)pCut->nLeaves && (pLeaf = Mig_ManObj(p, Abc_Lit2Var(pCut->pLeaves[i]))); i++ )

◆ Mpm_CutForEachLeafId

#define Mpm_CutForEachLeafId ( pCut,
iLeafId,
i )
Value:
for ( i = 0; i < (int)pCut->nLeaves && ((iLeafId = Abc_Lit2Var(pCut->pLeaves[i])), 1); i++ )

Definition at line 218 of file mpmInt.h.

218#define Mpm_CutForEachLeafId( pCut, iLeafId, i ) \
219 for ( i = 0; i < (int)pCut->nLeaves && ((iLeafId = Abc_Lit2Var(pCut->pLeaves[i])), 1); i++ )

◆ Mpm_CutForEachLeafLit

#define Mpm_CutForEachLeafLit ( pCut,
iLeafLit,
i )
Value:
for ( i = 0; i < (int)pCut->nLeaves && ((iLeafLit = pCut->pLeaves[i]), 1); i++ )

Definition at line 220 of file mpmInt.h.

220#define Mpm_CutForEachLeafLit( pCut, iLeafLit, i ) \
221 for ( i = 0; i < (int)pCut->nLeaves && ((iLeafLit = pCut->pLeaves[i]), 1); i++ )

◆ Mpm_ObjForEachCut

#define Mpm_ObjForEachCut ( p,
pObj,
hCut,
pCut )
Value:
for ( hCut = Mpm_ObjCutList(p, pObj); hCut && (pCut = Mpm_CutFetch(p, hCut)); hCut = pCut->hNext )

Definition at line 212 of file mpmInt.h.

212#define Mpm_ObjForEachCut( p, pObj, hCut, pCut ) \
213 for ( hCut = Mpm_ObjCutList(p, pObj); hCut && (pCut = Mpm_CutFetch(p, hCut)); hCut = pCut->hNext )

◆ Mpm_ObjForEachCutSafe

#define Mpm_ObjForEachCutSafe ( p,
pObj,
hCut,
pCut,
hNext )
Value:
for ( hCut = Mpm_ObjCutList(p, pObj); hCut && (pCut = Mpm_CutFetch(p, hCut)) && ((hNext = pCut->hNext), 1); hCut = hNext )

Definition at line 214 of file mpmInt.h.

214#define Mpm_ObjForEachCutSafe( p, pObj, hCut, pCut, hNext ) \
215 for ( hCut = Mpm_ObjCutList(p, pObj); hCut && (pCut = Mpm_CutFetch(p, hCut)) && ((hNext = pCut->hNext), 1); hCut = hNext )

◆ MPM_UNIT_AREA

#define MPM_UNIT_AREA   20

Definition at line 53 of file mpmInt.h.

◆ MPM_UNIT_EDGE

#define MPM_UNIT_EDGE   50

Definition at line 54 of file mpmInt.h.

◆ MPM_UNIT_REFS

#define MPM_UNIT_REFS   100

Definition at line 55 of file mpmInt.h.

◆ MPM_UNIT_TIME

#define MPM_UNIT_TIME   1

Definition at line 52 of file mpmInt.h.

Typedef Documentation

◆ Mpm_Cut_t

typedef struct Mpm_Cut_t_ Mpm_Cut_t

BASIC TYPES ///.

Definition at line 61 of file mpmInt.h.

◆ Mpm_Dsd_t

typedef struct Mpm_Dsd_t_ Mpm_Dsd_t

Definition at line 84 of file mpmInt.h.

◆ Mpm_Man_t

typedef struct Mpm_Man_t_ Mpm_Man_t

Definition at line 94 of file mpmInt.h.

◆ Mpm_Uni_t

typedef struct Mpm_Uni_t_ Mpm_Uni_t

Definition at line 71 of file mpmInt.h.

Function Documentation

◆ Kit_DsdPrintFromTruth()

void Kit_DsdPrintFromTruth ( unsigned * pTruth,
int nVars )
extern

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

Synopsis [Print the DSD formula.]

Description []

SideEffects []

SeeAlso []

Definition at line 491 of file kitDsd.c.

492{
493 Kit_DsdNtk_t * pTemp, * pTemp2;
494// pTemp = Kit_DsdDecomposeMux( pTruth, nVars, 5 );
495 pTemp = Kit_DsdDecomposeMux( pTruth, nVars, 8 );
496// Kit_DsdPrintExpanded( pTemp );
497 pTemp2 = Kit_DsdExpand( pTemp );
498 Kit_DsdPrint( stdout, pTemp2 );
499 Kit_DsdVerify( pTemp2, pTruth, nVars );
500 Kit_DsdNtkFree( pTemp2 );
501 Kit_DsdNtkFree( pTemp );
502}
void Kit_DsdVerify(Kit_DsdNtk_t *pNtk, unsigned *pTruth, int nVars)
Definition kitDsd.c:2493
void Kit_DsdPrint(FILE *pFile, Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:375
void Kit_DsdNtkFree(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:164
Kit_DsdNtk_t * Kit_DsdDecomposeMux(unsigned *pTruth, int nVars, int nDecMux)
Definition kitDsd.c:2351
Kit_DsdNtk_t * Kit_DsdExpand(Kit_DsdNtk_t *p)
Definition kitDsd.c:1452
struct Kit_DsdNtk_t_ Kit_DsdNtk_t
Definition kit.h:124

◆ Mig_ManCreate()

Mig_Man_t * Mig_ManCreate ( void * pGia)
extern

FUNCTION DECLARATIONS ///.

Definition at line 83 of file mpmAbc.c.

84{
85 Gia_Man_t * p = (Gia_Man_t *)pGia;
86 Mig_Man_t * pNew;
87 Gia_Obj_t * pObj;
88 int i;
89 pNew = Mig_ManStart();
90 pNew->pName = Abc_UtilStrsav( p->pName );
91 Gia_ManConst0(p)->Value = 0;
92 Gia_ManForEachObj1( p, pObj, i )
93 {
94 if ( Gia_ObjIsMuxId(p, i) )
95 pObj->Value = Mig_ManAppendMux( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj), Gia_ObjFanin2Copy(p, pObj) );
96 else if ( Gia_ObjIsXor(pObj) )
97 pObj->Value = Mig_ManAppendXor( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
98 else if ( Gia_ObjIsAnd(pObj) )
99 pObj->Value = Mig_ManAppendAnd( pNew, Mig_ObjFanin0Copy(pObj), Mig_ObjFanin1Copy(pObj) );
100 else if ( Gia_ObjIsCi(pObj) )
101 pObj->Value = Mig_ManAppendCi( pNew );
102 else if ( Gia_ObjIsCo(pObj) )
103 pObj->Value = Mig_ManAppendCo( pNew, Mig_ObjFanin0Copy(pObj) );
104 else assert( 0 );
105 }
106 Mig_ManSetRegNum( pNew, Gia_ManRegNum(p) );
107 if ( Gia_ManHasChoices(p) )
108 Mig_ManCreateChoices( pNew, p );
109 return pNew;
110}
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
#define Gia_ManForEachObj1(p, pObj, i)
Definition gia.h:1192
ABC_NAMESPACE_IMPL_START void Mig_ManCreateChoices(Mig_Man_t *pMig, Gia_Man_t *p)
DECLARATIONS ///.
Definition mpmAbc.c:46
ABC_NAMESPACE_IMPL_START Mig_Man_t * Mig_ManStart()
DECLARATIONS ///.
Definition mpmMig.c:45
struct Mig_Man_t_ Mig_Man_t
Definition mpmMig.h:60
unsigned Value
Definition gia.h:89
char * pName
Definition mpmMig.h:63
#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_CutCheckDsd6()

int Mpm_CutCheckDsd6 ( Mpm_Man_t * p,
word t )
extern

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

Synopsis [Checks hash table for DSD class.]

Description []

SideEffects []

SeeAlso []

Definition at line 905 of file mpmDsd.c.

906{
907 int fCompl, Entry, Config;
908 if ( (fCompl = (t & 1)) )
909 t = ~t;
910 Entry = *Hsh_IntManLookup( p->pHash, (unsigned *)&t );
911 if ( Entry == -1 )
912 return -1;
913 Config = Vec_IntEntry( p->vConfgRes, Entry );
914 if ( fCompl )
915 Config ^= (1 << 16);
916 return Config;
917}
Here is the caller graph for this function:

◆ Mpm_CutComputeDsd6()

int Mpm_CutComputeDsd6 ( Mpm_Man_t * p,
Mpm_Cut_t * pCut,
Mpm_Cut_t * pCut0,
Mpm_Cut_t * pCut1,
Mpm_Cut_t * pCutC,
int fCompl0,
int fCompl1,
int fComplC,
int Type )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 930 of file mpmDsd.c.

931{
932 int fVerbose = 0;
933 int i, Config, iClass, fCompl;
934 int pLeavesNew[6] = { -1, -1, -1, -1, -1, -1 };
935 word t = 0;
936 if ( pCutC == NULL )
937 {
938 word t0, t1;
939 int iClass0 = Abc_Lit2Var(pCut0->iFunc);
940 int iClass1 = Abc_Lit2Var(pCut1->iFunc);
941 word Truth0 = p->pDsd6[iClass0].uTruth;
942 int Perm1 = Vec_IntEntry( p->vMap2Perm, p->uPermMask[1] );
943 word Truth1p = Vec_WrdEntry( p->vPerm6, iClass1 * 720 + Perm1 );
944 if ( p->uComplMask[1] )
945 {
946 for ( i = 0; i < 6; i++ )
947 if ( (p->uComplMask[1] >> i) & 1 )
948 Truth1p = Abc_Tt6Flip( Truth1p, i );
949 }
950 t0 = (fCompl0 ^ pCut0->fCompl ^ Abc_LitIsCompl(pCut0->iFunc)) ? ~Truth0 : Truth0;
951 t1 = (fCompl1 ^ pCut1->fCompl ^ Abc_LitIsCompl(pCut1->iFunc)) ? ~Truth1p : Truth1p;
952 if ( Type == 1 )
953 t = t0 & t1;
954 else if ( Type == 2 )
955 t = t0 ^ t1;
956 else assert( 0 );
957
958if ( fVerbose )
959{
960Mpm_ManPrintPerm( p->uPermMask[1] ); printf( "\n" );
961Kit_DsdPrintFromTruth( (unsigned *)&Truth0, 6 ); printf( "\n" );
962Kit_DsdPrintFromTruth( (unsigned *)&Truth1p, 6 ); printf( "\n" );
963Kit_DsdPrintFromTruth( (unsigned *)&t, 6 ); printf( "\n" );
964}
965 }
966 else
967 {
968 word t0, t1, tC;
969 int iClass0 = Abc_Lit2Var(pCut0->iFunc);
970 int iClass1 = Abc_Lit2Var(pCut1->iFunc);
971 int iClassC = Abc_Lit2Var(pCutC->iFunc);
972 word Truth0 = p->pDsd6[iClass0].uTruth;
973 int Perm1 = Vec_IntEntry( p->vMap2Perm, p->uPermMask[1] );
974 int PermC = Vec_IntEntry( p->vMap2Perm, p->uPermMask[2] );
975 word Truth1p = Vec_WrdEntry( p->vPerm6, iClass1 * 720 + Perm1 );
976 word TruthCp = Vec_WrdEntry( p->vPerm6, iClassC * 720 + PermC );
977 if ( p->uComplMask[1] )
978 {
979 for ( i = 0; i < 6; i++ )
980 if ( (p->uComplMask[1] >> i) & 1 )
981 Truth1p = Abc_Tt6Flip( Truth1p, i );
982 }
983 if ( p->uComplMask[2] )
984 {
985 for ( i = 0; i < 6; i++ )
986 if ( (p->uComplMask[2] >> i) & 1 )
987 TruthCp = Abc_Tt6Flip( TruthCp, i );
988 }
989 t0 = (fCompl0 ^ pCut0->fCompl ^ Abc_LitIsCompl(pCut0->iFunc)) ? ~Truth0 : Truth0;
990 t1 = (fCompl1 ^ pCut1->fCompl ^ Abc_LitIsCompl(pCut1->iFunc)) ? ~Truth1p : Truth1p;
991 tC = (fComplC ^ pCutC->fCompl ^ Abc_LitIsCompl(pCutC->iFunc)) ? ~TruthCp : TruthCp;
992 t = (tC & t1) | (~tC & t0);
993 }
994
995 // find configuration
996 Config = Mpm_CutCheckDsd6( p, t );
997 if ( Config == -1 )
998 {
999 p->nNonDsd++;
1000 return 0;
1001 }
1002
1003 // get the class
1004 iClass = Config >> 17;
1005 fCompl = (Config >> 16) & 1;
1006 Config &= 0xFFFF;
1007
1008 // check if the gate exists
1009 if ( p->pPars->fMap4Gates )
1010 {
1011 if ( Vec_IntSize(Vec_WecEntry(p->vNpnConfigs, iClass)) == 0 )
1012 {
1013 p->nNoMatch++;
1014 return 0;
1015 }
1016 }
1017
1018 // set the function
1019 pCut->iFunc = Abc_Var2Lit( iClass, fCompl );
1020
1021if ( fVerbose )
1022{
1023Mpm_CutPrint( pCut0 );
1024Mpm_CutPrint( pCut1 );
1025Mpm_CutPrint( pCut );
1026}
1027
1028 // update cut
1029 assert( (Config >> 6) < 720 );
1030 for ( i = 0; i < (int)pCut->nLeaves; i++ )
1031 pLeavesNew[(int)(p->Perm6[Config >> 6][i])] = Abc_LitNotCond( pCut->pLeaves[i], (Config >> i) & 1 );
1032 pCut->nLeaves = p->pDsd6[iClass].nVars;
1033 for ( i = 0; i < (int)pCut->nLeaves; i++ )
1034 assert( pLeavesNew[i] != -1 );
1035 for ( i = 0; i < (int)pCut->nLeaves; i++ )
1036 pCut->pLeaves[i] = pLeavesNew[i];
1037 p->nCountDsd[iClass]++;
1038 p->nSmallSupp += (int)(pCut->nLeaves < 2);
1039
1040if ( fVerbose )
1041{
1042printf( "Computed " );
1043Mpm_CutPrint( pCut );
1044printf( "\n" );
1045}
1046 return 1;
1047}
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
Definition kitDsd.c:491
int Mpm_CutCheckDsd6(Mpm_Man_t *p, word t)
Definition mpmDsd.c:905
void Mpm_ManPrintPerm(unsigned s)
Definition mpmDsd.c:736
void Mpm_CutPrint(Mpm_Cut_t *pCut)
Definition mpmMap.c:103
unsigned fCompl
Definition mpmInt.h:66
unsigned nLeaves
Definition mpmInt.h:68
int pLeaves[1]
Definition mpmInt.h:69
unsigned iFunc
Definition mpmInt.h:65
Here is the call graph for this function:

◆ Mpm_CutComputeTruth()

int Mpm_CutComputeTruth ( Mpm_Man_t * p,
Mpm_Cut_t * pCut,
Mpm_Cut_t * pCut0,
Mpm_Cut_t * pCut1,
Mpm_Cut_t * pCutC,
int fCompl0,
int fCompl1,
int fComplC,
int Type )
extern

Definition at line 215 of file mpmTruth.c.

216{
217 int RetValue;
218 if ( p->nLutSize <= 6 )
219 RetValue = Mpm_CutComputeTruth6( p, pCut, pCut0, pCut1, pCutC, fCompl0, fCompl1, fComplC, Type );
220 else
221 RetValue = Mpm_CutComputeTruth7( p, pCut, pCut0, pCut1, pCutC, fCompl0, fCompl1, fComplC, Type );
222#ifdef MPM_TRY_NEW
223 {
224 extern unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPerm );
225 char pCanonPerm[16];
226 memcpy( p->Truth0, p->Truth, sizeof(word) * p->nTruWords );
227 Abc_TtCanonicize( p->Truth0, pCut->nLimit, pCanonPerm );
228 }
229#endif
230 return RetValue;
231}
unsigned Abc_TtCanonicize(word *pTruth, int nVars, char *pCanonPerm)
FUNCTION DECLARATIONS ///.
Definition dauCanon.c:1036
char * memcpy()
Here is the call graph for this function:

◆ Mpm_CutPrint()

void Mpm_CutPrint ( Mpm_Cut_t * pCut)
extern

Definition at line 103 of file mpmMap.c.

104{
105 int i;
106 printf( "%d : { ", pCut->nLeaves );
107 for ( i = 0; i < (int)pCut->nLeaves; i++ )
108 printf( "%d ", pCut->pLeaves[i] );
109 printf( "}\n" );
110}
Here is the caller graph for this function:

◆ Mpm_CutTruthFromDsd()

word Mpm_CutTruthFromDsd ( Mpm_Man_t * pMan,
Mpm_Cut_t * pCut,
int iClass )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 883 of file mpmDsd.c.

884{
885 int i;
886 word uTruth = pMan->pDsd6[iClass].uTruth;
887 assert( pMan->pDsd6[iClass].nVars == (int)pCut->nLeaves );
888 for ( i = 0; i < (int)pCut->nLeaves; i++ )
889 if ( Abc_LitIsCompl(pCut->pLeaves[i]) )
890 uTruth = Abc_Tt6Flip( uTruth, i );
891 return uTruth;
892}
word uTruth
Definition mpmInt.h:90
int nVars
Definition mpmInt.h:87
Mpm_Dsd_t * pDsd6
Definition mpmInt.h:132
Here is the caller graph for this function:

◆ Mpm_LibLutFree()

void Mpm_LibLutFree ( Mpm_LibLut_t * pLib)
extern

Definition at line 60 of file mpmLib.c.

61{
62 if ( pLib == NULL )
63 return;
64 ABC_FREE( pLib->pName );
65 ABC_FREE( pLib );
66}
#define ABC_FREE(obj)
Definition abc_global.h:267
char * pName
Definition mpm.h:49

◆ Mpm_LibLutSetSimple()

Mpm_LibLut_t * Mpm_LibLutSetSimple ( int nLutSize)
extern

DECLARATIONS ///.

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

FileName [mpmLib.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Configurable technology mapper.]

Synopsis [DSD manipulation for 6-input functions.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id
mpmLib.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 mpmLib.c.

46{
47 Mpm_LibLut_t * pLib;
48 int i, k;
49 assert( nLutSize <= MPM_VAR_MAX );
50 pLib = ABC_CALLOC( Mpm_LibLut_t, 1 );
51 pLib->LutMax = nLutSize;
52 for ( i = 1; i <= pLib->LutMax; i++ )
53 {
54 pLib->pLutAreas[i] = MPM_UNIT_AREA;
55 for ( k = 0; k < i; k++ )
56 pLib->pLutDelays[i][k] = MPM_UNIT_TIME;
57 }
58 return pLib;
59}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define MPM_UNIT_TIME
Definition mpmInt.h:52
#define MPM_UNIT_AREA
Definition mpmInt.h:53
#define MPM_VAR_MAX
INCLUDES ///.
Definition mpm.h:40
struct Mpm_LibLut_t_ Mpm_LibLut_t
BASIC TYPES ///.
Definition mpm.h:46
int pLutAreas[MPM_VAR_MAX+1]
Definition mpm.h:52
int pLutDelays[MPM_VAR_MAX+1][MPM_VAR_MAX+1]
Definition mpm.h:53
int LutMax
Definition mpm.h:50

◆ Mpm_ManFindDsdMatches()

Vec_Wec_t * Mpm_ManFindDsdMatches ( Mpm_Man_t * p,
void * pScl )
extern

DECLARATIONS ///.

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

FileName [mpmGates.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Configurable technology mapper.]

Synopsis [Standard-cell mapping.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Finds matches fore each DSD class.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file mpmGates.c.

50{
51 int fVerbose = p->pPars->fVeryVerbose;
52 SC_Lib * pLib = (SC_Lib *)pScl;
53 Vec_Wec_t * vClasses;
54 Vec_Int_t * vClass;
55 SC_Cell * pRepr;
56 int i, Config, iClass;
57 word Truth;
58 vClasses = Vec_WecStart( 600 );
59 SC_LibForEachCellClass( pLib, pRepr, i )
60 {
61 if ( pRepr->n_inputs > 6 || pRepr->n_outputs > 1 )
62 {
63 if ( fVerbose )
64 printf( "Skipping cell %s with %d inputs and %d outputs\n", pRepr->pName, pRepr->n_inputs, pRepr->n_outputs );
65 continue;
66 }
67 Truth = *Vec_WrdArray( &SC_CellPin(pRepr, pRepr->n_inputs)->vFunc );
68 Config = Mpm_CutCheckDsd6( p, Truth );
69 if ( Config == -1 )
70 {
71 if ( fVerbose )
72 printf( "Skipping cell %s with non-DSD function\n", pRepr->pName );
73 continue;
74 }
75 iClass = Config >> 17;
76 Config = (pRepr->Id << 17) | (Config & 0x1FFFF);
77 // write gate and NPN config for this DSD class
78 vClass = Vec_WecEntry( vClasses, iClass );
79 Vec_IntPush( vClass, Config );
80 if ( !fVerbose )
81 continue;
82
83 printf( "Gate %5d %-30s : ", pRepr->Id, pRepr->pName );
84 printf( "Class %3d ", iClass );
85 printf( "Area %10.3f ", pRepr->area );
86 Extra_PrintBinary( stdout, (unsigned *)&Config, 17 );
87 printf( " " );
88 Kit_DsdPrintFromTruth( (unsigned *)&Truth, pRepr->n_inputs ); printf( "\n" );
89 }
90 return vClasses;
91}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
struct SC_Lib_ SC_Lib
Definition sclLib.h:128
struct SC_Cell_ SC_Cell
Definition sclLib.h:127
#define SC_LibForEachCellClass(p, pCell, i)
Definition sclLib.h:270
float area
Definition sclLib.h:207
int n_outputs
Definition sclLib.h:214
char * pName
Definition sclLib.h:202
int n_inputs
Definition sclLib.h:213
int Id
Definition sclLib.h:203
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition vecWec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mpm_ManFromIfLogic()

void * Mpm_ManFromIfLogic ( Mpm_Man_t * pMan)
extern

Definition at line 213 of file mpmAbc.c.

214{
215 Gia_Man_t * pNew;
216 Mpm_Cut_t * pCutBest;
217 Mig_Obj_t * pObj, * pFanin;
218 Vec_Int_t * vMapping, * vMapping2, * vPacking = NULL;
219 Vec_Int_t * vLeaves, * vLeaves2, * vCover;
220 word uTruth, * pTruth = &uTruth;
221 int i, k, Entry, iLitNew = 0;
222// assert( !pMan->pPars->fDeriveLuts || pMan->pPars->fTruth );
223 // start mapping and packing
224 vMapping = Vec_IntStart( Mig_ManObjNum(pMan->pMig) );
225 vMapping2 = Vec_IntStart( 1 );
226 if ( 0 ) // pMan->pPars->fDeriveLuts && pMan->pPars->pLutStruct )
227 {
228 vPacking = Vec_IntAlloc( 1000 );
229 Vec_IntPush( vPacking, 0 );
230 }
231 // create new manager
232 pNew = Gia_ManStart( Mig_ManObjNum(pMan->pMig) );
233 // iterate through nodes used in the mapping
234 vCover = Vec_IntAlloc( 1 << 16 );
235 vLeaves = Vec_IntAlloc( 16 );
236 vLeaves2 = Vec_IntAlloc( 16 );
237 Mig_ManCleanCopy( pMan->pMig );
238 Mig_ManForEachObj( pMan->pMig, pObj )
239 {
240 if ( !Mpm_ObjMapRef(pMan, pObj) && !Mig_ObjIsTerm(pObj) )
241 continue;
242 if ( Mig_ObjIsNode(pObj) )
243 {
244 // collect leaves of the best cut
245 Vec_IntClear( vLeaves );
246 pCutBest = Mpm_ObjCutBestP( pMan, pObj );
247 Mpm_CutForEachLeaf( pMan->pMig, pCutBest, pFanin, k )
248 Vec_IntPush( vLeaves, Mig_ObjCopy(pFanin) );
249 if ( pMan->pPars->fDeriveLuts && (pMan->pPars->fUseTruth || pMan->pPars->fUseDsd) )
250 {
251 extern int Gia_ManFromIfLogicNode( void * p, Gia_Man_t * pNew, int iObj, Vec_Int_t * vLeaves, Vec_Int_t * vLeavesTemp,
252 word * pRes, char * pStr, Vec_Int_t * vCover, Vec_Int_t * vMapping, Vec_Int_t * vMapping2, Vec_Int_t * vPacking, int fCheck75, int fCheck44e );
253 if ( pMan->pPars->fUseTruth )
254 pTruth = Mpm_CutTruth(pMan, Abc_Lit2Var(pCutBest->iFunc));
255 else
256 uTruth = Mpm_CutTruthFromDsd( pMan, pCutBest, Abc_Lit2Var(pCutBest->iFunc) );
257// Kit_DsdPrintFromTruth( pTruth, Vec_IntSize(vLeaves) ); printf( "\n" );
258 // perform decomposition of the cut
259 iLitNew = Gia_ManFromIfLogicNode( NULL, pNew, Mig_ObjId(pObj), vLeaves, vLeaves2, pTruth, NULL, vCover, vMapping, vMapping2, vPacking, 0, 0 );
260 iLitNew = Abc_LitNotCond( iLitNew, pCutBest->fCompl ^ Abc_LitIsCompl(pCutBest->iFunc) );
261 }
262 else
263 {
264 // perform one of the two types of mapping: with and without structures
265 iLitNew = Mpm_ManNodeIfToGia( pNew, pMan, pObj, vLeaves, 0 );
266 // write mapping
267 Vec_IntSetEntry( vMapping, Abc_Lit2Var(iLitNew), Vec_IntSize(vMapping2) );
268 Vec_IntPush( vMapping2, Vec_IntSize(vLeaves) );
269 Vec_IntForEachEntry( vLeaves, Entry, k )
270 assert( Abc_Lit2Var(Entry) < Abc_Lit2Var(iLitNew) );
271 Vec_IntForEachEntry( vLeaves, Entry, k )
272 Vec_IntPush( vMapping2, Abc_Lit2Var(Entry) );
273 Vec_IntPush( vMapping2, Abc_Lit2Var(iLitNew) );
274 }
275 }
276 else if ( Mig_ObjIsCi(pObj) )
277 iLitNew = Gia_ManAppendCi(pNew);
278 else if ( Mig_ObjIsCo(pObj) )
279 iLitNew = Gia_ManAppendCo( pNew, Abc_LitNotCond(Mig_ObjCopy(Mig_ObjFanin0(pObj)), Mig_ObjFaninC0(pObj)) );
280 else if ( Mig_ObjIsConst0(pObj) )
281 {
282 iLitNew = 0;
283 // create const LUT
284 Vec_IntWriteEntry( vMapping, 0, Vec_IntSize(vMapping2) );
285 Vec_IntPush( vMapping2, 0 );
286 Vec_IntPush( vMapping2, 0 );
287 }
288 else assert( 0 );
289 Mig_ObjSetCopy( pObj, iLitNew );
290 }
291 Vec_IntFree( vCover );
292 Vec_IntFree( vLeaves );
293 Vec_IntFree( vLeaves2 );
294// printf( "Mapping array size: IfMan = %d. Gia = %d. Increase = %.2f\n",
295// Mig_ManObjNum(pMan), Gia_ManObjNum(pNew), 1.0 * Gia_ManObjNum(pNew) / Mig_ManObjNum(pMan) );
296 // finish mapping
297 if ( Vec_IntSize(vMapping) > Gia_ManObjNum(pNew) )
298 Vec_IntShrink( vMapping, Gia_ManObjNum(pNew) );
299 else
300 Vec_IntFillExtra( vMapping, Gia_ManObjNum(pNew), 0 );
301 assert( Vec_IntSize(vMapping) == Gia_ManObjNum(pNew) );
302 Vec_IntForEachEntry( vMapping, Entry, i )
303 if ( Entry > 0 )
304 Vec_IntAddToEntry( vMapping, i, Gia_ManObjNum(pNew) );
305 Vec_IntAppend( vMapping, vMapping2 );
306 Vec_IntFree( vMapping2 );
307 // attach mapping and packing
308 assert( pNew->vMapping == NULL );
309 assert( pNew->vPacking == NULL );
310 pNew->vMapping = vMapping;
311 pNew->vPacking = vPacking;
312 // verify that COs have mapping
313 {
314 Gia_Obj_t * pObj;
315 Gia_ManForEachCo( pNew, pObj, i )
316 assert( !Gia_ObjIsAnd(Gia_ObjFanin0(pObj)) || Gia_ObjIsLut(pNew, Gia_ObjFaninId0p(pNew, pObj)) );
317 }
318 return pNew;
319}
int Gia_ManFromIfLogicNode(void *pIfMan, Gia_Man_t *pNew, int iObj, Vec_Int_t *vLeaves, Vec_Int_t *vLeavesTemp, word *pRes, char *pStr, Vec_Int_t *vCover, Vec_Int_t *vMapping, Vec_Int_t *vMapping2, Vec_Int_t *vPacking, int fCheck75, int fCheck44e)
Definition giaIf.c:1189
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
#define Gia_ManForEachCo(p, pObj, i)
Definition gia.h:1236
int Mpm_ManNodeIfToGia(Gia_Man_t *pNew, Mpm_Man_t *pMan, Mig_Obj_t *pObj, Vec_Int_t *vLeaves, int fHash)
Definition mpmAbc.c:187
word Mpm_CutTruthFromDsd(Mpm_Man_t *pMan, Mpm_Cut_t *pCut, int iClass)
Definition mpmDsd.c:883
#define Mpm_CutForEachLeaf(p, pCut, pLeaf, i)
Definition mpmInt.h:222
struct Mpm_Cut_t_ Mpm_Cut_t
BASIC TYPES ///.
Definition mpmInt.h:61
struct Mig_Obj_t_ Mig_Obj_t
Definition mpmMig.h:54
#define Mig_ManForEachObj(p, pObj)
MACRO DEFINITIONS ///.
Definition mpmMig.h:304
Vec_Int_t * vPacking
Definition gia.h:141
Vec_Int_t * vMapping
Definition gia.h:136
Mig_Man_t * pMig
Definition mpmInt.h:97
Mpm_Par_t * pPars
Definition mpmInt.h:98
int fUseDsd
Definition mpm.h:65
int fUseTruth
Definition mpm.h:64
int fDeriveLuts
Definition mpm.h:68
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mpm_ManPerform()

void Mpm_ManPerform ( Mpm_Man_t * p)
extern

Definition at line 833 of file mpmMap.c.

834{
835 if ( p->pPars->fMap4Cnf )
836 {
837 p->pCutCmp = Mpm_CutCompareArea;
839 }
840 else
841 {
842 p->pCutCmp = Mpm_CutCompareDelay;
844 if ( p->pPars->fOneRound )
845 return;
846
847 p->pCutCmp = Mpm_CutCompareDelay2;
849
850 p->pCutCmp = Mpm_CutCompareArea;
852
853 p->fMainRun = 1;
854
855 p->pCutCmp = Mpm_CutCompareArea;
856 Mpm_ManComputeEstRefs( p );
858
859 p->pCutCmp = Mpm_CutCompareArea2;
860 Mpm_ManComputeEstRefs( p );
862 }
863}
void Mpm_ManPerformRound(Mpm_Man_t *p)
Definition mpmMap.c:807
int Mpm_CutCompareDelay2(Mpm_Uni_t *pOld, Mpm_Uni_t *pNew)
Definition mpmMap.c:756
int Mpm_CutCompareDelay(Mpm_Uni_t *pOld, Mpm_Uni_t *pNew)
Definition mpmMap.c:748
int Mpm_CutCompareArea(Mpm_Uni_t *pOld, Mpm_Uni_t *pNew)
Definition mpmMap.c:764
int Mpm_CutCompareArea2(Mpm_Uni_t *pOld, Mpm_Uni_t *pNew)
Definition mpmMap.c:773
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mpm_ManPrecomputePerms()

void Mpm_ManPrecomputePerms ( Mpm_Man_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 755 of file mpmDsd.c.

756{
757 int nVars = 6;
758 // 0(1:1) 1(2:1) 2(4:2) 3(10:6) 4(33:23) 5(131:98) 6(595:464)
759 int nClasses[7] = { 1, 2, 4, 10, 33, 131, 595 };
760 int nPerms = Extra_Factorial( nVars );
761// int nSwaps = (1 << nVars);
762 int * pComp, * pPerm;
763 int i, k, x, One, OneCopy, Num;
764 Vec_Int_t * vVars;
765 abctime clk = Abc_Clock();
766 assert( p->pDsd6 == NULL );
767 p->pDsd6 = s_DsdClass6;
768 // precompute schedules
769 pComp = Extra_GreyCodeSchedule( nVars );
770 pPerm = Extra_PermSchedule( nVars );
771 // map numbers into perms
772 p->vMap2Perm = Vec_IntStartFull( (1<<(3*nVars)) );
773 // store permutations
774 One = 0;
775 for ( x = 0; x < nVars; x++ )
776 {
777 p->Perm6[0][x] = (char)x;
778 One |= (x << (3*x));
779 }
780// Vec_IntWriteEntry( p->vMap2Perm, One, 0 );
781 OneCopy = One;
782 for ( k = 0; k < nPerms; k++ )
783 {
784 if ( k > 0 )
785 for ( x = 0; x < nVars; x++ )
786 p->Perm6[k][x] = p->Perm6[k-1][x];
787 ABC_SWAP( char, p->Perm6[k][pPerm[k]], p->Perm6[k][pPerm[k]+1] );
788
789 Num = ( (One >> (3*(pPerm[k] ))) ^ (One >> (3*(pPerm[k]+1))) ) & 7;
790 One ^= (Num << (3*(pPerm[k] )));
791 One ^= (Num << (3*(pPerm[k]+1)));
792
793 Vec_IntWriteEntry( p->vMap2Perm, One, k );
794
795// Mpm_ManPrintPerm( One );
796// for ( x = 0; x < nVars; x++ )
797// printf( "%d ", p->Perm6[k][x] );
798// printf( "\n" );
799 }
800 assert( OneCopy == One );
801 // fill in the gaps
802 vVars = Vec_IntAlloc( 6 );
803 Vec_IntForEachEntry( p->vMap2Perm, Num, i )
804 {
805 // mark used variables
806 int Count = 0;
807 One = i;
808 Vec_IntFill( vVars, 6, 0 );
809 for ( k = 0; k < nVars; k++ )
810 {
811 int iVar = ((One >> (3*k)) & 7);
812 if ( iVar >= nVars && iVar < 7 )
813 break;
814 if ( iVar != 7 )
815 {
816 if ( Vec_IntEntry( vVars, iVar ) == 1 )
817 break;
818 Vec_IntWriteEntry( vVars, iVar, 1 );
819 Count++;
820 }
821 }
822 // skip ones with dups and complete
823 if ( k < nVars || Count == nVars )
824 continue;
825 // find unused variables
826 for ( x = k = 0; k < 6; k++ )
827 if ( Vec_IntEntry(vVars, k) == 0 )
828 Vec_IntWriteEntry( vVars, x++, k );
829 Vec_IntShrink( vVars, x );
830 // fill in used variables
831 x = 0;
832 for ( k = 0; k < nVars; k++ )
833 {
834 int iVar = ((One >> (3*k)) & 7);
835 if ( iVar == 7 )
836 One ^= ((Vec_IntEntry(vVars, x++) ^ 7) << (3*k));
837 }
838 assert( x == Vec_IntSize(vVars) );
839 // save this one
840 assert( Vec_IntEntry( p->vMap2Perm, One ) != -1 );
841 Vec_IntWriteEntry( p->vMap2Perm, i, Vec_IntEntry(p->vMap2Perm, One) );
842/*
843 // mapping
844 Mpm_ManPrintPerm( i );
845 printf( "-> " );
846 Mpm_ManPrintPerm( One );
847 printf( "\n" );
848*/
849 }
850 Vec_IntFree( vVars );
851
852 // store permuted truth tables
853 assert( p->vPerm6 == NULL );
854 p->vPerm6 = Vec_WrdAlloc( nPerms * 595 );
855 for ( i = 0; i < nClasses[nVars]; i++ )
856 {
857 word uTruth = s_DsdClass6[i].uTruth;
858 for ( k = 0; k < nPerms; k++ )
859 {
860 uTruth = Abc_Tt6SwapAdjacent( uTruth, pPerm[k] );
861 Vec_WrdPush( p->vPerm6, uTruth );
862 }
863 assert( uTruth == s_DsdClass6[i].uTruth );
864 }
865 ABC_FREE( pPerm );
866 ABC_FREE( pComp );
867 // build hash table
868 p->pHash = Mpm_ManBuildHashTable( &p->vConfgRes );
869 Abc_PrintTime( 1, "Setting up DSD information", Abc_Clock() - clk );
870}
#define ABC_SWAP(Type, a, b)
Definition abc_global.h:253
ABC_INT64_T abctime
Definition abc_global.h:332
int * Extra_PermSchedule(int n)
int Extra_Factorial(int n)
int * Extra_GreyCodeSchedule(int n)
Hsh_IntMan_t * Mpm_ManBuildHashTable(Vec_Int_t **pvConfgRes)
Definition mpmDsd.c:699
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mpm_ManPrepare()

void Mpm_ManPrepare ( Mpm_Man_t * p)
extern

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

Synopsis [Technology mapping experiment.]

Description []

SideEffects []

SeeAlso []

Definition at line 794 of file mpmMap.c.

795{
796 Mig_Obj_t * pObj;
797 int i, hCut;
798 Mig_ManForEachCi( p->pMig, pObj, i )
799 {
800 hCut = Mpm_CutCreateUnit( p, Mig_ObjId(pObj) );
801 Mpm_ObjSetCutBest( p, pObj, hCut );
802 Mpm_ObjSetCutList( p, pObj, hCut );
803 }
804 Mig_ManForEachCand( p->pMig, pObj )
805 Mpm_ObjSetEstRef( p, pObj, MPM_UNIT_REFS * Mig_ObjRefNum(pObj) );
806}
#define MPM_UNIT_REFS
Definition mpmInt.h:55
#define Mig_ManForEachCand(p, pObj)
Definition mpmMig.h:324
#define Mig_ManForEachCi(p, pObj, i)
Definition mpmMig.h:327
Here is the caller graph for this function:

◆ Mpm_ManPrintDsdStats()

void Mpm_ManPrintDsdStats ( Mpm_Man_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 665 of file mpmDsd.c.

666{
667 int i, Absent = 0;
668 for ( i = 0; i < 595; i++ )
669 {
670 if ( p->nCountDsd[i] == 0 )
671 {
672 Absent++;
673 continue;
674 }
675 if ( p->pPars->fVeryVerbose )
676 {
677 printf( "%5d : ", i );
678 printf( "%-20s ", p->pDsd6[i].pStr );
679 printf( "%8d ", p->nCountDsd[i] );
680 printf( "\n" );
681 }
682 }
683 printf( "Unused classes = %d (%.2f %%). ", Absent, 100.0 * Absent / 595 );
684 printf( "Non-DSD cuts = %d (%.2f %%). ", p->nNonDsd, 100.0 * p->nNonDsd / p->nCutsMergedAll );
685 printf( "No-match cuts = %d (%.2f %%).\n", p->nNoMatch, 100.0 * p->nNoMatch / p->nCutsMergedAll );
686}
Here is the caller graph for this function:

◆ Mpm_ManPrintPerm()

void Mpm_ManPrintPerm ( unsigned s)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 736 of file mpmDsd.c.

737{
738 int i;
739 for ( i = 0; i < 6; i++ )
740 printf( "%d ", (s >> (3*i)) & 7 );
741 printf( " " );
742}
Here is the caller graph for this function:

◆ Mpm_ManPrintStats()

void Mpm_ManPrintStats ( Mpm_Man_t * p)
extern

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
Here is the caller graph for this function:

◆ Mpm_ManPrintStatsInit()

void Mpm_ManPrintStatsInit ( Mpm_Man_t * p)
extern

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()

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

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
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 nNumCuts
Definition mpm.h:61
Mpm_LibLut_t * pLib
Definition mpm.h:59
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)
extern

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}
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: