summaryrefslogtreecommitdiffstats
path: root/src/opt/rwr/rwr.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-08-27 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-08-27 08:01:00 -0700
commit28db025b8393e307328d51ff6901c4ebab669e95 (patch)
tree3866dd659505646c64eccdb672930bf0ebb849c2 /src/opt/rwr/rwr.h
parent9093ca53201519ef03dedb7044345fc716cc0643 (diff)
downloadabc-28db025b8393e307328d51ff6901c4ebab669e95.tar.gz
abc-28db025b8393e307328d51ff6901c4ebab669e95.tar.bz2
abc-28db025b8393e307328d51ff6901c4ebab669e95.zip
Version abc50827
Diffstat (limited to 'src/opt/rwr/rwr.h')
-rw-r--r--src/opt/rwr/rwr.h55
1 files changed, 26 insertions, 29 deletions
diff --git a/src/opt/rwr/rwr.h b/src/opt/rwr/rwr.h
index 5d190745..6e127b27 100644
--- a/src/opt/rwr/rwr.h
+++ b/src/opt/rwr/rwr.h
@@ -26,6 +26,7 @@
////////////////////////////////////////////////////////////////////////
#include "abc.h"
+#include "cut.h"
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
@@ -39,7 +40,6 @@
typedef struct Rwr_Man_t_ Rwr_Man_t;
typedef struct Rwr_Node_t_ Rwr_Node_t;
-typedef struct Rwr_Cut_t_ Rwr_Cut_t;
struct Rwr_Man_t_
{
@@ -50,7 +50,7 @@ struct Rwr_Man_t_
char * pPerms; // canonical permutations
unsigned char * pMap; // mapping of functions into class numbers
char * pPractical; // practical NPN classes
- unsigned short ** puPerms43; // four-var permutations for three var functions
+ char ** pPerms4; // four-var permutations
// node space
Vec_Ptr_t * vForest; // all the nodes
Rwr_Node_t ** pTable; // the hash table of nodes by their canonical form
@@ -61,19 +61,26 @@ struct Rwr_Man_t_
int nConsidered; // the number of nodes considered
int nAdded; // the number of nodes added to lists
int nClasses; // the number of NN classes
- // intermediate data
- Vec_Int_t * vFanNums; // the number of fanouts of each node (used to free cuts)
- Vec_Int_t * vReqTimes; // the required times for each node (used for delay-driven evalution)
// the result of resynthesis
+ int fCompl; // indicates if the output of FF should be complemented
Vec_Int_t * vForm; // the decomposition tree (temporary)
- Vec_Int_t * vLevNums; // the array of levels (temporary)
Vec_Ptr_t * vFanins; // the fanins array (temporary)
- int nGainMax;
+ Vec_Ptr_t * vFaninsCur; // the fanins array (temporary)
+ Vec_Int_t * vLevNums; // the array of levels (temporary)
+ // node statistics
+ int nNodesConsidered;
+ int nNodesRewritten;
+ int nNodesGained;
+ int nScores[222];
+ int nCutsGood;
+ int nCutsBad;
+ int nSubgraphs;
// runtime statistics
- int time1;
- int time2;
- int time3;
- int time4;
+ int timeStart;
+ int timeCut;
+ int timeRes;
+ int timeEval;
+ int timeTotal;
};
struct Rwr_Node_t_ // 24 bytes
@@ -90,18 +97,6 @@ struct Rwr_Node_t_ // 24 bytes
Rwr_Node_t * pNext; // next in the table
};
-struct Rwr_Cut_t_ // 24 bytes
-{
- unsigned nLeaves : 3; // the number of leaves
- unsigned fTime : 1; // set to 1 if meets the required times
- unsigned fGain : 1; // set to 1 if does not increase nodes
- unsigned Volume : 11; // the gain in the number of nodes
- unsigned uTruth : 16; // the truth table
- Abc_Obj_t * ppLeaves[4]; // the leaves
- Rwr_Cut_t * pNext; // the next cut in the list
-};
-
-
// manipulation of complemented attributes
static inline bool Rwr_IsComplement( Rwr_Node_t * p ) { return (bool)(((unsigned)p) & 01); }
static inline Rwr_Node_t * Rwr_Regular( Rwr_Node_t * p ) { return (Rwr_Node_t *)((unsigned)(p) & ~01); }
@@ -116,12 +111,10 @@ static inline Rwr_Node_t * Rwr_NotCond( Rwr_Node_t * p, int c ) { return (Rwr_N
/// FUNCTION DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-/*=== rwrCut.c ========================================================*/
-extern void Rwr_NtkStartCuts( Rwr_Man_t * p, Abc_Ntk_t * pNtk );
-extern void Rwr_NodeComputeCuts( Rwr_Man_t * p, Abc_Obj_t * pNode );
-/*=== rwrEva.c ========================================================*/
-extern int Rwr_NodeRewrite( Rwr_Man_t * p, Abc_Obj_t * pNode );
+/*=== rwrDec.c ========================================================*/
extern void Rwr_ManPreprocess( Rwr_Man_t * p );
+/*=== rwrEva.c ========================================================*/
+extern int Rwr_NodeRewrite( Rwr_Man_t * p, Cut_Man_t * pManCut, Abc_Obj_t * pNode, int fUseZeros );
/*=== rwrLib.c ========================================================*/
extern void Rwr_ManPrecompute( Rwr_Man_t * p );
extern Rwr_Node_t * Rwr_ManAddVar( Rwr_Man_t * p, unsigned uTruth, int fPrecompute );
@@ -131,14 +124,18 @@ extern void Rwr_ManIncTravId( Rwr_Man_t * p );
/*=== rwrMan.c ========================================================*/
extern Rwr_Man_t * Rwr_ManStart( bool fPrecompute );
extern void Rwr_ManStop( Rwr_Man_t * p );
+extern void Rwr_ManPrintStats( Rwr_Man_t * p );
extern void Rwr_ManPrepareNetwork( Rwr_Man_t * p, Abc_Ntk_t * pNtk );
extern Vec_Ptr_t * Rwr_ManReadFanins( Rwr_Man_t * p );
extern Vec_Int_t * Rwr_ManReadDecs( Rwr_Man_t * p );
+extern int Rwr_ManReadCompl( Rwr_Man_t * p );
+extern void Rwr_ManAddTimeCuts( Rwr_Man_t * p, int Time );
+extern void Rwr_ManAddTimeTotal( Rwr_Man_t * p, int Time );
/*=== rwrPrint.c ========================================================*/
extern void Rwr_ManPrint( Rwr_Man_t * p );
/*=== rwrUtil.c ========================================================*/
extern void Rwr_ManWriteToArray( Rwr_Man_t * p );
-extern void Rwr_ManLoadFromArray( Rwr_Man_t * p );
+extern void Rwr_ManLoadFromArray( Rwr_Man_t * p, int fVerbose );
extern void Rwr_ManWriteToFile( Rwr_Man_t * p, char * pFileName );
extern void Rwr_ManLoadFromFile( Rwr_Man_t * p, char * pFileName );
extern Vec_Int_t * Rwt_NtkFanoutCounters( Abc_Ntk_t * pNtk );