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

Go to the source code of this file.

Functions

void Cut_TruthNCanonicize (Cut_Cut_t *pCut)
 
void Cut_TruthComputeOld (Cut_Cut_t *pCut, Cut_Cut_t *pCut0, Cut_Cut_t *pCut1, int fCompl0, int fCompl1)
 
void Cut_TruthCompute (Cut_Man_t *p, Cut_Cut_t *pCut, Cut_Cut_t *pCut0, Cut_Cut_t *pCut1, int fCompl0, int fCompl1)
 

Variables

ABC_NAMESPACE_IMPL_START int nTotal = 0
 DECLARATIONS ///.
 
int nGood = 0
 
int nEqual = 0
 

Function Documentation

◆ Cut_TruthCompute()

void Cut_TruthCompute ( Cut_Man_t * p,
Cut_Cut_t * pCut,
Cut_Cut_t * pCut0,
Cut_Cut_t * pCut1,
int fCompl0,
int fCompl1 )

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

Synopsis [Performs truth table computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 177 of file cutTruth.c.

178{
179 // permute the first table
180 if ( fCompl0 )
181 Extra_TruthNot( p->puTemp[0], Cut_CutReadTruth(pCut0), pCut->nVarsMax );
182 else
183 Extra_TruthCopy( p->puTemp[0], Cut_CutReadTruth(pCut0), pCut->nVarsMax );
184 Extra_TruthStretch( p->puTemp[2], p->puTemp[0], pCut0->nLeaves, pCut->nVarsMax, Cut_TruthPhase(pCut, pCut0) );
185 // permute the second table
186 if ( fCompl1 )
187 Extra_TruthNot( p->puTemp[1], Cut_CutReadTruth(pCut1), pCut->nVarsMax );
188 else
189 Extra_TruthCopy( p->puTemp[1], Cut_CutReadTruth(pCut1), pCut->nVarsMax );
190 Extra_TruthStretch( p->puTemp[3], p->puTemp[1], pCut1->nLeaves, pCut->nVarsMax, Cut_TruthPhase(pCut, pCut1) );
191 // produce the resulting table
192 if ( pCut->fCompl )
193 Extra_TruthNand( Cut_CutReadTruth(pCut), p->puTemp[2], p->puTemp[3], pCut->nVarsMax );
194 else
195 Extra_TruthAnd( Cut_CutReadTruth(pCut), p->puTemp[2], p->puTemp[3], pCut->nVarsMax );
196
197// Ivy_TruthTestOne( *Cut_CutReadTruth(pCut) );
198
199 // quit if no fancy computation is needed
200 if ( !p->pParams->fFancy )
201 return;
202
203 if ( pCut->nLeaves != 7 )
204 return;
205
206 // count the total number of truth tables computed
207 nTotal++;
208
209 // MAPPING INTO ALTERA 6-2 LOGIC BLOCKS
210 // call this procedure to find the minimum number of common variables in the cofactors
211 // if this number is less or equal than 3, the cut can be implemented using the 6-2 logic block
212 if ( Extra_TruthMinCofSuppOverlap( Cut_CutReadTruth(pCut), pCut->nVarsMax, NULL ) <= 4 )
213 nGood++;
214
215 // MAPPING INTO ACTEL 2x2 CELLS
216 // call this procedure to see if a semi-canonical form can be found in the lookup table
217 // (if it exists, then a two-level 3-input LUT implementation of the cut exists)
218 // Before this procedure is called, cell manager should be defined by calling
219 // Cut_CellLoad (make sure file "cells22_daomap_iwls.txt" is available in the working dir)
220// if ( Cut_CellIsRunning() && pCut->nVarsMax <= 9 )
221// nGood += Cut_CellTruthLookup( Cut_CutReadTruth(pCut), pCut->nVarsMax );
222}
int nGood
Definition abcCut.c:34
int nTotal
DECLARATIONS ///.
Definition cutTruth.c:37
Cube * p
Definition exorList.c:222
int Extra_TruthMinCofSuppOverlap(unsigned *pTruth, int nVars, int *pVarMin)
void Extra_TruthStretch(unsigned *pOut, unsigned *pIn, int nVars, int nVarsAll, unsigned Phase)
unsigned nVarsMax
Definition cut.h:83
unsigned fCompl
Definition cut.h:82
unsigned nLeaves
Definition cut.h:84
Here is the call graph for this function:

◆ Cut_TruthComputeOld()

void Cut_TruthComputeOld ( Cut_Cut_t * pCut,
Cut_Cut_t * pCut0,
Cut_Cut_t * pCut1,
int fCompl0,
int fCompl1 )

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

Synopsis [Performs truth table computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 126 of file cutTruth.c.

127{
128 static unsigned uTruth0[8], uTruth1[8];
129 int nTruthWords = Cut_TruthWords( pCut->nVarsMax );
130 unsigned * pTruthRes;
131 int i, uPhase;
132
133 // permute the first table
134 uPhase = Cut_TruthPhase( pCut, pCut0 );
135 Extra_TruthExpand( pCut->nVarsMax, nTruthWords, Cut_CutReadTruth(pCut0), uPhase, uTruth0 );
136 if ( fCompl0 )
137 {
138 for ( i = 0; i < nTruthWords; i++ )
139 uTruth0[i] = ~uTruth0[i];
140 }
141
142 // permute the second table
143 uPhase = Cut_TruthPhase( pCut, pCut1 );
144 Extra_TruthExpand( pCut->nVarsMax, nTruthWords, Cut_CutReadTruth(pCut1), uPhase, uTruth1 );
145 if ( fCompl1 )
146 {
147 for ( i = 0; i < nTruthWords; i++ )
148 uTruth1[i] = ~uTruth1[i];
149 }
150
151 // write the resulting table
152 pTruthRes = Cut_CutReadTruth(pCut);
153
154 if ( pCut->fCompl )
155 {
156 for ( i = 0; i < nTruthWords; i++ )
157 pTruthRes[i] = ~(uTruth0[i] & uTruth1[i]);
158 }
159 else
160 {
161 for ( i = 0; i < nTruthWords; i++ )
162 pTruthRes[i] = uTruth0[i] & uTruth1[i];
163 }
164}
void Extra_TruthExpand(int nVars, int nWords, unsigned *puTruth, unsigned uPhase, unsigned *puTruthR)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cut_TruthNCanonicize()

void Cut_TruthNCanonicize ( Cut_Cut_t * pCut)

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

Synopsis [Performs truth table computation.]

Description [This procedure cannot be used while recording oracle because it will overwrite Num0 and Num1.]

SideEffects []

SeeAlso []

Definition at line 85 of file cutTruth.c.

86{
87 unsigned uTruth;
88 unsigned * uCanon2;
89 char * pPhases2;
90 assert( pCut->nVarsMax < 6 );
91
92 // get the direct truth table
93 uTruth = *Cut_CutReadTruth(pCut);
94
95 // compute the direct truth table
96 Extra_TruthCanonFastN( pCut->nVarsMax, pCut->nLeaves, &uTruth, &uCanon2, &pPhases2 );
97// uCanon[0] = uCanon2[0];
98// uCanon[1] = (p->nVarsMax == 6)? uCanon2[1] : uCanon2[0];
99// uPhases[0] = pPhases2[0];
100 pCut->uCanon0 = uCanon2[0];
101 pCut->Num0 = pPhases2[0];
102
103 // get the complemented truth table
104 uTruth = ~*Cut_CutReadTruth(pCut);
105
106 // compute the direct truth table
107 Extra_TruthCanonFastN( pCut->nVarsMax, pCut->nLeaves, &uTruth, &uCanon2, &pPhases2 );
108// uCanon[0] = uCanon2[0];
109// uCanon[1] = (p->nVarsMax == 6)? uCanon2[1] : uCanon2[0];
110// uPhases[0] = pPhases2[0];
111 pCut->uCanon1 = uCanon2[0];
112 pCut->Num1 = pPhases2[0];
113}
int Extra_TruthCanonFastN(int nVarsMax, int nVarsReal, unsigned *pt, unsigned **pptRes, char **ppfRes)
unsigned uCanon0
Definition cut.h:86
unsigned uCanon1
Definition cut.h:87
unsigned Num1
Definition cut.h:80
unsigned Num0
Definition cut.h:79
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

Variable Documentation

◆ nEqual

int nEqual = 0

Definition at line 39 of file cutTruth.c.

◆ nGood

int nGood = 0

Definition at line 38 of file cutTruth.c.

◆ nTotal

ABC_NAMESPACE_IMPL_START int nTotal = 0

DECLARATIONS ///.

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

FileName [cutTruth.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [K-feasible cut computation package.]

Synopsis [Incremental truth table computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 37 of file cutTruth.c.