summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abcPrint.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-04-09 14:32:46 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-04-09 14:32:46 -0700
commit91d80a63d8f35a523b1805b55d32e390547a7bed (patch)
tree9695fad4d4e3a096014f7bfe20f4a4c8aaf0cfe7 /src/base/abci/abcPrint.c
parent46ab68ba17a6b50c5fd2a4c0566dc3e805bc11bd (diff)
downloadabc-91d80a63d8f35a523b1805b55d32e390547a7bed.tar.gz
abc-91d80a63d8f35a523b1805b55d32e390547a7bed.tar.bz2
abc-91d80a63d8f35a523b1805b55d32e390547a7bed.zip
Updating cost function to be the number of edges in ps -b.
Diffstat (limited to 'src/base/abci/abcPrint.c')
-rw-r--r--src/base/abci/abcPrint.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c
index b13018fc..52556d6d 100644
--- a/src/base/abci/abcPrint.c
+++ b/src/base/abci/abcPrint.c
@@ -67,6 +67,7 @@ int Abc_NtkCompareAndSaveBest( Abc_Ntk_t * pNtk )
int Depth; // depth of the best saved network
int Flops; // flops in the best saved network
int Nodes; // nodes in the best saved network
+ int Edges; // edges in the best saved network
int nPis; // the number of primary inputs
int nPos; // the number of primary outputs
} ParsNew, ParsBest = { 0 };
@@ -84,6 +85,7 @@ int Abc_NtkCompareAndSaveBest( Abc_Ntk_t * pNtk )
ParsNew.Depth = Abc_NtkLevel( pNtk );
ParsNew.Flops = Abc_NtkLatchNum( pNtk );
ParsNew.Nodes = Abc_NtkNodeNum( pNtk );
+ ParsNew.Edges = Abc_NtkGetTotalFanins( pNtk );
ParsNew.nPis = Abc_NtkPiNum( pNtk );
ParsNew.nPos = Abc_NtkPoNum( pNtk );
// reset the parameters if the network has the same name
@@ -91,13 +93,14 @@ int Abc_NtkCompareAndSaveBest( Abc_Ntk_t * pNtk )
strcmp(ParsBest.pName, pNtk->pName) ||
ParsBest.Depth > ParsNew.Depth ||
(ParsBest.Depth == ParsNew.Depth && ParsBest.Flops > ParsNew.Flops) ||
- (ParsBest.Depth == ParsNew.Depth && ParsBest.Flops == ParsNew.Flops && ParsBest.Nodes > ParsNew.Nodes) )
+ (ParsBest.Depth == ParsNew.Depth && ParsBest.Flops == ParsNew.Flops && ParsBest.Edges > ParsNew.Edges) )
{
ABC_FREE( ParsBest.pName );
ParsBest.pName = Extra_UtilStrsav( pNtk->pName );
ParsBest.Depth = ParsNew.Depth;
ParsBest.Flops = ParsNew.Flops;
ParsBest.Nodes = ParsNew.Nodes;
+ ParsBest.Edges = ParsNew.Edges;
ParsBest.nPis = ParsNew.nPis;
ParsBest.nPos = ParsNew.nPos;
// writ the network