summaryrefslogtreecommitdiffstats
path: root/src/misc/tim
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-09-23 18:34:10 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2012-09-23 18:34:10 -0700
commit40d9b5853b2849c3bf7e2157a4b4c6b798b043d5 (patch)
tree7c49799a451a3148a757efb35762ffa7c7aa2d01 /src/misc/tim
parentf7caf84f21ff02b12e41be6b7e1fdfeeab3a560f (diff)
downloadabc-40d9b5853b2849c3bf7e2157a4b4c6b798b043d5.tar.gz
abc-40d9b5853b2849c3bf7e2157a4b4c6b798b043d5.tar.bz2
abc-40d9b5853b2849c3bf7e2157a4b4c6b798b043d5.zip
Testing GIA with time manager.
Diffstat (limited to 'src/misc/tim')
-rw-r--r--src/misc/tim/tim.h3
-rw-r--r--src/misc/tim/timBox.c71
-rw-r--r--src/misc/tim/timDump.c9
-rw-r--r--src/misc/tim/timInt.h1
-rw-r--r--src/misc/tim/timMan.c9
5 files changed, 75 insertions, 18 deletions
diff --git a/src/misc/tim/tim.h b/src/misc/tim/tim.h
index 1eb1de78..f2024f4f 100644
--- a/src/misc/tim/tim.h
+++ b/src/misc/tim/tim.h
@@ -64,7 +64,10 @@ extern int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox );
extern int Tim_ManBoxOutputFirst( Tim_Man_t * p, int iBox );
extern int Tim_ManBoxInputNum( Tim_Man_t * p, int iBox );
extern int Tim_ManBoxOutputNum( Tim_Man_t * p, int iBox );
+extern int Tim_ManBoxDelayTableId( Tim_Man_t * p, int iBox );
extern float * Tim_ManBoxDelayTable( Tim_Man_t * p, int iBox );
+extern int Tim_ManBoxCopy( Tim_Man_t * p, int iBox );
+extern void Tim_ManBoxSetCopy( Tim_Man_t * p, int iBox, int iCopy );
/*=== timDump.c ===========================================================*/
extern Vec_Str_t * Tim_ManSave( Tim_Man_t * p );
extern Tim_Man_t * Tim_ManLoad( Vec_Str_t * p );
diff --git a/src/misc/tim/timBox.c b/src/misc/tim/timBox.c
index c1176527..82488561 100644
--- a/src/misc/tim/timBox.c
+++ b/src/misc/tim/timBox.c
@@ -121,13 +121,12 @@ int Tim_ManBoxForCo( Tim_Man_t * p, int iCo )
***********************************************************************/
int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox )
{
- Tim_Box_t * pBox = (Tim_Box_t *)Vec_PtrEntry( p->vBoxes, iBox );
- return pBox->Inouts[0];
+ return Tim_ManBox(p, iBox)->Inouts[0];
}
/**Function*************************************************************
- Synopsis [Returns the first input of the box.]
+ Synopsis [Returns the first output of the box.]
Description []
@@ -138,13 +137,12 @@ int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox )
***********************************************************************/
int Tim_ManBoxOutputFirst( Tim_Man_t * p, int iBox )
{
- Tim_Box_t * pBox = (Tim_Box_t *)Vec_PtrEntry( p->vBoxes, iBox );
- return pBox->Inouts[pBox->nInputs];
+ return Tim_ManBox(p, iBox)->Inouts[Tim_ManBox(p, iBox)->nInputs];
}
/**Function*************************************************************
- Synopsis [Returns the first input of the box.]
+ Synopsis [Returns the number of box inputs.]
Description []
@@ -155,13 +153,12 @@ int Tim_ManBoxOutputFirst( Tim_Man_t * p, int iBox )
***********************************************************************/
int Tim_ManBoxInputNum( Tim_Man_t * p, int iBox )
{
- Tim_Box_t * pBox = (Tim_Box_t *)Vec_PtrEntry( p->vBoxes, iBox );
- return pBox->nInputs;
+ return Tim_ManBox(p, iBox)->nInputs;
}
/**Function*************************************************************
- Synopsis [Returns the first input of the box.]
+ Synopsis [Returns the number of box outputs.]
Description []
@@ -172,13 +169,28 @@ int Tim_ManBoxInputNum( Tim_Man_t * p, int iBox )
***********************************************************************/
int Tim_ManBoxOutputNum( Tim_Man_t * p, int iBox )
{
- Tim_Box_t * pBox = (Tim_Box_t *)Vec_PtrEntry( p->vBoxes, iBox );
- return pBox->nOutputs;
+ return Tim_ManBox(p, iBox)->nOutputs;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Return the delay table id.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Tim_ManBoxDelayTableId( Tim_Man_t * p, int iBox )
+{
+ return Tim_ManBox(p, iBox)->iDelayTable;
}
/**Function*************************************************************
- Synopsis []
+ Synopsis [Return the delay table.]
Description []
@@ -190,7 +202,7 @@ int Tim_ManBoxOutputNum( Tim_Man_t * p, int iBox )
float * Tim_ManBoxDelayTable( Tim_Man_t * p, int iBox )
{
float * pTable;
- Tim_Box_t * pBox = (Tim_Box_t *)Vec_PtrEntry( p->vBoxes, iBox );
+ Tim_Box_t * pBox = Tim_ManBox(p, iBox);
if ( pBox->iDelayTable < 0 )
return NULL;
pTable = (float *)Vec_PtrEntry( p->vDelayTables, pBox->iDelayTable );
@@ -199,6 +211,39 @@ float * Tim_ManBoxDelayTable( Tim_Man_t * p, int iBox )
return pTable;
}
+/**Function*************************************************************
+
+ Synopsis [Returns the copy of the box.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Tim_ManBoxCopy( Tim_Man_t * p, int iBox )
+{
+ return Tim_ManBox(p, iBox)->iCopy;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Sets the copy of the box.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Tim_ManBoxSetCopy( Tim_Man_t * p, int iBox, int iCopy )
+{
+ Tim_ManBox(p, iBox)->iCopy = iCopy;
+}
+
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
diff --git a/src/misc/tim/timDump.c b/src/misc/tim/timDump.c
index eb9a14a9..8664202b 100644
--- a/src/misc/tim/timDump.c
+++ b/src/misc/tim/timDump.c
@@ -62,13 +62,14 @@ Vec_Str_t * Tim_ManSave( Tim_Man_t * p )
Vec_StrPutI_ne( vStr, Tim_ManPoNum(p) );
// save number of boxes
Vec_StrPutI_ne( vStr, Tim_ManBoxNum(p) );
- // for each box, save num_inputs, num_outputs, and delay table ID
+ // for each box, save num_inputs, num_outputs, delay table ID, and copy field
if ( Tim_ManBoxNum(p) > 0 )
Tim_ManForEachBox( p, pBox, i )
{
Vec_StrPutI_ne( vStr, Tim_ManBoxInputNum(p, pBox->iBox) );
Vec_StrPutI_ne( vStr, Tim_ManBoxOutputNum(p, pBox->iBox) );
- Vec_StrPutI_ne( vStr, pBox->iDelayTable ); // can be -1 if delay table is not given
+ Vec_StrPutI_ne( vStr, Tim_ManBoxDelayTableId(p, pBox->iBox) ); // can be -1 if delay table is not given
+ Vec_StrPutI_ne( vStr, Tim_ManBoxCopy(p, pBox->iBox) ); // can be -1 if the copy is node defined
}
// save the number of delay tables
Vec_StrPutI_ne( vStr, Tim_ManDelayTableNum(p) );
@@ -110,7 +111,7 @@ Tim_Man_t * Tim_ManLoad( Vec_Str_t * p )
{
Tim_Man_t * pMan;
int VerNum, nCis, nCos, nPis, nPos;
- int nBoxes, nBoxIns, nBoxOuts;
+ int nBoxes, nBoxIns, nBoxOuts, CopyBox;
int TableId, nTables, TableSize, TableX, TableY;
int i, k, curPi, curPo, iStr = 0;
float * pDelayTable;
@@ -138,7 +139,9 @@ Tim_Man_t * Tim_ManLoad( Vec_Str_t * p )
nBoxIns = Vec_StrGetI_ne( p, &iStr );
nBoxOuts = Vec_StrGetI_ne( p, &iStr );
TableId = Vec_StrGetI_ne( p, &iStr );
+ CopyBox = Vec_StrGetI_ne( p, &iStr );
Tim_ManCreateBox( pMan, curPo, nBoxIns, curPi, nBoxOuts, TableId );
+ Tim_ManBoxSetCopy( pMan, i, CopyBox );
curPi += nBoxOuts;
curPo += nBoxIns;
}
diff --git a/src/misc/tim/timInt.h b/src/misc/tim/timInt.h
index 6fe5a94c..ccca12e7 100644
--- a/src/misc/tim/timInt.h
+++ b/src/misc/tim/timInt.h
@@ -70,6 +70,7 @@ struct Tim_Box_t_
int nInputs; // the number of box inputs (POs)
int nOutputs; // the number of box outputs (PIs)
int iDelayTable; // index of the delay table
+ int iCopy; // copy of this box
int Inouts[0]; // the int numbers of PIs and POs
};
diff --git a/src/misc/tim/timMan.c b/src/misc/tim/timMan.c
index c177a707..6aa5034a 100644
--- a/src/misc/tim/timMan.c
+++ b/src/misc/tim/timMan.c
@@ -186,7 +186,9 @@ void Tim_ManPrint( Tim_Man_t * p )
Tim_Obj_t * pObj, * pPrev;
float * pTable;
int i, j, k, TableX, TableY;
- printf( "TIMING INFORMATION:\n" );
+ if ( p == NULL )
+ return;
+ printf( "TIMING MANAGER:\n" );
// print CI info
pPrev = p->pCis;
@@ -214,7 +216,10 @@ void Tim_ManPrint( Tim_Man_t * p )
if ( Tim_ManBoxNum(p) > 0 )
Tim_ManForEachBox( p, pBox, i )
{
- printf( "*** Box %5d : Ins = %4d. Outs = %4d. DelayTable = %4d\n", i, pBox->nInputs, pBox->nOutputs, pBox->iDelayTable );
+ printf( "*** Box %5d : I =%4d. O =%4d. I1 =%6d. O1 =%6d. Table =%4d\n",
+ i, pBox->nInputs, pBox->nOutputs,
+ Tim_ManBoxInputFirst(p, i), Tim_ManBoxOutputFirst(p, i),
+ pBox->iDelayTable );
// print box inputs
pPrev = Tim_ManBoxInput( p, pBox, 0 );