14{
16 int nFrames;
17 int nConfs;
18 int nProps;
19 int fStruct = 0;
20 int fOldAlgo = 0;
21 int fVerbose;
22 int c;
25
26 nFrames = 1;
27 nConfs = 1000;
28 nProps = 1000;
29 fVerbose = 0;
32 {
33 switch ( c )
34 {
35
36
37
38
39
40
41
42
43
44
45
46 case 'C':
48 {
49 Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
51 }
54 if ( nConfs < 0 )
56 break;
57 case 'P':
59 {
60 Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
62 }
65 if ( nProps < 0 )
67 break;
68 case 'v':
69 fVerbose ^= 1;
70 break;
71 case 'h':
73 default:
75 }
76 }
77 if ( pNtk == NULL )
78 {
79 Abc_Print( -1, "Empty network.\n" );
80 return 1;
81 }
82 if ( Abc_NtkIsComb(pNtk) )
83 {
84 Abc_Print( -1, "The network is combinational.\n" );
85 return 0;
86 }
87 if ( !Abc_NtkIsStrash(pNtk) )
88 {
89 Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
90 return 0;
91 }
92 if ( Abc_NtkConstrNum(pNtk) > 0 )
93 {
94 Abc_Print( -1, "Constraints are already extracted.\n" );
95 return 0;
96 }
97 if ( Abc_NtkPoNum(pNtk) > 1 && !fStruct )
98 {
99 Abc_Print( -1, "Functional constraint extraction works for single-output miters (use \"orpos\").\n" );
100 return 0;
101 }
102
103 pNtkRes =
Abc_NtkDarUnfold2( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
104 if ( pNtkRes == NULL )
105 {
106 Abc_Print( 1,"Transformation has failed.\n" );
107 return 0;
108 }
109
111 return 0;
113 Abc_Print( -2, "usage: unfold2 [-FCP num] [-savh]\n" );
114 Abc_Print( -2, "\t unfold hidden constraints as separate outputs\n" );
115 Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
116 Abc_Print( -2, "\t-P num : the max number of constraint propagations [default = %d]\n", nProps );
117 Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
118 Abc_Print( -2, "\t-h : print the command usage\n");
119 return 1;
120}
Abc_Ntk_t * Abc_NtkDarUnfold2(Abc_Ntk_t *pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose)