ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
acd::acdXX_impl Class Reference

#include <acdXX.hpp>

Public Member Functions

 acdXX_impl (uint32_t const num_vars, acdXX_params const &ps={})
 
bool run (word *ptt)
 Runs ACD XX.
 
int run (word *ptt, unsigned delay_profile)
 Runs ACD XX.
 
int compute_decomposition ()
 
uint32_t get_num_edges ()
 
unsigned get_profile ()
 
void get_decomposition (unsigned char *decompArray)
 

Detailed Description

Definition at line 67 of file acdXX.hpp.

Constructor & Destructor Documentation

◆ acdXX_impl()

acd::acdXX_impl::acdXX_impl ( uint32_t const num_vars,
acdXX_params const & ps = {} )
inlineexplicit

Definition at line 75 of file acdXX.hpp.

75 {} )
76 : num_vars( num_vars ), ps( ps )
77 {
78 std::iota( permutations.begin(), permutations.end(), 0 );
79 }

Member Function Documentation

◆ compute_decomposition()

int acd::acdXX_impl::compute_decomposition ( )
inline

Definition at line 133 of file acdXX.hpp.

134 {
135 if ( best_multiplicity == UINT32_MAX )
136 return -1;
137
138 compute_decomposition_impl();
139
140 if ( ps.verify && !verify_impl() )
141 {
142 return 1;
143 }
144
145 return 0;
146 }
#define UINT32_MAX
Definition pstdint.h:388

◆ get_decomposition()

void acd::acdXX_impl::get_decomposition ( unsigned char * decompArray)
inline

Definition at line 186 of file acdXX.hpp.

187 {
188 if ( bs_support_size == UINT32_MAX )
189 return;
190
191 get_decomposition_abc( decompArray );
192 }

◆ get_num_edges()

uint32_t acd::acdXX_impl::get_num_edges ( )
inline

Definition at line 148 of file acdXX.hpp.

149 {
150 if ( bs_support_size == UINT32_MAX )
151 {
152 return num_vars + 1 + num_shared_vars;
153 }
154
155 /* real value after support minimization */
156 return bs_support_size + best_free_set + 1 + num_shared_vars;
157 }

◆ get_profile()

unsigned acd::acdXX_impl::get_profile ( )
inline

Definition at line 160 of file acdXX.hpp.

161 {
162 unsigned profile = 0;
163
164 if ( best_multiplicity == UINT32_MAX )
165 return -1;
166
167 if ( bs_support_size == UINT32_MAX )
168 {
169 for ( uint32_t i = 0; i < best_free_set; ++i )
170 {
171 profile |= 1 << permutations[i];
172 }
173 }
174 else
175 {
176 for ( uint32_t i = 0; i < bs_support_size; ++i )
177 {
178 profile |= 1 << permutations[bs_support[i] + best_free_set];
179 }
180 profile = ~profile & ( ( 1u << num_vars ) - 1 );
181 }
182
183 return profile;
184 }
unsigned int uint32_t
Definition Fxch.h:32

◆ run() [1/2]

bool acd::acdXX_impl::run ( word * ptt)
inline

Runs ACD XX.

Definition at line 82 of file acdXX.hpp.

83 {
84 assert( num_vars > 4 );
85
86 /* truth table is too large for the settings */
87 if ( num_vars > max_num_vars || num_vars >= 2 * ps.lut_size )
88 {
89 return false;
90 }
91
92 /* saturate the maximum number of shared variables */
93 ps.max_shared_vars = std::min( ps.max_shared_vars, ps.lut_size - 2 );
94
95 /* convert to static TT */
96 init_truth_table( ptt );
97
98 /* run ACD trying different bound sets and free sets */
99 return find_decomposition();
100 }
#define assert(ex)
Definition util_old.h:213

◆ run() [2/2]

int acd::acdXX_impl::run ( word * ptt,
unsigned delay_profile )
inline

Runs ACD XX.

Definition at line 103 of file acdXX.hpp.

104 {
105 assert( num_vars > 4 );
106
107 /* truth table is too large for the settings */
108 if ( num_vars > max_num_vars || num_vars >= 2 * ps.lut_size )
109 {
110 return 0;
111 }
112
113 uint32_t late_arriving = __builtin_popcount( delay_profile );
114
115 /* too many late arriving variables */
116 if ( late_arriving >= ps.lut_size )
117 return 0;
118
119 /* saturate the maximum number of shared variables */
120 ps.max_shared_vars = std::min( ps.max_shared_vars, ps.lut_size - 2 );
121
122 /* convert to static TT */
123 init_truth_table( ptt );
124 best_tt = start_tt;
125
126 /* permute late arriving variables to be the least significant */
127 reposition_late_arriving_variables( delay_profile, late_arriving );
128
129 /* run ACD trying different bound sets and free sets */
130 return find_decomposition_offset( late_arriving ) ? ( delay_profile == 0 ? 2 : 1 ) : 0;
131 }

The documentation for this class was generated from the following file: