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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Rwr_Trav2_rec (Rwr_Man_t *p, Rwr_Node_t *pNode, int *pVolume)
 DECLARATIONS ///.
 
void Rwr_GetBushVolume (Rwr_Man_t *p, int Entry, int *pVolume, int *pnFuncs)
 
int Rwr_GetBushSumOfVolumes (Rwr_Man_t *p, int Entry)
 
void Rwr_NodePrint_rec (FILE *pFile, Rwr_Node_t *pNode)
 
void Rwr_NodePrint (FILE *pFile, Rwr_Man_t *p, Rwr_Node_t *pNode)
 
void Rwr_ManPrint (Rwr_Man_t *p)
 

Function Documentation

◆ Rwr_GetBushSumOfVolumes()

int Rwr_GetBushSumOfVolumes ( Rwr_Man_t * p,
int Entry )

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

Synopsis [Adds the node to the end of the list.]

Description []

SideEffects []

SeeAlso []

Definition at line 94 of file rwrPrint.c.

95{
96 Rwr_Node_t * pNode;
97 int Volume, VolumeTotal = 0;
98 for ( pNode = p->pTable[Entry]; pNode; pNode = pNode->pNext )
99 {
100 if ( pNode->uTruth != p->puCanons[pNode->uTruth] )
101 continue;
102 Volume = 0;
104 Rwr_Trav2_rec( p, pNode, &Volume );
105 VolumeTotal += Volume;
106 }
107 return VolumeTotal;
108}
Cube * p
Definition exorList.c:222
ABC_NAMESPACE_IMPL_START void Rwr_Trav2_rec(Rwr_Man_t *p, Rwr_Node_t *pNode, int *pVolume)
DECLARATIONS ///.
Definition rwrPrint.c:45
struct Rwr_Node_t_ Rwr_Node_t
Definition rwr.h:48
void Rwr_ManIncTravId(Rwr_Man_t *p)
Definition rwrLib.c:350
Rwr_Node_t * pNext
Definition rwr.h:112
unsigned uTruth
Definition rwr.h:105
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rwr_GetBushVolume()

void Rwr_GetBushVolume ( Rwr_Man_t * p,
int Entry,
int * pVolume,
int * pnFuncs )

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

Synopsis [Adds the node to the end of the list.]

Description []

SideEffects []

SeeAlso []

Definition at line 66 of file rwrPrint.c.

67{
68 Rwr_Node_t * pNode;
69 int Volume = 0;
70 int nFuncs = 0;
72 for ( pNode = p->pTable[Entry]; pNode; pNode = pNode->pNext )
73 {
74 if ( pNode->uTruth != p->puCanons[pNode->uTruth] )
75 continue;
76 nFuncs++;
77 Rwr_Trav2_rec( p, pNode, &Volume );
78 }
79 *pVolume = Volume;
80 *pnFuncs = nFuncs;
81}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rwr_ManPrint()

void Rwr_ManPrint ( Rwr_Man_t * p)

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

Synopsis [Prints one rwr node.]

Description []

SideEffects []

SeeAlso []

Definition at line 237 of file rwrPrint.c.

238{
239 FILE * pFile;
240 Rwr_Node_t * pNode;
241 unsigned uTruth;
242 int Limit, Counter, Volume, nFuncs, i;
243 pFile = fopen( "graph_lib.txt", "w" );
244 Counter = 0;
245 Limit = (1 << 16);
246 for ( i = 0; i < Limit; i++ )
247 {
248 if ( p->pTable[i] == NULL )
249 continue;
250 if ( i != p->puCanons[i] )
251 continue;
252 fprintf( pFile, "\nClass %3d. Func %6d. ", p->pMap[i], Counter++ );
253 Rwr_GetBushVolume( p, i, &Volume, &nFuncs );
254 fprintf( pFile, "Roots = %3d. Vol = %3d. Sum = %3d. ", nFuncs, Volume, Rwr_GetBushSumOfVolumes(p, i) );
255 uTruth = i;
256 Extra_PrintBinary( pFile, &uTruth, 16 );
257 fprintf( pFile, "\n" );
258 for ( pNode = p->pTable[i]; pNode; pNode = pNode->pNext )
259 if ( pNode->uTruth == p->puCanons[pNode->uTruth] )
260 Rwr_NodePrint( pFile, p, pNode );
261 }
262 fclose( pFile );
263}
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
void Rwr_NodePrint(FILE *pFile, Rwr_Man_t *p, Rwr_Node_t *pNode)
Definition rwrPrint.c:208
int Rwr_GetBushSumOfVolumes(Rwr_Man_t *p, int Entry)
Definition rwrPrint.c:94
void Rwr_GetBushVolume(Rwr_Man_t *p, int Entry, int *pVolume, int *pnFuncs)
Definition rwrPrint.c:66
Here is the call graph for this function:

◆ Rwr_NodePrint()

void Rwr_NodePrint ( FILE * pFile,
Rwr_Man_t * p,
Rwr_Node_t * pNode )

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

Synopsis [Prints one rwr node.]

Description []

SideEffects []

SeeAlso []

Definition at line 208 of file rwrPrint.c.

209{
210 unsigned uTruth;
211 fprintf( pFile, "%5d : ", pNode->Id );
212 uTruth = pNode->uTruth;
213 Extra_PrintHex( pFile, &uTruth, 4 );
214 fprintf( pFile, " tt=" );
215 Extra_PrintBinary( pFile, &uTruth, 16 );
216// fprintf( pFile, " cn=", pNode->Id );
217// uTruth = p->puCanons[pNode->uTruth];
218// Extra_PrintBinary( pFile, &uTruth, 16 );
219 fprintf( pFile, " lev=%d", pNode->Level );
220 fprintf( pFile, " vol=%d", pNode->Volume );
221 fprintf( pFile, " " );
222 Rwr_NodePrint_rec( pFile, pNode );
223 fprintf( pFile, "\n" );
224}
void Extra_PrintHex(FILE *pFile, unsigned *pTruth, int nVars)
void Rwr_NodePrint_rec(FILE *pFile, Rwr_Node_t *pNode)
Definition rwrPrint.c:121
int Id
Definition rwr.h:100
unsigned Volume
Definition rwr.h:106
unsigned Level
Definition rwr.h:107
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rwr_NodePrint_rec()

void Rwr_NodePrint_rec ( FILE * pFile,
Rwr_Node_t * pNode )

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

Synopsis [Prints one rwr node.]

Description []

SideEffects []

SeeAlso []

Definition at line 121 of file rwrPrint.c.

122{
123 assert( !Rwr_IsComplement(pNode) );
124
125 if ( pNode->Id == 0 )
126 {
127 fprintf( pFile, "Const1" );
128 return;
129 }
130
131 if ( pNode->Id < 5 )
132 {
133 fprintf( pFile, "%c", 'a' + pNode->Id - 1 );
134 return;
135 }
136
137 if ( Rwr_IsComplement(pNode->p0) )
138 {
139 if ( Rwr_Regular(pNode->p0)->Id < 5 )
140 {
141 Rwr_NodePrint_rec( pFile, Rwr_Regular(pNode->p0) );
142 fprintf( pFile, "\'" );
143 }
144 else
145 {
146 fprintf( pFile, "(" );
147 Rwr_NodePrint_rec( pFile, Rwr_Regular(pNode->p0) );
148 fprintf( pFile, ")\'" );
149 }
150 }
151 else
152 {
153 if ( Rwr_Regular(pNode->p0)->Id < 5 )
154 {
155 Rwr_NodePrint_rec( pFile, Rwr_Regular(pNode->p0) );
156 }
157 else
158 {
159 fprintf( pFile, "(" );
160 Rwr_NodePrint_rec( pFile, Rwr_Regular(pNode->p0) );
161 fprintf( pFile, ")" );
162 }
163 }
164
165 if ( pNode->fExor )
166 fprintf( pFile, "+" );
167
168 if ( Rwr_IsComplement(pNode->p1) )
169 {
170 if ( Rwr_Regular(pNode->p1)->Id < 5 )
171 {
172 Rwr_NodePrint_rec( pFile, Rwr_Regular(pNode->p1) );
173 fprintf( pFile, "\'" );
174 }
175 else
176 {
177 fprintf( pFile, "(" );
178 Rwr_NodePrint_rec( pFile, Rwr_Regular(pNode->p1) );
179 fprintf( pFile, ")\'" );
180 }
181 }
182 else
183 {
184 if ( Rwr_Regular(pNode->p1)->Id < 5 )
185 {
186 Rwr_NodePrint_rec( pFile, Rwr_Regular(pNode->p1) );
187 }
188 else
189 {
190 fprintf( pFile, "(" );
191 Rwr_NodePrint_rec( pFile, Rwr_Regular(pNode->p1) );
192 fprintf( pFile, ")" );
193 }
194 }
195}
Rwr_Node_t * p1
Definition rwr.h:111
Rwr_Node_t * p0
Definition rwr.h:110
unsigned fExor
Definition rwr.h:109
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rwr_Trav2_rec()

ABC_NAMESPACE_IMPL_START void Rwr_Trav2_rec ( Rwr_Man_t * p,
Rwr_Node_t * pNode,
int * pVolume )

DECLARATIONS ///.

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

FileName [rwrCut.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [DAG-aware AIG rewriting package.]

Synopsis [Cut computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Adds one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file rwrPrint.c.

46{
47 if ( pNode->fUsed || pNode->TravId == p->nTravIds )
48 return;
49 pNode->TravId = p->nTravIds;
50 (*pVolume)++;
51 Rwr_Trav2_rec( p, Rwr_Regular(pNode->p0), pVolume );
52 Rwr_Trav2_rec( p, Rwr_Regular(pNode->p1), pVolume );
53}
unsigned fUsed
Definition rwr.h:108
int TravId
Definition rwr.h:101
Here is the call graph for this function:
Here is the caller graph for this function: