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

#include <rrrPartitioner.h>

Public Member Functions

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

Detailed Description

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

Definition at line 16 of file rrrPartitioner.h.

Constructor & Destructor Documentation

◆ Partitioner()

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

Definition at line 266 of file rrrPartitioner.h.

266 :
267 nVerbose(pPar->nPartitionerVerbose),
268 nPartitionSize(pPar->nPartitionSize),
269 nPartitionSizeMin(pPar->nPartitionSizeMin) {
270 }

Member Function Documentation

◆ AssignNetwork()

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

Definition at line 273 of file rrrPartitioner.h.

273 {
274 pNtk = pNtk_;
275 assert(mSubNtk2Io.empty());
276 assert(sBlocked.empty());
277 vFailed.clear();
278 }
#define assert(ex)
Definition util_old.h:213

◆ Extract()

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

Definition at line 285 of file rrrPartitioner.h.

285 {
286 // pick a center node from candidates that do not belong to any other ongoing partitions
287 vFailed.resize(pNtk->GetNumNodes());
289 std::vector<int> vInts = pNtk->GetInts();
290 std::shuffle(vInts.begin(), vInts.end(), rng);
291 for(int i = 0; i < int_size(vInts); i++) {
292 int id = vInts[i];
293 if(vFailed[id]) {
294 continue;
295 }
296 if(!sBlocked.count(id)) {
297 Print(0, "try partitioning with node", id, "(", i, "/", int_size(vInts), ")");
298 Ntk *pSubNtk = ExtractDisjoint(id);
299 if(pSubNtk) {
300 return pSubNtk;
301 }
302 }
303 vFailed[id] = true;
304 }
305 return NULL;
306 }

◆ Insert()

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

Definition at line 309 of file rrrPartitioner.h.

309 {
310 for(int i: std::get<0>(mSubNtk2Io[pSubNtk])) {
311 sBlocked.erase(i);
312 }
317 // need to remap updated outputs that are used as inputs in other partitions
319 for(int idx = 0; idx < int_size(vOldOutputs); idx++) {
321 }
322 for(auto &entry: mSubNtk2Io) {
323 if(entry.first != pSubNtk) {
326 for(int i = 0; i < int_size(vInputs); i++) {
327 if(mOutput2Idx.count(vInputs[i])) {
328 int idx = mOutput2Idx[vInputs[i]];
331 }
332 }
333 }
334 }
335 delete pSubNtk;
336 mSubNtk2Io.erase(pSubNtk);
337 vFailed.clear(); // clear, there isn't really a way to track
338 }
void Insert(Ntk *pSubNtk)

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