summaryrefslogtreecommitdiffstats
path: root/src/misc/tim/timMan.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-10-04 17:45:24 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-10-04 17:45:24 -0700
commita1e9f668a88f01dccda8da1bc5ca8e22211b1751 (patch)
tree277a1c1e6b11945a906ae5e8c0c4e6fa8feb0bd8 /src/misc/tim/timMan.c
parent26dc25b7f5e23689636b4d89b98281e821cf7fe8 (diff)
downloadabc-a1e9f668a88f01dccda8da1bc5ca8e22211b1751.tar.gz
abc-a1e9f668a88f01dccda8da1bc5ca8e22211b1751.tar.bz2
abc-a1e9f668a88f01dccda8da1bc5ca8e22211b1751.zip
Adding support for black boxes in extended AIG.
Diffstat (limited to 'src/misc/tim/timMan.c')
-rw-r--r--src/misc/tim/timMan.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/misc/tim/timMan.c b/src/misc/tim/timMan.c
index 87e7e0f3..8cec9788 100644
--- a/src/misc/tim/timMan.c
+++ b/src/misc/tim/timMan.c
@@ -145,7 +145,7 @@ Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fUnitDelay )
Tim_ManForEachBox( p, pBox, i )
{
Tim_ManCreateBox( pNew, pBox->Inouts[0], pBox->nInputs,
- pBox->Inouts[pBox->nInputs], pBox->nOutputs, pBox->iDelayTable );
+ pBox->Inouts[pBox->nInputs], pBox->nOutputs, pBox->iDelayTable, pBox->fBlack );
Tim_ManBoxSetCopy( pNew, i, pBox->iCopy );
}
}
@@ -228,7 +228,7 @@ Tim_Man_t * Tim_ManTrim( Tim_Man_t * p, Vec_Int_t * vBoxPres )
Tim_ManForEachBox( p, pBox, i )
if ( Vec_IntEntry(vBoxPres, i) )
{
- Tim_ManCreateBox( pNew, curPo, pBox->nInputs, curPi, pBox->nOutputs, pBox->iDelayTable );
+ Tim_ManCreateBox( pNew, curPo, pBox->nInputs, curPi, pBox->nOutputs, pBox->iDelayTable, pBox->fBlack );
Tim_ManBoxSetCopy( pNew, Tim_ManBoxNum(pNew) - 1, Tim_ManBoxCopy(p, i) == -1 ? i : Tim_ManBoxCopy(p, i) );
curPi += pBox->nOutputs;
curPo += pBox->nInputs;
@@ -321,7 +321,7 @@ Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft, int nTermsDiff
Vec_IntForEachEntry( vBoxesLeft, iBox, i )
{
pBox = Tim_ManBox( p, iBox );
- Tim_ManCreateBox( pNew, curPo, pBox->nInputs, curPi, pBox->nOutputs, pBox->iDelayTable );
+ Tim_ManCreateBox( pNew, curPo, pBox->nInputs, curPi, pBox->nOutputs, pBox->iDelayTable, pBox->fBlack );
Tim_ManBoxSetCopy( pNew, Tim_ManBoxNum(pNew) - 1, Tim_ManBoxCopy(p, iBox) == -1 ? iBox : Tim_ManBoxCopy(p, iBox) );
curPi += pBox->nOutputs;
curPo += pBox->nInputs;
@@ -730,6 +730,20 @@ int Tim_ManBlackBoxNum( Tim_Man_t * p )
Counter += pBox->fBlack;
return Counter;
}
+void Tim_ManBlackBoxIoNum( Tim_Man_t * p, int * pnBbIns, int * pnBbOuts )
+{
+ Tim_Box_t * pBox;
+ int i;
+ *pnBbIns = *pnBbOuts = 0;
+ if ( Tim_ManBoxNum(p) )
+ Tim_ManForEachBox( p, pBox, i )
+ {
+ if ( !pBox->fBlack )
+ continue;
+ *pnBbIns += Tim_ManBoxInputNum( p, i );
+ *pnBbOuts += Tim_ManBoxOutputNum( p, i );
+ }
+}
int Tim_ManDelayTableNum( Tim_Man_t * p )
{
return p->vDelayTables ? Vec_PtrSize(p->vDelayTables) : 0;