ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cutSeq.c File Reference
#include "cutInt.h"
Include dependency graph for cutSeq.c:

Go to the source code of this file.

Functions

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

◆ Cut_NodeComputeCutsSeq()

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 72 of file cutSeq.c.

73{
74 Cut_List_t Super, * pSuper = &Super;
75 Cut_Cut_t * pListNew;
76 abctime clk;
77
78 // get the number of cuts at the node
79 p->nNodeCuts = Cut_CutCountList( Cut_NodeReadCutsOld(p, Node) );
80 if ( p->nNodeCuts >= p->pParams->nKeepMax )
81 return;
82
83 // count only the first visit
84 if ( p->nNodeCuts == 0 )
85 p->nNodes++;
86
87 // store the fanin lists
88 p->pStore0[0] = Cut_NodeReadCutsOld( p, Node0 );
89 p->pStore0[1] = Cut_NodeReadCutsNew( p, Node0 );
90 p->pStore1[0] = Cut_NodeReadCutsOld( p, Node1 );
91 p->pStore1[1] = Cut_NodeReadCutsNew( p, Node1 );
92
93 // duplicate the cut lists if fanin nodes are non-standard
94 if ( Node == Node0 || Node == Node1 || Node0 == Node1 )
95 {
96 p->pStore0[0] = Cut_CutDupList( p, p->pStore0[0] );
97 p->pStore0[1] = Cut_CutDupList( p, p->pStore0[1] );
98 p->pStore1[0] = Cut_CutDupList( p, p->pStore1[0] );
99 p->pStore1[1] = Cut_CutDupList( p, p->pStore1[1] );
100 }
101
102 // shift the cuts by as many latches and recompute signatures
103 if ( nLat0 ) Cut_NodeShiftCutLeaves( p->pStore0[0], nLat0 );
104 if ( nLat0 ) Cut_NodeShiftCutLeaves( p->pStore0[1], nLat0 );
105 if ( nLat1 ) Cut_NodeShiftCutLeaves( p->pStore1[0], nLat1 );
106 if ( nLat1 ) Cut_NodeShiftCutLeaves( p->pStore1[1], nLat1 );
107
108 // store the original lists for comparison
109 p->pCompareOld = Cut_NodeReadCutsOld( p, Node );
110 p->pCompareNew = Cut_NodeReadCutsNew( p, Node );
111
112 // merge the old and the new
113clk = Abc_Clock();
114 Cut_ListStart( pSuper );
115 Cut_NodeDoComputeCuts( p, pSuper, Node, fCompl0, fCompl1, p->pStore0[0], p->pStore1[1], 0, 0 );
116 Cut_NodeDoComputeCuts( p, pSuper, Node, fCompl0, fCompl1, p->pStore0[1], p->pStore1[0], 0, 0 );
117 Cut_NodeDoComputeCuts( p, pSuper, Node, fCompl0, fCompl1, p->pStore0[1], p->pStore1[1], fTriv, 0 );
118 pListNew = Cut_ListFinish( pSuper );
119p->timeMerge += Abc_Clock() - clk;
120
121 // shift the cuts by as many latches and recompute signatures
122 if ( Node == Node0 || Node == Node1 || Node0 == Node1 )
123 {
124 Cut_CutRecycleList( p, p->pStore0[0] );
125 Cut_CutRecycleList( p, p->pStore0[1] );
126 Cut_CutRecycleList( p, p->pStore1[0] );
127 Cut_CutRecycleList( p, p->pStore1[1] );
128 }
129 else
130 {
131 if ( nLat0 ) Cut_NodeShiftCutLeaves( p->pStore0[0], -nLat0 );
132 if ( nLat0 ) Cut_NodeShiftCutLeaves( p->pStore0[1], -nLat0 );
133 if ( nLat1 ) Cut_NodeShiftCutLeaves( p->pStore1[0], -nLat1 );
134 if ( nLat1 ) Cut_NodeShiftCutLeaves( p->pStore1[1], -nLat1 );
135 }
136
137 // set the lists at the node
138 if ( CutSetNum >= 0 )
139 {
140 assert( Cut_NodeReadCutsTemp(p, CutSetNum) == NULL );
141 Cut_NodeWriteCutsTemp( p, CutSetNum, pListNew );
142 }
143 else
144 {
145 assert( Cut_NodeReadCutsNew(p, Node) == NULL );
146 Cut_NodeWriteCutsNew( p, Node, pListNew );
147 }
148
149 // mark the node if we exceeded the number of cuts
150 if ( p->nNodeCuts >= p->pParams->nKeepMax )
151 p->nCutsLimit++;
152}
ABC_INT64_T abctime
Definition abc_global.h:332
void Cut_CutRecycleList(Cut_Man_t *p, Cut_Cut_t *pList)
Definition cutCut.c:148
Cut_Cut_t * Cut_CutDupList(Cut_Man_t *p, Cut_Cut_t *pList)
Definition cutCut.c:120
void Cut_NodeDoComputeCuts(Cut_Man_t *p, Cut_List_t *pSuper, int Node, int fCompl0, int fCompl1, Cut_Cut_t *pList0, Cut_Cut_t *pList1, int fTriv, int TreeCode)
Definition cutNode.c:572
typedefABC_NAMESPACE_HEADER_START struct Cut_ListStruct_t_ Cut_List_t
INCLUDES ///.
Definition cutList.h:40
Cut_Cut_t * Cut_NodeReadCutsOld(Cut_Man_t *p, int Node)
Definition cutApi.c:63
int Cut_CutCountList(Cut_Cut_t *pList)
Definition cutCut.c:166
void Cut_NodeWriteCutsTemp(Cut_Man_t *p, int Node, Cut_Cut_t *pList)
Definition cutApi.c:129
void Cut_NodeWriteCutsNew(Cut_Man_t *p, int Node, Cut_Cut_t *pList)
Definition cutApi.c:97
Cut_Cut_t * Cut_NodeReadCutsNew(Cut_Man_t *p, int Node)
MACRO DEFINITIONS ///.
Definition cutApi.c:45
struct Cut_CutStruct_t_ Cut_Cut_t
Definition cut.h:50
Cut_Cut_t * Cut_NodeReadCutsTemp(Cut_Man_t *p, int Node)
Definition cutApi.c:80
Cube * p
Definition exorList.c:222
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cut_NodeNewMergeWithOld()

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 165 of file cutSeq.c.

166{
167 Cut_Cut_t * pListOld, * pListNew, * pList;
168 // get the new cuts
169 pListNew = Cut_NodeReadCutsNew( p, Node );
170 if ( pListNew == NULL )
171 return;
172 Cut_NodeWriteCutsNew( p, Node, NULL );
173 // get the old cuts
174 pListOld = Cut_NodeReadCutsOld( p, Node );
175 if ( pListOld == NULL )
176 {
177 Cut_NodeWriteCutsOld( p, Node, pListNew );
178 return;
179 }
180 // merge the lists
181 pList = Cut_CutMergeLists( pListOld, pListNew );
182 Cut_NodeWriteCutsOld( p, Node, pList );
183}
Cut_Cut_t * Cut_CutMergeLists(Cut_Cut_t *pList1, Cut_Cut_t *pList2)
Definition cutCut.c:185
void Cut_NodeWriteCutsOld(Cut_Man_t *p, int Node, Cut_Cut_t *pList)
Definition cutApi.c:113
Here is the call graph for this function:

◆ Cut_NodeOldTransferToNew()

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 217 of file cutSeq.c.

218{
219 Cut_Cut_t * pList;
220 pList = Cut_NodeReadCutsOld( p, Node );
221 Cut_NodeWriteCutsOld( p, Node, NULL );
222 Cut_NodeWriteCutsNew( p, Node, pList );
223// Cut_CutListVerify( pList );
224}
Here is the call graph for this function:

◆ Cut_NodeTempTransferToNew()

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 197 of file cutSeq.c.

198{
199 Cut_Cut_t * pList;
200 pList = Cut_NodeReadCutsTemp( p, CutSetNum );
201 Cut_NodeWriteCutsTemp( p, CutSetNum, NULL );
202 Cut_NodeWriteCutsNew( p, Node, pList );
203 return pList != NULL;
204}
Here is the call graph for this function: