src/aig/ivy/ivyCanon.c File Reference

#include "ivy.h"
Include dependency graph for ivyCanon.c:

Go to the source code of this file.

Functions

static Ivy_Obj_tIvy_TableLookupPair_rec (Ivy_Man_t *p, Ivy_Obj_t *pObj0, Ivy_Obj_t *pObj1, int fCompl0, int fCompl1, Ivy_Type_t Type)
Ivy_Obj_tIvy_CanonPair_rec (Ivy_Man_t *p, Ivy_Obj_t *pGhost)
Ivy_Obj_tIvy_CanonAnd (Ivy_Man_t *p, Ivy_Obj_t *pObj0, Ivy_Obj_t *pObj1)
Ivy_Obj_tIvy_CanonExor (Ivy_Man_t *p, Ivy_Obj_t *pObj0, Ivy_Obj_t *pObj1)
Ivy_Obj_tIvy_CanonLatch (Ivy_Man_t *p, Ivy_Obj_t *pObj, Ivy_Init_t Init)

Function Documentation

Ivy_Obj_t* Ivy_CanonAnd ( Ivy_Man_t p,
Ivy_Obj_t pObj0,
Ivy_Obj_t pObj1 
)

Function*************************************************************

Synopsis [Creates the canonical form of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 87 of file ivyCanon.c.

00088 {
00089     Ivy_Obj_t * pGhost, * pResult;
00090     pGhost = Ivy_ObjCreateGhost( p, pObj0, pObj1, IVY_AND, IVY_INIT_NONE );
00091     pResult = Ivy_CanonPair_rec( p, pGhost );
00092     return pResult;
00093 }

Ivy_Obj_t* Ivy_CanonExor ( Ivy_Man_t p,
Ivy_Obj_t pObj0,
Ivy_Obj_t pObj1 
)

Function*************************************************************

Synopsis [Creates the canonical form of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 106 of file ivyCanon.c.

00107 {
00108     Ivy_Obj_t * pGhost, * pResult;
00109     int fCompl = Ivy_IsComplement(pObj0) ^ Ivy_IsComplement(pObj1);
00110     pObj0 = Ivy_Regular(pObj0);
00111     pObj1 = Ivy_Regular(pObj1);
00112     pGhost = Ivy_ObjCreateGhost( p, pObj0, pObj1, IVY_EXOR, IVY_INIT_NONE );
00113     pResult = Ivy_CanonPair_rec( p, pGhost );
00114     return Ivy_NotCond( pResult, fCompl );
00115 }

Ivy_Obj_t* Ivy_CanonLatch ( Ivy_Man_t p,
Ivy_Obj_t pObj,
Ivy_Init_t  Init 
)

Function*************************************************************

Synopsis [Creates the canonical form of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 128 of file ivyCanon.c.

00129 {
00130     Ivy_Obj_t * pGhost, * pResult;
00131     int fCompl = Ivy_IsComplement(pObj);
00132     pObj = Ivy_Regular(pObj);
00133     pGhost = Ivy_ObjCreateGhost( p, pObj, NULL, IVY_LATCH, Ivy_InitNotCond(Init, fCompl) );
00134     pResult = Ivy_TableLookup( p, pGhost );
00135     if ( pResult == NULL )
00136         pResult = Ivy_ObjCreate( p, pGhost );
00137     return Ivy_NotCond( pResult, fCompl );
00138 }

Ivy_Obj_t* Ivy_CanonPair_rec ( Ivy_Man_t p,
Ivy_Obj_t pGhost 
)

FUNCTION DEFINITIONS ///Function*************************************************************

Synopsis [Creates the canonical form of the node.]

Description []

SideEffects []

SeeAlso []

remember the latches

Definition at line 44 of file ivyCanon.c.

00045 {
00046     Ivy_Obj_t * pResult, * pLat0, * pLat1;
00047     Ivy_Init_t Init, Init0, Init1;
00048     int fCompl0, fCompl1;
00049     Ivy_Type_t Type;
00050     assert( Ivy_ObjIsNode(pGhost) );
00051     assert( Ivy_ObjIsAnd(pGhost) || (!Ivy_ObjFaninC0(pGhost) && !Ivy_ObjFaninC1(pGhost)) );
00052     assert( Ivy_ObjFaninId0(pGhost) != 0 && Ivy_ObjFaninId1(pGhost) != 0 );
00053     // consider the case when the pair is canonical
00054     if ( !Ivy_ObjIsLatch(Ivy_ObjFanin0(pGhost)) || !Ivy_ObjIsLatch(Ivy_ObjFanin1(pGhost)) )
00055     {
00056         if ( pResult = Ivy_TableLookup( p, pGhost ) )
00057             return pResult;
00058         return Ivy_ObjCreate( p, pGhost );
00059     }
00061     pLat0 = Ivy_ObjFanin0(pGhost);
00062     pLat1 = Ivy_ObjFanin1(pGhost);
00063     // remember type and compls
00064     Type = Ivy_ObjType(pGhost);
00065     fCompl0 = Ivy_ObjFaninC0(pGhost);
00066     fCompl1 = Ivy_ObjFaninC1(pGhost);
00067     // call recursively
00068     pResult = Ivy_Oper( p, Ivy_NotCond(Ivy_ObjFanin0(pLat0), fCompl0), Ivy_NotCond(Ivy_ObjFanin0(pLat1), fCompl1), Type );
00069     // build latch on top of this
00070     Init0 = Ivy_InitNotCond( Ivy_ObjInit(pLat0), fCompl0 );
00071     Init1 = Ivy_InitNotCond( Ivy_ObjInit(pLat1), fCompl1 );
00072     Init  = (Type == IVY_AND)? Ivy_InitAnd(Init0, Init1) : Ivy_InitExor(Init0, Init1);
00073     return Ivy_Latch( p, pResult, Init );
00074 }

static Ivy_Obj_t* Ivy_TableLookupPair_rec ( Ivy_Man_t p,
Ivy_Obj_t pObj0,
Ivy_Obj_t pObj1,
int  fCompl0,
int  fCompl1,
Ivy_Type_t  Type 
) [static]

CFile****************************************************************

FileName [ivyCanon.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [And-Inverter Graph package.]

Synopsis [Finding canonical form of objects.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - May 11, 2006.]

Revision [

Id
ivyCanon.c,v 1.00 2006/05/11 00:00:00 alanmi Exp

] DECLARATIONS ///


Generated on Tue Jan 5 12:18:23 2010 for abc70930 by  doxygen 1.6.1