ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
rrr::LevelBasePartitioner< Ntk > Class Template Reference

#include <rrrLevelBasePartitioner.h>

Public Member Functions

 LevelBasePartitioner (Parameter const *pPar)
 
void AssignNetwork (Ntk *pNtk)
 
Ntk * Extract (int iSeed)
 
void Insert (Ntk *pSubNtk)
 

Detailed Description

template<typename Ntk>
class rrr::LevelBasePartitioner< Ntk >

Definition at line 16 of file rrrLevelBasePartitioner.h.

Constructor & Destructor Documentation

◆ LevelBasePartitioner()

template<typename Ntk>
rrr::LevelBasePartitioner< Ntk >::LevelBasePartitioner ( Parameter const * pPar)

Definition at line 210 of file rrrLevelBasePartitioner.h.

210 :
211 nVerbose(pPar->nPartitionerVerbose),
212 nPartitionSize(pPar->nPartitionSize),
213 nPartitionSizeMin(pPar->nPartitionSizeMin) {
214 }

Member Function Documentation

◆ AssignNetwork()

template<typename Ntk>
void rrr::LevelBasePartitioner< Ntk >::AssignNetwork ( Ntk * pNtk)

Definition at line 217 of file rrrLevelBasePartitioner.h.

217 {
218 pNtk = pNtk_;
219 assert(mSubNtk2Io.empty());
220 assert(sBlocked.empty());
221 vFailed.clear();
222 vLevels.clear();
223 }
#define assert(ex)
Definition util_old.h:213

◆ Extract()

template<typename Ntk>
Ntk * rrr::LevelBasePartitioner< Ntk >::Extract ( int iSeed)

Definition at line 230 of file rrrLevelBasePartitioner.h.

230 {
231 // pick a center node from candidates that do not belong to any other ongoing partitions
232 vFailed.resize(pNtk->GetNumNodes());
233 if(vLevels.empty()) {
234 ComputeLevel();
235 }
237 std::vector<int> vInts = pNtk->GetInts();
238 std::shuffle(vInts.begin(), vInts.end(), rng);
239 for(int i = 0; i < int_size(vInts); i++) {
240 int id = vInts[i];
241 if(vFailed[id]) {
242 continue;
243 }
244 if(!sBlocked.count(id)) {
245 Print(0, "try partitioning with node", id, "(", i, "/", int_size(vInts), ")");
246 Ntk *pSubNtk = ExtractIOI(id);
247 if(pSubNtk) {
248 return pSubNtk;
249 }
250 }
251 vFailed[id] = true;
252 }
253 return NULL;
254 }

◆ Insert()

template<typename Ntk>
void rrr::LevelBasePartitioner< Ntk >::Insert ( Ntk * pSubNtk)

Definition at line 257 of file rrrLevelBasePartitioner.h.

257 {
258 for(int i: std::get<0>(mSubNtk2Io[pSubNtk])) {
259 sBlocked.erase(i);
260 }
265 // need to remap updated outputs that are used as inputs in other partitions
267 for(int idx = 0; idx < int_size(vOldOutputs); idx++) {
269 }
270 for(auto &entry: mSubNtk2Io) {
271 if(entry.first != pSubNtk) {
274 for(int i = 0; i < int_size(vInputs); i++) {
275 if(mOutput2Idx.count(vInputs[i])) {
276 int idx = mOutput2Idx[vInputs[i]];
279 }
280 }
281 }
282 }
283 delete pSubNtk;
284 mSubNtk2Io.erase(pSubNtk);
285 vFailed.clear(); // clear, there isn't really a way to track
286 vLevels.clear();
287 }

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