summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/gia.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/gia/gia.h')
-rw-r--r--src/aig/gia/gia.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index b641da7f..d4b3e747 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -129,6 +129,7 @@ struct Gia_Man_t_
Vec_Int_t * vFanoutNums; // static fanout
Vec_Int_t * vFanout; // static fanout
Vec_Int_t * vMapping; // mapping for each node
+ Vec_Int_t * vCellMapping; // mapping for each node
Vec_Int_t * vPacking; // packing information
Vec_Int_t * vLutConfigs; // LUT configurations
Abc_Cex_t * pCexComb; // combinational counter-example
@@ -282,6 +283,10 @@ struct Jf_Par_t_
word Edge;
word Clause;
word Mux7;
+ float MapDelay;
+ float MapArea;
+ float MapDelayTarget;
+ float Epsilon;
float * pTimesArr;
float * pTimesReq;
};
@@ -912,20 +917,32 @@ static inline void Gia_ObjSetFanout( Gia_Man_t * p, Gia_Obj_t * pObj, int
#define Gia_ObjForEachFanoutStaticId( p, Id, FanId, i ) \
for ( i = 0; (i < Gia_ObjFanoutNumId(p, Id)) && (((FanId) = Gia_ObjFanoutId(p, Id, i)), 1); i++ )
-static inline int Gia_ManHasMapping( Gia_Man_t * p ) { return p->vMapping != NULL; }
-static inline int Gia_ObjIsLut( Gia_Man_t * p, int Id ) { return Vec_IntEntry(p->vMapping, Id) != 0; }
-static inline int Gia_ObjLutSize( Gia_Man_t * p, int Id ) { return Vec_IntEntry(p->vMapping, Vec_IntEntry(p->vMapping, Id)); }
-static inline int * Gia_ObjLutFanins( Gia_Man_t * p, int Id ) { return Vec_IntEntryP(p->vMapping, Vec_IntEntry(p->vMapping, Id)) + 1; }
-static inline int Gia_ObjLutFanin( Gia_Man_t * p, int Id, int i ) { return Gia_ObjLutFanins(p, Id)[i]; }
-static inline int Gia_ObjLutIsMux( Gia_Man_t * p, int Id ) { return (int)(Gia_ObjLutFanins(p, Id)[Gia_ObjLutSize(p, Id)] == -Id); }
-
-#define Gia_ManForEachLut( p, i ) \
+static inline int Gia_ManHasMapping( Gia_Man_t * p ) { return p->vMapping != NULL; }
+static inline int Gia_ObjIsLut( Gia_Man_t * p, int Id ) { return Vec_IntEntry(p->vMapping, Id) != 0; }
+static inline int Gia_ObjLutSize( Gia_Man_t * p, int Id ) { return Vec_IntEntry(p->vMapping, Vec_IntEntry(p->vMapping, Id)); }
+static inline int * Gia_ObjLutFanins( Gia_Man_t * p, int Id ) { return Vec_IntEntryP(p->vMapping, Vec_IntEntry(p->vMapping, Id)) + 1; }
+static inline int Gia_ObjLutFanin( Gia_Man_t * p, int Id, int i ) { return Gia_ObjLutFanins(p, Id)[i]; }
+static inline int Gia_ObjLutIsMux( Gia_Man_t * p, int Id ) { return (int)(Gia_ObjLutFanins(p, Id)[Gia_ObjLutSize(p, Id)] == -Id); }
+
+static inline int Gia_ManHasCellMapping( Gia_Man_t * p ) { return p->vCellMapping != NULL; }
+static inline int Gia_ObjIsCell( Gia_Man_t * p, int iLit ) { return Vec_IntEntry(p->vCellMapping, iLit) != 0; }
+static inline int Gia_ObjCellSize( Gia_Man_t * p, int iLit ) { return Vec_IntEntry(p->vCellMapping, Vec_IntEntry(p->vCellMapping, iLit)); }
+static inline int * Gia_ObjCellFanins( Gia_Man_t * p, int iLit ) { return Vec_IntEntryP(p->vCellMapping, Vec_IntEntry(p->vCellMapping, iLit))+1; }
+static inline int Gia_ObjCellFanin( Gia_Man_t * p, int iLit, int i ){ return Gia_ObjCellFanins(p, iLit)[i]; }
+static inline int Gia_ObjCellId( Gia_Man_t * p, int iLit ) { return Gia_ObjCellFanins(p, iLit)[Gia_ObjCellSize(p, iLit)]; }
+
+#define Gia_ManForEachLut( p, i ) \
for ( i = 1; i < Gia_ManObjNum(p); i++ ) if ( !Gia_ObjIsLut(p, i) ) {} else
-#define Gia_LutForEachFanin( p, i, iFan, k ) \
+#define Gia_LutForEachFanin( p, i, iFan, k ) \
for ( k = 0; k < Gia_ObjLutSize(p,i) && ((iFan = Gia_ObjLutFanins(p,i)[k]),1); k++ )
-#define Gia_LutForEachFaninObj( p, i, pFanin, k ) \
+#define Gia_LutForEachFaninObj( p, i, pFanin, k ) \
for ( k = 0; k < Gia_ObjLutSize(p,i) && ((pFanin = Gia_ManObj(p, Gia_ObjLutFanins(p,i)[k])),1); k++ )
+#define Gia_ManForEachCell( p, i ) \
+ for ( i = 2; i < 2*Gia_ManObjNum(p); i++ ) if ( !Gia_ObjIsCell(p, i) ) {} else
+#define Gia_CellForEachFanin( p, i, iFanLit, k ) \
+ for ( k = 0; k < Gia_ObjCellSize(p,i) && ((iFanLit = Gia_ObjCellFanins(p,i)[k]),1); k++ )
+
////////////////////////////////////////////////////////////////////////
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////