ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
ac_wrapper.cpp File Reference
#include "ac_wrapper.h"
#include "ac_decomposition.hpp"
#include "acd66.hpp"
#include "acdXX.hpp"
Include dependency graph for ac_wrapper.cpp:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int acd_evaluate (word *pTruth, unsigned nVars, int lutSize, unsigned *pdelay, unsigned *cost, int try_no_late_arrival)
 
int acd_decompose (word *pTruth, unsigned nVars, int lutSize, unsigned *pdelay, unsigned char *decomposition)
 
int acd2_evaluate (word *pTruth, unsigned nVars, int lutSize, unsigned *pdelay, unsigned *cost, int try_no_late_arrival)
 
int acd2_decompose (word *pTruth, unsigned nVars, int lutSize, unsigned *pdelay, unsigned char *decomposition)
 
int acd66_evaluate (word *pTruth, unsigned nVars)
 
int acdXX_evaluate (word *pTruth, unsigned lutSize, unsigned nVars)
 
int acdXX_decompose (word *pTruth, unsigned lutSize, unsigned nVars, unsigned char *decomposition)
 

Function Documentation

◆ acd2_decompose()

int acd2_decompose ( word * pTruth,
unsigned nVars,
int lutSize,
unsigned * pdelay,
unsigned char * decomposition )

Definition at line 98 of file ac_wrapper.cpp.

99{
100 using namespace acd;
101
102 acdXX_params ps;
103 ps.lut_size = lutSize;
104 ps.max_shared_vars = lutSize - 2;
105 acdXX_impl acd( nVars, ps );
106 acd.run( pTruth, *pdelay );
107 int val = acd.compute_decomposition();
108
109 if ( val != 0 )
110 {
111 *pdelay = 0;
112 return -1;
113 }
114
115 *pdelay = acd.get_profile();
116
117 acd.get_decomposition( decomposition );
118 return 0;
119}
uint32_t lut_size
Definition acdXX.hpp:55
uint32_t max_shared_vars
Definition acdXX.hpp:58
Here is the caller graph for this function:

◆ acd2_evaluate()

int acd2_evaluate ( word * pTruth,
unsigned nVars,
int lutSize,
unsigned * pdelay,
unsigned * cost,
int try_no_late_arrival )

Definition at line 75 of file ac_wrapper.cpp.

76{
77 using namespace acd;
78
79 acdXX_params ps;
80 ps.lut_size = lutSize;
81 ps.max_shared_vars = lutSize - 2;
82 acdXX_impl acd( nVars, ps );
83 int val = acd.run( pTruth, *pdelay );
84
85 if ( val == 0 )
86 {
87 *pdelay = 0;
88 return -1;
89 }
90
91 acd.compute_decomposition();
92 *pdelay = acd.get_profile();
93 *cost = 2;
94
95 return val;
96}
Here is the caller graph for this function:

◆ acd66_evaluate()

int acd66_evaluate ( word * pTruth,
unsigned nVars )
inline

Definition at line 121 of file ac_wrapper.cpp.

122{
123 using namespace acd;
124
125 acd66_impl acd( nVars, true, false );
126
127 if ( acd.run( pTruth ) == 0 )
128 return 0;
129
130 return 1;
131}
Here is the caller graph for this function:

◆ acd_decompose()

int acd_decompose ( word * pTruth,
unsigned nVars,
int lutSize,
unsigned * pdelay,
unsigned char * decomposition )

Definition at line 51 of file ac_wrapper.cpp.

52{
53 using namespace acd;
54
56 ps.lut_size = lutSize;
57 ps.use_first = true;
59
60 ac_decomposition_impl acd( nVars, ps, &st );
61 acd.run( pTruth, *pdelay );
62 int val = acd.compute_decomposition();
63
64 if ( val < 0 )
65 {
66 *pdelay = 0;
67 return -1;
68 }
69
70 *pdelay = acd.get_profile();
71 acd.get_decomposition( decomposition );
72 return 0;
73}
Parameters for ac_decomposition.
bool use_first
Use the first feasible decomposition found.
uint32_t lut_size
LUT size for decomposition (3 < num < 7).
Statistics for ac_decomposition.
Here is the caller graph for this function:

◆ acd_evaluate()

ABC_NAMESPACE_IMPL_START int acd_evaluate ( word * pTruth,
unsigned nVars,
int lutSize,
unsigned * pdelay,
unsigned * cost,
int try_no_late_arrival )

C++File**************************************************************

FileName [ac_wrapper.cpp]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Ashenhurst-Curtis decomposition.]

Synopsis [Interface with the FPGA mapping package.]

Author [Alessandro Tempia Calvino]

Affiliation [EPFL]

Date [Ver. 1.0. Started - November 20, 2023.]

Definition at line 26 of file ac_wrapper.cpp.

27{
28 using namespace acd;
29
31 ps.lut_size = lutSize;
32 ps.use_first = false;
33 ps.try_no_late_arrival = static_cast<bool>( try_no_late_arrival );
35
36 ac_decomposition_impl acd( nVars, ps, &st );
37 int val = acd.run( pTruth, *pdelay );
38
39 if ( val < 0 )
40 {
41 *pdelay = 0;
42 return -1;
43 }
44
45 *pdelay = acd.get_profile();
46 *cost = st.num_luts;
47
48 return val;
49}
bool try_no_late_arrival
If decomposition with delay profile fails, try without.
Here is the caller graph for this function:

◆ acdXX_decompose()

int acdXX_decompose ( word * pTruth,
unsigned lutSize,
unsigned nVars,
unsigned char * decomposition )

Definition at line 153 of file ac_wrapper.cpp.

154{
155 using namespace acd;
156
157 acdXX_params ps;
158 ps.lut_size = lutSize;
159
160 for ( int i = 0; i <= lutSize - 2; ++i )
161 {
162 ps.max_shared_vars = i;
163 ps.min_shared_vars = i;
164 acdXX_impl acd( nVars, ps );
165
166 if ( acd.run( pTruth ) == 0 )
167 continue;
168 acd.compute_decomposition();
169 acd.get_decomposition( decomposition );
170 return 0;
171 }
172
173 return 1;
174}
uint32_t min_shared_vars
Definition acdXX.hpp:61
Here is the caller graph for this function:

◆ acdXX_evaluate()

int acdXX_evaluate ( word * pTruth,
unsigned lutSize,
unsigned nVars )

Definition at line 133 of file ac_wrapper.cpp.

134{
135 using namespace acd;
136
137 if ( lutSize == 6 )
138 {
139 return acd66_evaluate( pTruth, nVars );
140 }
141
142 acdXX_params ps;
143 ps.lut_size = lutSize;
144 ps.max_shared_vars = lutSize - 2;
145 acdXX_impl acd( nVars, ps );
146
147 if ( acd.run( pTruth ) == 0 )
148 return 0;
149
150 return 1;
151}
int acd66_evaluate(word *pTruth, unsigned nVars)
Here is the call graph for this function:
Here is the caller graph for this function: