src/opt/cut/cutSeq.c File Reference

#include "cutInt.h"
Include dependency graph for cutSeq.c:

Go to the source code of this file.

Functions

static void Cut_NodeShiftCutLeaves (Cut_Cut_t *pList, int nLat)
void Cut_NodeComputeCutsSeq (Cut_Man_t *p, int Node, int Node0, int Node1, int fCompl0, int fCompl1, int nLat0, int nLat1, int fTriv, int CutSetNum)
void Cut_NodeNewMergeWithOld (Cut_Man_t *p, int Node)
int Cut_NodeTempTransferToNew (Cut_Man_t *p, int Node, int CutSetNum)
void Cut_NodeOldTransferToNew (Cut_Man_t *p, int Node)

Function Documentation

void Cut_NodeComputeCutsSeq ( Cut_Man_t p,
int  Node,
int  Node0,
int  Node1,
int  fCompl0,
int  fCompl1,
int  nLat0,
int  nLat1,
int  fTriv,
int  CutSetNum 
)

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

Synopsis [Computes sequential cuts for the node from its fanins.]

Description []

SideEffects []

SeeAlso []

Definition at line 69 of file cutSeq.c.

00070 {
00071     Cut_List_t Super, * pSuper = &Super;
00072     Cut_Cut_t * pListNew;
00073     int clk;
00074     
00075     // get the number of cuts at the node
00076     p->nNodeCuts = Cut_CutCountList( Cut_NodeReadCutsOld(p, Node) );
00077     if ( p->nNodeCuts >= p->pParams->nKeepMax )
00078         return;
00079 
00080     // count only the first visit
00081     if ( p->nNodeCuts == 0 )
00082         p->nNodes++;
00083 
00084     // store the fanin lists
00085     p->pStore0[0] = Cut_NodeReadCutsOld( p, Node0 );
00086     p->pStore0[1] = Cut_NodeReadCutsNew( p, Node0 );
00087     p->pStore1[0] = Cut_NodeReadCutsOld( p, Node1 );
00088     p->pStore1[1] = Cut_NodeReadCutsNew( p, Node1 );
00089 
00090     // duplicate the cut lists if fanin nodes are non-standard
00091     if ( Node == Node0 || Node == Node1 || Node0 == Node1 )
00092     {
00093         p->pStore0[0] = Cut_CutDupList( p, p->pStore0[0] );
00094         p->pStore0[1] = Cut_CutDupList( p, p->pStore0[1] );
00095         p->pStore1[0] = Cut_CutDupList( p, p->pStore1[0] );
00096         p->pStore1[1] = Cut_CutDupList( p, p->pStore1[1] );
00097     }
00098 
00099     // shift the cuts by as many latches and recompute signatures
00100     if ( nLat0 ) Cut_NodeShiftCutLeaves( p->pStore0[0], nLat0 );
00101     if ( nLat0 ) Cut_NodeShiftCutLeaves( p->pStore0[1], nLat0 );
00102     if ( nLat1 ) Cut_NodeShiftCutLeaves( p->pStore1[0], nLat1 );
00103     if ( nLat1 ) Cut_NodeShiftCutLeaves( p->pStore1[1], nLat1 );
00104 
00105     // store the original lists for comparison
00106     p->pCompareOld = Cut_NodeReadCutsOld( p, Node );
00107     p->pCompareNew = Cut_NodeReadCutsNew( p, Node );
00108 
00109     // merge the old and the new
00110 clk = clock();
00111     Cut_ListStart( pSuper );
00112     Cut_NodeDoComputeCuts( p, pSuper, Node, fCompl0, fCompl1, p->pStore0[0], p->pStore1[1], 0, 0 );
00113     Cut_NodeDoComputeCuts( p, pSuper, Node, fCompl0, fCompl1, p->pStore0[1], p->pStore1[0], 0, 0 );
00114     Cut_NodeDoComputeCuts( p, pSuper, Node, fCompl0, fCompl1, p->pStore0[1], p->pStore1[1], fTriv, 0 );
00115     pListNew = Cut_ListFinish( pSuper );
00116 p->timeMerge += clock() - clk;
00117 
00118     // shift the cuts by as many latches and recompute signatures
00119     if ( Node == Node0 || Node == Node1 || Node0 == Node1 )
00120     {
00121         Cut_CutRecycleList( p, p->pStore0[0] );
00122         Cut_CutRecycleList( p, p->pStore0[1] );
00123         Cut_CutRecycleList( p, p->pStore1[0] );
00124         Cut_CutRecycleList( p, p->pStore1[1] );
00125     }
00126     else
00127     {
00128         if ( nLat0 ) Cut_NodeShiftCutLeaves( p->pStore0[0], -nLat0 );
00129         if ( nLat0 ) Cut_NodeShiftCutLeaves( p->pStore0[1], -nLat0 );
00130         if ( nLat1 ) Cut_NodeShiftCutLeaves( p->pStore1[0], -nLat1 );
00131         if ( nLat1 ) Cut_NodeShiftCutLeaves( p->pStore1[1], -nLat1 );
00132     }
00133 
00134     // set the lists at the node
00135     if ( CutSetNum >= 0 )
00136     {
00137         assert( Cut_NodeReadCutsTemp(p, CutSetNum) == NULL );
00138         Cut_NodeWriteCutsTemp( p, CutSetNum, pListNew );
00139     }
00140     else
00141     {
00142         assert( Cut_NodeReadCutsNew(p, Node) == NULL );
00143         Cut_NodeWriteCutsNew( p, Node, pListNew );
00144     }
00145 
00146     // mark the node if we exceeded the number of cuts
00147     if ( p->nNodeCuts >= p->pParams->nKeepMax )
00148         p->nCutsLimit++;
00149 }

void Cut_NodeNewMergeWithOld ( Cut_Man_t p,
int  Node 
)

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

Synopsis [Merges the new cuts with the old cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 162 of file cutSeq.c.

00163 {
00164     Cut_Cut_t * pListOld, * pListNew, * pList;
00165     // get the new cuts
00166     pListNew = Cut_NodeReadCutsNew( p, Node );
00167     if ( pListNew == NULL )
00168         return;
00169     Cut_NodeWriteCutsNew( p, Node, NULL );
00170     // get the old cuts
00171     pListOld = Cut_NodeReadCutsOld( p, Node );
00172     if ( pListOld == NULL )
00173     {
00174         Cut_NodeWriteCutsOld( p, Node, pListNew );
00175         return;
00176     }
00177     // merge the lists
00178     pList = Cut_CutMergeLists( pListOld, pListNew );
00179     Cut_NodeWriteCutsOld( p, Node, pList );
00180 }

void Cut_NodeOldTransferToNew ( Cut_Man_t p,
int  Node 
)

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

Synopsis [Transfers the old cuts to be the new cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 214 of file cutSeq.c.

00215 {
00216     Cut_Cut_t * pList;
00217     pList = Cut_NodeReadCutsOld( p, Node );
00218     Cut_NodeWriteCutsOld( p, Node, NULL );
00219     Cut_NodeWriteCutsNew( p, Node, pList );
00220 //    Cut_CutListVerify( pList );
00221 }

static void Cut_NodeShiftCutLeaves ( Cut_Cut_t pList,
int  nLat 
) [inline, static]

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

FileName [cutSeq.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [K-feasible cut computation package.]

Synopsis [Sequential cut computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cutSeq.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

] DECLARATIONS /// FUNCTION DEFINITIONS ///Function*************************************************************

Synopsis [Shifts all cut leaves of the node by the given number of latches.]

Description []

SideEffects []

SeeAlso []

Definition at line 42 of file cutSeq.c.

00043 {
00044     Cut_Cut_t * pTemp;
00045     int i;
00046     // shift the cuts by as many latches
00047     Cut_ListForEachCut( pList, pTemp )
00048     {
00049         pTemp->uSign = 0;
00050         for ( i = 0; i < (int)pTemp->nLeaves; i++ )
00051         {
00052             pTemp->pLeaves[i] += nLat;
00053             pTemp->uSign      |= Cut_NodeSign( pTemp->pLeaves[i] );
00054         }
00055     }
00056 }

int Cut_NodeTempTransferToNew ( Cut_Man_t p,
int  Node,
int  CutSetNum 
)

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

Synopsis [Transfers the temporary cuts to be the new cuts.]

Description [Returns 1 if something was transferred.]

SideEffects []

SeeAlso []

Definition at line 194 of file cutSeq.c.

00195 {
00196     Cut_Cut_t * pList;
00197     pList = Cut_NodeReadCutsTemp( p, CutSetNum );
00198     Cut_NodeWriteCutsTemp( p, CutSetNum, NULL );
00199     Cut_NodeWriteCutsNew( p, Node, pList );
00200     return pList != NULL;
00201 }


Generated on Tue Jan 5 12:19:24 2010 for abc70930 by  doxygen 1.6.1