From 91d80a63d8f35a523b1805b55d32e390547a7bed Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 9 Apr 2014 14:32:46 -0700 Subject: Updating cost function to be the number of edges in ps -b. --- src/base/abci/abcPrint.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/base') 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 -- cgit v1.2.3