ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
dau.h
Go to the documentation of this file.
1
20
21#ifndef ABC__DAU___h
22#define ABC__DAU___h
23
24
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
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
49
50// network types
51typedef 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
61typedef struct Dss_Man_t_ Dss_Man_t;
63typedef unsigned(*TtCanonicizeFunc)(Abc_TtHieMan_t * p, word * pTruth, int nVars, char * pCanonPerm, int flag);
64
68
69static inline int Dau_DsdIsConst( char * p ) { return (p[0] == '0' || p[0] == '1') && p[1] == 0; }
70static inline int Dau_DsdIsConst0( char * p ) { return p[0] == '0' && p[1] == 0; }
71static inline int Dau_DsdIsConst1( char * p ) { return p[0] == '1' && p[1] == 0; }
72static inline int Dau_DsdIsVar( char * p ) { if ( *p == '!' ) p++; return *p >= 'a' && *p <= 'z'; }
73static inline int Dau_DsdReadVar( char * p ) { if ( *p == '!' ) p++; return *p - 'a'; }
74
78
79/*=== dauCanon.c ==========================================================*/
80extern unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPerm );
81extern unsigned Abc_TtCanonicizePerm( word * pTruth, int nVars, char * pCanonPerm );
82extern unsigned Abc_TtCanonicizePhase( word * pTruth, int nVars );
83extern int Abc_TtCountOnesInCofsSimple( word * pTruth, int nVars, int * pStore );
84extern unsigned Abc_TtCanonicizeHie(Abc_TtHieMan_t * p, word * pTruth, int nVars, char * pCanonPerm, int fExact );
85extern Abc_TtHieMan_t * Abc_TtHieManStart( int nVars, int nLevels );
86extern void Abc_TtHieManStop(Abc_TtHieMan_t * p );
87extern unsigned Abc_TtCanonicizeWrap(TtCanonicizeFunc func, Abc_TtHieMan_t * p, word * pTruth, int nVars, char * pCanonPerm, int flag);
88extern unsigned Abc_TtCanonicizeAda(Abc_TtHieMan_t * p, word * pTruth, int nVars, char * pCanonPerm, int iThres);
89extern unsigned Abc_TtCanonicizeHie(Abc_TtHieMan_t * p, word * pTruthInit, int nVars, char * pCanonPerm, int fExact);
90/*=== dauCount.c ==========================================================*/
91extern int Abc_TtCountOnesInCofsQuick( word * pTruth, int nVars, int * pStore );
92/*=== dauDsd.c ==========================================================*/
93extern int * Dau_DsdComputeMatches( char * p );
94extern int Dau_DsdDecompose( word * pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char * pRes );
95extern int Dau_DsdDecomposeLevel( word * pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char * pRes, int * pVarLevels );
96extern void Dau_DsdPrintFromTruthFile( FILE * pFile, word * pTruth, int nVarsInit );
97extern void Dau_DsdPrintFromTruth( word * pTruth, int nVarsInit );
98extern word * Dau_DsdToTruth( char * p, int nVars );
99extern word Dau_Dsd6ToTruth( char * p );
100extern void Dau_DsdNormalize( char * p );
101extern int Dau_DsdCountAnds( char * pDsd );
102extern void Dau_DsdTruthCompose_rec( word * pFunc, word pFanins[DAU_MAX_VAR][DAU_MAX_WORD], word * pRes, int nVars, int nWordsR );
103extern int Dau_DsdCheck1Step( void * p, word * pTruth, int nVarsInit, int * pVarLevels );
104
105/*=== dauGia.c ==========================================================*/
106extern int Dsm_ManTruthToGia( void * p, word * pTruth, Vec_Int_t * vLeaves, Vec_Int_t * vCover );
107extern void * Dsm_ManDeriveGia( void * p, int fUseMuxes );
108
109/*=== dauMerge.c ==========================================================*/
110extern void Dau_DsdRemoveBraces( char * pDsd, int * pMatches );
111extern char * Dau_DsdMerge( char * pDsd0i, int * pPerm0, char * pDsd1i, int * pPerm1, int fCompl0, int fCompl1, int nVars );
112
113/*=== dauNonDsd.c ==========================================================*/
114extern Vec_Int_t * Dau_DecFindSets_int( word * pInit, int nVars, int * pSched[16] );
115extern Vec_Int_t * Dau_DecFindSets( word * pInit, int nVars );
116extern void Dau_DecSortSet( unsigned set, int nVars, int * pnUnique, int * pnShared, int * pnFree );
117extern void Dau_DecPrintSets( Vec_Int_t * vSets, int nVars );
118extern void Dau_DecPrintSet( unsigned set, int nVars, int fNewLine );
119
120/*=== dauTree.c ==========================================================*/
121extern Dss_Man_t * Dss_ManAlloc( int nVars, int nNonDecLimit );
122extern void Dss_ManFree( Dss_Man_t * p );
123extern int Dss_ManMerge( Dss_Man_t * p, int * iDsd, int * nFans, int ** pFans, unsigned uSharedMask, int nKLutSize, unsigned char * pPerm, word * pTruth );
124extern void Dss_ManPrint( char * pFileName, Dss_Man_t * p );
125
126
128
129
130
131#endif
132
136
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
int Dau_DsdCheck1Step(void *p, word *pTruth, int nVarsInit, int *pVarLevels)
Definition dauDsd.c:893
word * Dau_DsdToTruth(char *p, int nVars)
Definition dauDsd.c:609
void Dss_ManPrint(char *pFileName, Dss_Man_t *p)
Definition dauTree.c:1086
void Dau_DsdRemoveBraces(char *pDsd, int *pMatches)
Definition dauMerge.c:554
void Dau_DsdPrintFromTruthFile(FILE *pFile, word *pTruth, int nVarsInit)
Definition dauDsd.c:1960
int Dsm_ManTruthToGia(void *p, word *pTruth, Vec_Int_t *vLeaves, Vec_Int_t *vCover)
Definition dauGia.c:441
struct Abc_TtHieMan_t_ Abc_TtHieMan_t
Definition dau.h:62
void Dau_DecPrintSet(unsigned set, int nVars, int fNewLine)
Definition dauNonDsd.c:390
#define DAU_MAX_WORD
Definition dau.h:44
int Abc_TtCountOnesInCofsSimple(word *pTruth, int nVars, int *pStore)
Definition dauCanon.c:370
int Dau_DsdDecompose(word *pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char *pRes)
Definition dauDsd.c:1912
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
int * Dau_DsdComputeMatches(char *p)
Definition dauDsd.c:80
void Dau_DsdTruthCompose_rec(word *pFunc, word pFanins[DAU_MAX_VAR][DAU_MAX_WORD], word *pRes, int nVars, int nWordsR)
Definition dauDsd.c:501
unsigned Abc_TtCanonicizePhase(word *pTruth, int nVars)
Definition dauCanon.c:1187
void Dau_DsdPrintFromTruth(word *pTruth, int nVarsInit)
Definition dauDsd.c:1968
void Dau_DsdNormalize(char *p)
Definition dauDsd.c:260
struct Dss_Man_t_ Dss_Man_t
Definition dau.h:61
Dau_DsdType_t
BASIC TYPES ///.
Definition dau.h:51
@ DAU_DSD_VAR
Definition dau.h:54
@ DAU_DSD_XOR
Definition dau.h:56
@ DAU_DSD_CONST0
Definition dau.h:53
@ DAU_DSD_PRIME
Definition dau.h:58
@ DAU_DSD_NONE
Definition dau.h:52
@ DAU_DSD_MUX
Definition dau.h:57
@ DAU_DSD_AND
Definition dau.h:55
Dss_Man_t * Dss_ManAlloc(int nVars, int nNonDecLimit)
Definition dauTree.c:967
int Dau_DsdCountAnds(char *pDsd)
Definition dauDsd.c:316
unsigned(* TtCanonicizeFunc)(Abc_TtHieMan_t *p, word *pTruth, int nVars, char *pCanonPerm, int flag)
Definition dau.h:63
char * Dau_DsdMerge(char *pDsd0i, int *pPerm0, char *pDsd1i, int *pPerm1, int fCompl0, int fCompl1, int nVars)
DECLARATIONS ///.
Definition dauMerge.c:587
void Dau_DecPrintSets(Vec_Int_t *vSets, int nVars)
Definition dauNonDsd.c:434
unsigned Abc_TtCanonicizePerm(word *pTruth, int nVars, char *pCanonPerm)
Definition dauCanon.c:1085
void Dss_ManFree(Dss_Man_t *p)
Definition dauTree.c:987
int Abc_TtCountOnesInCofsQuick(word *pTruth, int nVars, int *pStore)
Definition dauCount.c:376
unsigned Abc_TtCanonicizeAda(Abc_TtHieMan_t *p, word *pTruth, int nVars, char *pCanonPerm, int iThres)
Definition dauCanon.c:2573
unsigned Abc_TtCanonicizeHie(Abc_TtHieMan_t *p, word *pTruth, int nVars, char *pCanonPerm, int fExact)
Definition dauCanon.c:1318
#define DAU_MAX_VAR
INCLUDES ///.
Definition dau.h:42
Abc_TtHieMan_t * Abc_TtHieManStart(int nVars, int nLevels)
Definition dauCanon.c:1255
void Abc_TtHieManStop(Abc_TtHieMan_t *p)
Definition dauCanon.c:1273
Vec_Int_t * Dau_DecFindSets_int(word *pInit, int nVars, int *pSched[16])
Definition dauNonDsd.c:462
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
void Dau_DecSortSet(unsigned set, int nVars, int *pnUnique, int *pnShared, int *pnFree)
Definition dauNonDsd.c:371
word Dau_Dsd6ToTruth(char *p)
Definition dauDsd.c:445
unsigned Abc_TtCanonicizeWrap(TtCanonicizeFunc func, Abc_TtHieMan_t *p, word *pTruth, int nVars, char *pCanonPerm, int flag)
Definition dauCanon.c:1530
unsigned Abc_TtCanonicize(word *pTruth, int nVars, char *pCanonPerm)
FUNCTION DECLARATIONS ///.
Definition dauCanon.c:1036
void * Dsm_ManDeriveGia(void *p, int fUseMuxes)
Definition dauGia.c:503
Cube * p
Definition exorList.c:222
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36