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

Go to the source code of this file.

Functions

reo_unitreoUnitsGetNextUnit (reo_man *p)
 FUNCTION DEFINITIONS ///.
 
void reoUnitsRecycleUnit (reo_man *p, reo_unit *pUnit)
 
void reoUnitsRecycleUnitList (reo_man *p, reo_plane *pPlane)
 
void reoUnitsStopDispenser (reo_man *p)
 
void reoUnitsAddUnitToPlane (reo_plane *pPlane, reo_unit *pUnit)
 

Function Documentation

◆ reoUnitsAddUnitToPlane()

void reoUnitsAddUnitToPlane ( reo_plane * pPlane,
reo_unit * pUnit )

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

Synopsis [Adds one unit to the list of units which constitutes the plane.]

Description []

SideEffects []

SeeAlso []

Definition at line 135 of file reoUnits.c.

136{
137 if ( pPlane->pHead == NULL )
138 {
139 pPlane->pHead = pUnit;
140 pUnit->Next = NULL;
141 }
142 else
143 {
144 pUnit->Next = pPlane->pHead;
145 pPlane->pHead = pUnit;
146 }
147 pPlane->statsNodes++;
148}
int statsNodes
Definition reo.h:83
reo_unit * pHead
Definition reo.h:90
reo_unit * Next
Definition reo.h:76
Here is the caller graph for this function:

◆ reoUnitsGetNextUnit()

reo_unit * reoUnitsGetNextUnit ( reo_man * p)

FUNCTION DEFINITIONS ///.

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

Synopsis [Extract the next unit from the free unit list.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file reoUnits.c.

46{
47 reo_unit * pUnit;
48 // check there are stil units to extract
49 if ( p->pUnitFreeList == NULL )
50 reoUnitsAddToFreeUnitList( p );
51 // extract the next unit from the linked list
52 pUnit = p->pUnitFreeList;
53 p->pUnitFreeList = pUnit->Next;
54 p->nUnitsUsed++;
55 return pUnit;
56}
Cube * p
Definition exorList.c:222
struct _reo_unit reo_unit
DATA STRUCTURES ///.
Definition reo.h:60
Here is the caller graph for this function:

◆ reoUnitsRecycleUnit()

void reoUnitsRecycleUnit ( reo_man * p,
reo_unit * pUnit )

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

Synopsis [Returns the unit to the free unit list.]

Description []

SideEffects []

SeeAlso []

Definition at line 69 of file reoUnits.c.

70{
71 pUnit->Next = p->pUnitFreeList;
72 p->pUnitFreeList = pUnit;
73 p->nUnitsUsed--;
74}
Here is the caller graph for this function:

◆ reoUnitsRecycleUnitList()

void reoUnitsRecycleUnitList ( reo_man * p,
reo_plane * pPlane )

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

Synopsis [Returns the list of units to the free unit list.]

Description []

SideEffects []

SeeAlso []

Definition at line 87 of file reoUnits.c.

88{
89 reo_unit * pUnit;
90 reo_unit * pTail = NULL; // Suppress "might be used uninitialized"
91
92 if ( pPlane->pHead == NULL )
93 return;
94
95 // find the tail
96 for ( pUnit = pPlane->pHead; pUnit; pUnit = pUnit->Next )
97 pTail = pUnit;
98 pTail->Next = p->pUnitFreeList;
99 p->pUnitFreeList = pPlane->pHead;
100 memset( pPlane, 0, sizeof(reo_plane) );
101// pPlane->pHead = NULL;
102}
struct _reo_plane reo_plane
Definition reo.h:61
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reoUnitsStopDispenser()

void reoUnitsStopDispenser ( reo_man * p)

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

Synopsis [Stops the unit dispenser.]

Description []

SideEffects []

SeeAlso []

Definition at line 115 of file reoUnits.c.

116{
117 int i;
118 for ( i = 0; i < p->nMemChunks; i++ )
119 ABC_FREE( p->pMemChunks[i] );
120// printf("\nThe number of chunks used is %d, each of them %d units\n", p->nMemChunks, REO_CHUNK_SIZE );
121 p->nMemChunks = 0;
122}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function: