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

Go to the source code of this file.

Functions

int AllocateCover (int nCubes, int nWordsIn, int nWordsOut)
 FUNCTIONS OF THIS MODULE ///.
 
void DelocateCover ()
 
void AddToFreeCubes (Cube *p)
 FREE CUBE LIST MANIPULATION FUNCTIONS ///.
 
CubeGetFreeCube ()
 

Variables

ABC_NAMESPACE_IMPL_START cinfo g_CoverInfo
 EXTERNAL FUNCTIONS ///.
 
Cube ** s_pCoverMemory
 EXPORTED VARIABLES ///.
 
Cubes_CubesFree
 

Function Documentation

◆ AddToFreeCubes()

void AddToFreeCubes ( Cube * pC)

FREE CUBE LIST MANIPULATION FUNCTIONS ///.

Definition at line 157 of file exorCubes.c.

158{
159 assert( p );
160 assert( p->Prev == NULL ); // the cube should not be in use
161 assert( p->Next == NULL );
162 assert( p->ID );
163
164 p->Next = s_CubesFree;
165 s_CubesFree = p;
166
167 // set the ID of the cube to 0,
168 // so that cube pair garbage collection could recognize it as different
169 p->ID = 0;
170
171 g_CoverInfo.nCubesFree++;
172}
Cube * s_CubesFree
Definition exorCubes.c:84
Cube * p
Definition exorList.c:222
ABC_NAMESPACE_IMPL_START cinfo g_CoverInfo
GLOBAL VARIABLES ///.
Definition exor.c:58
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ AllocateCover()

int AllocateCover ( int nCubes,
int nWordsIn,
int nWordsOut )

FUNCTIONS OF THIS MODULE ///.

CUBE COVER MEMORY MANAGEMENT //.

Definition at line 90 of file exorCubes.c.

93{
94 int OneCubeSize;
95 int OneInputSetSize;
96 Cube ** pp;
97 int TotalSize;
98 int i, k;
99
100 // determine the size of one cube WITH storage for bits
101 OneCubeSize = sizeof(Cube) + (nWordsIn+nWordsOut)*sizeof(unsigned);
102 // determine what is the amount of storage for the input part of the cube
103 OneInputSetSize = nWordsIn*sizeof(unsigned);
104
105 // allocate memory for the array of pointers
106 pp = (Cube **)ABC_ALLOC( Cube *, nCubes );
107 if ( pp == NULL )
108 return 0;
109
110 // determine the size of the total cube cover
111 TotalSize = nCubes*OneCubeSize;
112 // allocate and clear memory for the cover in one large piece
113 pp[0] = (Cube *)ABC_ALLOC( char, TotalSize );
114 if ( pp[0] == NULL )
115 return 0;
116 memset( pp[0], 0, (size_t)TotalSize );
117
118 // assign pointers to cubes and bit strings inside this piece
119 pp[0]->pCubeDataIn = (unsigned*)(pp[0] + 1);
120 pp[0]->pCubeDataOut = (unsigned*)((char*)pp[0]->pCubeDataIn + OneInputSetSize);
121 for ( i = 1; i < nCubes; i++ )
122 {
123 pp[i] = (Cube *)((char*)pp[i-1] + OneCubeSize);
124 pp[i]->pCubeDataIn = (unsigned*)(pp[i] + 1);
125 pp[i]->pCubeDataOut = (unsigned*)((char*)pp[i]->pCubeDataIn + OneInputSetSize);
126 }
127
128 // connect the cubes into the list using Next pointers
129 for ( k = 0; k < nCubes-1; k++ )
130 pp[k]->Next = pp[k+1];
131 // the last pointer is already set to NULL
132
133 // assign the head of the free list
134 s_CubesFree = pp[0];
135 // set the counters of the used and free cubes
136 g_CoverInfo.nCubesInUse = 0;
137 g_CoverInfo.nCubesFree = nCubes;
138
139 // save the pointer to the allocated memory
140 s_pCoverMemory = pp;
141
142 assert ( g_CoverInfo.nCubesInUse + g_CoverInfo.nCubesFree == g_CoverInfo.nCubesAlloc );
143
144 return nCubes*sizeof(Cube *) + TotalSize;
145}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
Cube ** s_pCoverMemory
EXPORTED VARIABLES ///.
Definition exorCubes.c:81
struct cube Cube
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DelocateCover()

void DelocateCover ( )

Definition at line 147 of file exorCubes.c.

148{
151}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ GetFreeCube()

Cube * GetFreeCube ( )

Definition at line 174 of file exorCubes.c.

175{
176 Cube * p;
178 p = s_CubesFree;
179 s_CubesFree = s_CubesFree->Next;
180 p->Next = NULL;
181 g_CoverInfo.nCubesFree--;
182 return p;
183}
Here is the caller graph for this function:

Variable Documentation

◆ g_CoverInfo

ABC_NAMESPACE_IMPL_START cinfo g_CoverInfo
extern

EXTERNAL FUNCTIONS ///.

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

FileName [exorCubes.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Exclusive sum-of-product minimization.]

Synopsis [Cube manipulation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id
exorCubes.c,v 1.0 2005/06/20 00:00:00 alanmi Exp

]

                                                            ///
            Implementation of EXORCISM - 4                  ///
        An Exclusive Sum-of-Product Minimizer               ///
                                                            ///
         Alan Mishchenko  <alanmi@ee.pdx.edu>               ///
                                                            ///

                                                            ///
        Cube Allocation and Free Cube Management            ///
                                                            ///

Ver. 1.0. Started - July 18, 2000. Last update - July 20, 2000 /// Ver. 1.1. Started - July 24, 2000. Last update - July 29, 2000 /// Ver. 1.2. Started - July 30, 2000. Last update - July 30, 2000 /// Ver. 1.5. Started - Aug 19, 2000. Last update - Aug 19, 2000 /// ///

This software was tested with the BDD package "CUDD", v.2.3.0 /// by Fabio Somenzi /// http://vlsi.colorado.edu/~fabio/ /// EXTERNAL VARIABLES ///

EXTERNAL FUNCTIONS ///.

MACRO DEFINITIONS ///.

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

FileName [exor.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Exclusive sum-of-product minimization.]

Synopsis [Main procedure.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id
exor.c,v 1.0 2005/06/20 00:00:00 alanmi Exp

]

                                                            ///
            Implementation of EXORCISM - 4                  ///
        An Exclusive Sum-of-Product Minimizer               ///
         Alan Mishchenko  <alanmi@ee.pdx.edu>               ///
                                                            ///

                                                            ///
                   Main Module                              ///
          ESOP Minimization Task Coordinator                ///
                                                            ///
    1) interprets command line                              ///  
    2) calls the approapriate reading procedure             ///
    3) calls the minimization module                        ///
                                                            ///

Ver. 1.0. Started - July 18, 2000. Last update - July 20, 2000 /// Ver. 1.1. Started - July 24, 2000. Last update - July 29, 2000 /// Ver. 1.4. Started - Aug 10, 2000. Last update - Aug 26, 2000 /// Ver. 1.6. Started - Sep 11, 2000. Last update - Sep 15, 2000 /// Ver. 1.7. Started - Sep 20, 2000. Last update - Sep 23, 2000 /// ///

This software was tested with the BDD package "CUDD", v.2.3.0 /// by Fabio Somenzi /// http://vlsi.colorado.edu/~fabio/ ///

Definition at line 58 of file exor.c.

◆ s_CubesFree

Cube* s_CubesFree

Definition at line 84 of file exorCubes.c.

◆ s_pCoverMemory

Cube** s_pCoverMemory

EXPORTED VARIABLES ///.

STATIC VARIABLES ///

Definition at line 81 of file exorCubes.c.