abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
dau.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [dau.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [DAG-aware unmapping.]
8 
9  Synopsis [External declarations.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: dau.h,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__DAU___h
22 #define ABC__DAU___h
23 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// INCLUDES ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <assert.h>
33 #include <time.h>
34 #include "misc/vec/vec.h"
35 
36 ////////////////////////////////////////////////////////////////////////
37 /// PARAMETERS ///
38 ////////////////////////////////////////////////////////////////////////
39 
41 
42 #define DAU_MAX_VAR 12 // should be 6 or more
43 #define DAU_MAX_STR 2000
44 #define DAU_MAX_WORD (1<<(DAU_MAX_VAR-6))
45 
46 ////////////////////////////////////////////////////////////////////////
47 /// BASIC TYPES ///
48 ////////////////////////////////////////////////////////////////////////
49 
50 // network types
51 typedef enum {
52  DAU_DSD_NONE = 0, // 0: unknown
53  DAU_DSD_CONST0, // 1: constant
54  DAU_DSD_VAR, // 2: variable
55  DAU_DSD_AND, // 3: AND
56  DAU_DSD_XOR, // 4: XOR
57  DAU_DSD_MUX, // 5: MUX
58  DAU_DSD_PRIME // 6: PRIME
60 
61 typedef struct Dss_Man_t_ Dss_Man_t;
62 
63 ////////////////////////////////////////////////////////////////////////
64 /// MACRO DEFINITIONS ///
65 ////////////////////////////////////////////////////////////////////////
66 
67 static inline int Dau_DsdIsConst( char * p ) { return (p[0] == '0' || p[0] == '1') && p[1] == 0; }
68 static inline int Dau_DsdIsConst0( char * p ) { return p[0] == '0' && p[1] == 0; }
69 static inline int Dau_DsdIsConst1( char * p ) { return p[0] == '1' && p[1] == 0; }
70 static inline int Dau_DsdIsVar( char * p ) { if ( *p == '!' ) p++; return *p >= 'a' && *p <= 'z'; }
71 static inline int Dau_DsdReadVar( char * p ) { if ( *p == '!' ) p++; return *p - 'a'; }
72 
73 ////////////////////////////////////////////////////////////////////////
74 /// FUNCTION DECLARATIONS ///
75 ////////////////////////////////////////////////////////////////////////
76 
77 /*=== dauCanon.c ==========================================================*/
78 extern unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPerm );
79 extern unsigned Abc_TtCanonicizePhase( word * pTruth, int nVars );
80 /*=== dauDsd.c ==========================================================*/
81 extern int * Dau_DsdComputeMatches( char * p );
82 extern int Dau_DsdDecompose( word * pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char * pRes );
83 extern int Dau_DsdDecomposeLevel( word * pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char * pRes, int * pVarLevels );
84 extern void Dau_DsdPrintFromTruthFile( FILE * pFile, word * pTruth, int nVarsInit );
85 extern void Dau_DsdPrintFromTruth( word * pTruth, int nVarsInit );
86 extern word * Dau_DsdToTruth( char * p, int nVars );
87 extern word Dau_Dsd6ToTruth( char * p );
88 extern void Dau_DsdNormalize( char * p );
89 extern int Dau_DsdCountAnds( char * pDsd );
90 extern void Dau_DsdTruthCompose_rec( word * pFunc, word pFanins[DAU_MAX_VAR][DAU_MAX_WORD], word * pRes, int nVars, int nWordsR );
91 extern int Dau_DsdCheck1Step( void * p, word * pTruth, int nVarsInit, int * pVarLevels );
92 
93 /*=== dauGia.c ==========================================================*/
94 extern int Dsm_ManTruthToGia( void * p, word * pTruth, Vec_Int_t * vLeaves, Vec_Int_t * vCover );
95 extern void * Dsm_ManDeriveGia( void * p, int fUseMuxes );
96 
97 /*=== dauMerge.c ==========================================================*/
98 extern void Dau_DsdRemoveBraces( char * pDsd, int * pMatches );
99 extern char * Dau_DsdMerge( char * pDsd0i, int * pPerm0, char * pDsd1i, int * pPerm1, int fCompl0, int fCompl1, int nVars );
100 
101 /*=== dauNonDsd.c ==========================================================*/
102 extern Vec_Int_t * Dau_DecFindSets_int( word * pInit, int nVars, int * pSched[16] );
103 extern Vec_Int_t * Dau_DecFindSets( word * pInit, int nVars );
104 extern void Dau_DecSortSet( unsigned set, int nVars, int * pnUnique, int * pnShared, int * pnFree );
105 extern void Dau_DecPrintSets( Vec_Int_t * vSets, int nVars );
106 extern void Dau_DecPrintSet( unsigned set, int nVars, int fNewLine );
107 
108 /*=== dauTree.c ==========================================================*/
109 extern Dss_Man_t * Dss_ManAlloc( int nVars, int nNonDecLimit );
110 extern void Dss_ManFree( Dss_Man_t * p );
111 extern int Dss_ManMerge( Dss_Man_t * p, int * iDsd, int * nFans, int ** pFans, unsigned uSharedMask, int nKLutSize, unsigned char * pPerm, word * pTruth );
112 extern void Dss_ManPrint( char * pFileName, Dss_Man_t * p );
113 
114 
116 
117 
118 
119 #endif
120 
121 ////////////////////////////////////////////////////////////////////////
122 /// END OF FILE ///
123 ////////////////////////////////////////////////////////////////////////
124 
void Dss_ManFree(Dss_Man_t *p)
Definition: dauTree.c:987
Vec_Int_t * vLeaves
Definition: dauTree.c:85
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int nVars
Definition: dauTree.c:78
static int Dau_DsdReadVar(char *p)
Definition: dau.h:71
void Dau_DsdPrintFromTruth(word *pTruth, int nVarsInit)
Definition: dauDsd.c:1968
Vec_Int_t * Dau_DecFindSets_int(word *pInit, int nVars, int *pSched[16])
Definition: dauNonDsd.c:462
int Dau_DsdDecompose(word *pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char *pRes)
Definition: dauDsd.c:1912
word * Dau_DsdToTruth(char *p, int nVars)
Definition: dauDsd.c:609
void Dau_DsdRemoveBraces(char *pDsd, int *pMatches)
Definition: dauMerge.c:554
int Dsm_ManTruthToGia(void *p, word *pTruth, Vec_Int_t *vLeaves, Vec_Int_t *vCover)
Definition: dauGia.c:415
static int Dau_DsdIsConst(char *p)
MACRO DEFINITIONS ///.
Definition: dau.h:67
Vec_Int_t * Dau_DecFindSets(word *pInit, int nVars)
Definition: dauNonDsd.c:516
int Dau_DsdDecomposeLevel(word *pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char *pRes, int *pVarLevels)
Definition: dauDsd.c:1936
word Dau_Dsd6ToTruth(char *p)
Definition: dauDsd.c:445
unsigned Abc_TtCanonicizePhase(word *pTruth, int nVars)
Definition: dauCanon.c:999
void Dau_DecPrintSets(Vec_Int_t *vSets, int nVars)
Definition: dauNonDsd.c:434
int * Dau_DsdComputeMatches(char *p)
Definition: dauDsd.c:80
void Dau_DsdNormalize(char *p)
Definition: dauDsd.c:260
#define DAU_MAX_VAR
INCLUDES ///.
Definition: dau.h:42
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
void Dau_DsdPrintFromTruthFile(FILE *pFile, word *pTruth, int nVarsInit)
Definition: dauDsd.c:1960
void Dau_DsdTruthCompose_rec(word *pFunc, word pFanins[DAU_MAX_VAR][DAU_MAX_WORD], word *pRes, int nVars, int nWordsR)
Definition: dauDsd.c:501
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
int nNonDecLimit
Definition: dauTree.c:79
static int pPerm[13719]
Definition: rwrTemp.c:32
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
Dau_DsdType_t
BASIC TYPES ///.
Definition: dau.h:51
void Dau_DecPrintSet(unsigned set, int nVars, int fNewLine)
Definition: dauNonDsd.c:390
#define DAU_MAX_WORD
Definition: dau.h:44
void Dss_ManPrint(char *pFileName, Dss_Man_t *p)
Definition: dauTree.c:1086
void Dau_DecSortSet(unsigned set, int nVars, int *pnUnique, int *pnShared, int *pnFree)
Definition: dauNonDsd.c:371
char * Dau_DsdMerge(char *pDsd0i, int *pPerm0, char *pDsd1i, int *pPerm1, int fCompl0, int fCompl1, int nVars)
DECLARATIONS ///.
Definition: dauMerge.c:587
static int Dau_DsdIsConst1(char *p)
Definition: dau.h:69
void * Dsm_ManDeriveGia(void *p, int fUseMuxes)
Definition: dauGia.c:471
int Dss_ManMerge(Dss_Man_t *p, int *iDsd, int *nFans, int **pFans, unsigned uSharedMask, int nKLutSize, unsigned char *pPerm, word *pTruth)
Definition: dauTree.c:1539
Dss_Man_t * Dss_ManAlloc(int nVars, int nNonDecLimit)
Definition: dauTree.c:967
unsigned Abc_TtCanonicize(word *pTruth, int nVars, char *pCanonPerm)
FUNCTION DECLARATIONS ///.
Definition: dauCanon.c:895
static int Dau_DsdIsVar(char *p)
Definition: dau.h:70
static int Dau_DsdIsConst0(char *p)
Definition: dau.h:68
int Dau_DsdCountAnds(char *pDsd)
Definition: dauDsd.c:316
int Dau_DsdCheck1Step(void *p, word *pTruth, int nVarsInit, int *pVarLevels)
Definition: dauDsd.c:893