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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Tim_ManCreateBox (Tim_Man_t *p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable, int fBlack)
 DECLARATIONS ///.
 
int Tim_ManBoxForCi (Tim_Man_t *p, int iCi)
 
int Tim_ManBoxForCo (Tim_Man_t *p, int iCo)
 
int Tim_ManBoxInputFirst (Tim_Man_t *p, int iBox)
 
int Tim_ManBoxInputLast (Tim_Man_t *p, int iBox)
 
int Tim_ManBoxOutputFirst (Tim_Man_t *p, int iBox)
 
int Tim_ManBoxOutputLast (Tim_Man_t *p, int iBox)
 
int Tim_ManBoxInputNum (Tim_Man_t *p, int iBox)
 
int Tim_ManBoxOutputNum (Tim_Man_t *p, int iBox)
 
int Tim_ManBoxDelayTableId (Tim_Man_t *p, int iBox)
 
float * Tim_ManBoxDelayTable (Tim_Man_t *p, int iBox)
 
int Tim_ManBoxIsBlack (Tim_Man_t *p, int iBox)
 
int Tim_ManBoxCopy (Tim_Man_t *p, int iBox)
 
void Tim_ManBoxSetCopy (Tim_Man_t *p, int iBox, int iCopy)
 
int Tim_ManBoxFindFromCiNum (Tim_Man_t *p, int iCiNum)
 

Function Documentation

◆ Tim_ManBoxCopy()

int Tim_ManBoxCopy ( Tim_Man_t * p,
int iBox )

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

Synopsis [Returns the copy of the box.]

Description []

SideEffects []

SeeAlso []

Definition at line 275 of file timBox.c.

276{
277 return Tim_ManBox(p, iBox)->iCopy;
278}
Cube * p
Definition exorList.c:222
Here is the caller graph for this function:

◆ Tim_ManBoxDelayTable()

float * Tim_ManBoxDelayTable ( Tim_Man_t * p,
int iBox )

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

Synopsis [Return the delay table.]

Description []

SideEffects []

SeeAlso []

Definition at line 235 of file timBox.c.

236{
237 float * pTable;
238 Tim_Box_t * pBox = Tim_ManBox(p, iBox);
239 if ( pBox->iDelayTable < 0 )
240 return NULL;
241 pTable = (float *)Vec_PtrEntry( p->vDelayTables, pBox->iDelayTable );
242 assert( (int)pTable[1] == pBox->nInputs );
243 assert( (int)pTable[2] == pBox->nOutputs );
244 return pTable;
245}
typedefABC_NAMESPACE_HEADER_START struct Tim_Box_t_ Tim_Box_t
INCLUDES ///.
Definition timInt.h:48
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Tim_ManBoxDelayTableId()

int Tim_ManBoxDelayTableId ( Tim_Man_t * p,
int iBox )

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

Synopsis [Return the delay table id.]

Description []

SideEffects []

SeeAlso []

Definition at line 219 of file timBox.c.

220{
221 return Tim_ManBox(p, iBox)->iDelayTable;
222}
Here is the caller graph for this function:

◆ Tim_ManBoxFindFromCiNum()

int Tim_ManBoxFindFromCiNum ( Tim_Man_t * p,
int iCiNum )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 307 of file timBox.c.

308{
309 Tim_Box_t * pBox;
310 int i;
311 assert( iCiNum >= 0 && iCiNum < Tim_ManCiNum(p) );
312 if ( iCiNum < Tim_ManPiNum(p) )
313 return -1;
314 Tim_ManForEachBox( p, pBox, i )
315 if ( iCiNum < Tim_ManBoxOutputFirst(p, i) )
316 return i - 1;
317 return -2;
318}
int Tim_ManBoxOutputFirst(Tim_Man_t *p, int iBox)
Definition timBox.c:155
#define Tim_ManForEachBox(p, pBox, i)
Definition timInt.h:117
int Tim_ManCiNum(Tim_Man_t *p)
Definition timMan.c:700
int Tim_ManPiNum(Tim_Man_t *p)
Definition timMan.c:708
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Tim_ManBoxForCi()

int Tim_ManBoxForCi ( Tim_Man_t * p,
int iCi )

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

Synopsis [Returns the box number for the given input.]

Description []

SideEffects []

SeeAlso []

Definition at line 87 of file timBox.c.

88{
89 if ( iCi >= p->nCis )
90 return -1;
91 return p->pCis[iCi].iObj2Box;
92}
Here is the caller graph for this function:

◆ Tim_ManBoxForCo()

int Tim_ManBoxForCo ( Tim_Man_t * p,
int iCo )

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

Synopsis [Returns the box number for the given output.]

Description []

SideEffects []

SeeAlso []

Definition at line 105 of file timBox.c.

106{
107 if ( iCo >= p->nCos )
108 return -1;
109 return p->pCos[iCo].iObj2Box;
110}
Here is the caller graph for this function:

◆ Tim_ManBoxInputFirst()

int Tim_ManBoxInputFirst ( Tim_Man_t * p,
int iBox )

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

Synopsis [Returns the first input of the box.]

Description []

SideEffects []

SeeAlso []

Definition at line 123 of file timBox.c.

124{
125 return Tim_ManBox(p, iBox)->Inouts[0];
126}
Here is the caller graph for this function:

◆ Tim_ManBoxInputLast()

int Tim_ManBoxInputLast ( Tim_Man_t * p,
int iBox )

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

Synopsis [Returns the last input of the box.]

Description []

SideEffects []

SeeAlso []

Definition at line 139 of file timBox.c.

140{
141 return Tim_ManBox(p, iBox)->Inouts[0] + Tim_ManBoxInputNum(p, iBox) - 1;
142}
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
Definition timBox.c:187
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Tim_ManBoxInputNum()

int Tim_ManBoxInputNum ( Tim_Man_t * p,
int iBox )

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

Synopsis [Returns the number of box inputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 187 of file timBox.c.

188{
189 return Tim_ManBox(p, iBox)->nInputs;
190}
Here is the caller graph for this function:

◆ Tim_ManBoxIsBlack()

int Tim_ManBoxIsBlack ( Tim_Man_t * p,
int iBox )

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

Synopsis [Return 1 if the box is black.]

Description []

SideEffects []

SeeAlso []

Definition at line 258 of file timBox.c.

259{
260 return Tim_ManBox(p, iBox)->fBlack;
261}
Here is the caller graph for this function:

◆ Tim_ManBoxOutputFirst()

int Tim_ManBoxOutputFirst ( Tim_Man_t * p,
int iBox )

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

Synopsis [Returns the first output of the box.]

Description []

SideEffects []

SeeAlso []

Definition at line 155 of file timBox.c.

156{
157 return Tim_ManBox(p, iBox)->Inouts[Tim_ManBox(p, iBox)->nInputs];
158}
Here is the caller graph for this function:

◆ Tim_ManBoxOutputLast()

int Tim_ManBoxOutputLast ( Tim_Man_t * p,
int iBox )

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

Synopsis [Returns the last output of the box.]

Description []

SideEffects []

SeeAlso []

Definition at line 171 of file timBox.c.

172{
173 return Tim_ManBox(p, iBox)->Inouts[Tim_ManBox(p, iBox)->nInputs] + Tim_ManBoxOutputNum(p, iBox) - 1;
174}
int Tim_ManBoxOutputNum(Tim_Man_t *p, int iBox)
Definition timBox.c:203
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Tim_ManBoxOutputNum()

int Tim_ManBoxOutputNum ( Tim_Man_t * p,
int iBox )

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

Synopsis [Returns the number of box outputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 203 of file timBox.c.

204{
205 return Tim_ManBox(p, iBox)->nOutputs;
206}
Here is the caller graph for this function:

◆ Tim_ManBoxSetCopy()

void Tim_ManBoxSetCopy ( Tim_Man_t * p,
int iBox,
int iCopy )

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

Synopsis [Sets the copy of the box.]

Description []

SideEffects []

SeeAlso []

Definition at line 291 of file timBox.c.

292{
293 Tim_ManBox(p, iBox)->iCopy = iCopy;
294}
Here is the caller graph for this function:

◆ Tim_ManCreateBox()

ABC_NAMESPACE_IMPL_START void Tim_ManCreateBox ( Tim_Man_t * p,
int firstIn,
int nIns,
int firstOut,
int nOuts,
int iDelayTable,
int fBlack )

DECLARATIONS ///.

ITERATORS ///.

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

FileName [timBox.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Hierarchy/timing manager.]

Synopsis [Manipulation of timing boxes.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - April 28, 2007.]

Revision [

Id
timBox.c,v 1.00 2007/04/28 00:00:00 alanmi Exp

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

Synopsis [Creates the new timing box.]

Description []

SideEffects []

SeeAlso []

Definition at line 44 of file timBox.c.

45{
46 Tim_Box_t * pBox;
47 int i;
48 if ( p->vBoxes == NULL )
49 p->vBoxes = Vec_PtrAlloc( 100 );
50 pBox = (Tim_Box_t *)Mem_FlexEntryFetch( p->pMemObj, sizeof(Tim_Box_t) + sizeof(int) * (nIns+nOuts) );
51 memset( pBox, 0, sizeof(Tim_Box_t) );
52 pBox->iBox = Vec_PtrSize( p->vBoxes );
53 Vec_PtrPush( p->vBoxes, pBox );
54 pBox->iDelayTable = iDelayTable;
55 pBox->nInputs = nIns;
56 pBox->nOutputs = nOuts;
57 pBox->fBlack = fBlack;
58 for ( i = 0; i < nIns; i++ )
59 {
60 assert( firstIn+i < p->nCos );
61 pBox->Inouts[i] = firstIn+i;
62 p->pCos[firstIn+i].iObj2Box = pBox->iBox;
63 p->pCos[firstIn+i].iObj2Num = i;
64 }
65 for ( i = 0; i < nOuts; i++ )
66 {
67 assert( firstOut+i < p->nCis );
68 pBox->Inouts[nIns+i] = firstOut+i;
69 p->pCis[firstOut+i].iObj2Box = pBox->iBox;
70 p->pCis[firstOut+i].iObj2Num = i;
71 }
72// if ( pBox->iBox < 20 )
73// printf( "%4d %4d %4d %4d \n", firstIn, nIns, firstOut, nOuts );
74}
char * Mem_FlexEntryFetch(Mem_Flex_t *p, int nBytes)
Definition mem.c:388
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function: