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

#include <acd66.hpp>

Public Member Functions

 acd66_impl (uint32_t const num_vars, bool multiple_shared_set=false, bool const verify=false)
 
bool run (word *ptt)
 Runs ACD 66.
 
int run (word *ptt, unsigned delay_profile)
 Runs ACD 66.
 
int compute_decomposition ()
 
uint32_t get_num_edges ()
 
unsigned get_profile ()
 
void get_decomposition (unsigned char *decompArray)
 

Detailed Description

Definition at line 52 of file acd66.hpp.

Constructor & Destructor Documentation

◆ acd66_impl()

acd::acd66_impl::acd66_impl ( uint32_t const num_vars,
bool multiple_shared_set = false,
bool const verify = false )
inlineexplicit

Definition at line 60 of file acd66.hpp.

61 : num_vars( num_vars ), multiple_ss( multiple_shared_set ), verify( verify )
62 {
63 std::iota( permutations.begin(), permutations.end(), 0 );
64 }

Member Function Documentation

◆ compute_decomposition()

int acd::acd66_impl::compute_decomposition ( )
inline

Definition at line 112 of file acd66.hpp.

113 {
114 if ( best_multiplicity == UINT32_MAX )
115 return -1;
116
117 compute_decomposition_impl();
118
119 if ( verify && !verify_impl() )
120 {
121 return 1;
122 }
123
124 return 0;
125 }
#define UINT32_MAX
Definition pstdint.h:388

◆ get_decomposition()

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

Definition at line 165 of file acd66.hpp.

166 {
167 if ( bs_support_size == UINT32_MAX )
168 return;
169
170 get_decomposition_abc( decompArray );
171 }

◆ get_num_edges()

uint32_t acd::acd66_impl::get_num_edges ( )
inline

Definition at line 127 of file acd66.hpp.

128 {
129 if ( bs_support_size == UINT32_MAX )
130 {
131 return num_vars + 1 + num_shared_vars;
132 }
133
134 /* real value after support minimization */
135 return bs_support_size + best_free_set + 1 + num_shared_vars;
136 }

◆ get_profile()

unsigned acd::acd66_impl::get_profile ( )
inline

Definition at line 139 of file acd66.hpp.

140 {
141 unsigned profile = 0;
142
143 if ( best_multiplicity == UINT32_MAX )
144 return -1;
145
146 if ( bs_support_size == UINT32_MAX )
147 {
148 for ( uint32_t i = 0; i < best_free_set; ++i )
149 {
150 profile |= 1 << permutations[i];
151 }
152 }
153 else
154 {
155 for ( uint32_t i = 0; i < bs_support_size; ++i )
156 {
157 profile |= 1 << permutations[bs_support[i] + best_free_set];
158 }
159 profile = ~profile & ( ( 1u << num_vars ) - 1 );
160 }
161
162 return profile;
163 }
unsigned int uint32_t
Definition Fxch.h:32

◆ run() [1/2]

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

Runs ACD 66.

Definition at line 67 of file acd66.hpp.

68 {
69 assert( num_vars > 6 );
70
71 /* truth table is too large for the settings */
72 if ( num_vars > max_num_vars || num_vars > 11 )
73 {
74 return false;
75 }
76
77 /* convert to static TT */
78 init_truth_table( ptt );
79
80 /* run ACD trying different bound sets and free sets */
81 return find_decomposition();
82 }
#define assert(ex)
Definition util_old.h:213

◆ run() [2/2]

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

Runs ACD 66.

Definition at line 85 of file acd66.hpp.

86 {
87 assert( num_vars > 6 );
88
89 /* truth table is too large for the settings */
90 if ( num_vars > max_num_vars || num_vars > 11 )
91 {
92 return false;
93 }
94
95 uint32_t late_arriving = __builtin_popcount( delay_profile );
96
97 /* too many late arriving variables */
98 if ( late_arriving > 5 )
99 return 0;
100
101 /* convert to static TT */
102 init_truth_table( ptt );
103 best_tt = start_tt;
104
105 /* permute late arriving variables to be the least significant */
106 reposition_late_arriving_variables( delay_profile, late_arriving );
107
108 /* run ACD trying different bound sets and free sets */
109 return find_decomposition_offset( late_arriving ) ? ( delay_profile == 0 ? 2 : 1 ) : 0;
110 }

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