-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleCircuit.h
36 lines (29 loc) · 1.28 KB
/
SampleCircuit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <vector>
#include "base/main/main.h"
#include "base/main/mainInt.h"
using namespace std;
class SampleCircuit{
public:
SampleCircuit();
SampleCircuit(int nPI, int nPO);
void setIOnum(int nPI, int nPO);
void setRndSeed(unsigned seed) {srand(seed);}
Abc_Ntk_t* genRand(bool fVerbose=false);
Abc_Ntk_t* genRandCof(bool fVerbose=false);
Abc_Ntk_t* genCircuit(bool fVerbose=false, bool fFastgen=false, std::ostream& out=std::cout);
Abc_Ntk_t** genParCircuit(int nPar, bool fVerbose=false, bool fFastgen=false, std::ostream& out=std::cout);
Abc_Ntk_t* genCircuit(Abc_Ntk_t* pNtk, bool fVerbose=false, bool fFastgen=false, std::ostream& out=std::cout);
Abc_Ntk_t* connect(Abc_Ntk_t* pCkt, Abc_Ntk_t* pNtk, char* pName="sampled");
private:
bool fInit;
int nPI;
int nPO;
unsigned seed;
Abc_Ntk_t* initCircuit(int nPI, int nPO, char*);
void rndXORGen(int nPI, int nPO, vector< vector<bool> > &Mat, vector<int> &pivot);
void gaussianEliminate(int nPI, int nPO, vector< vector<bool> > &Mat, vector<int> &pivot);
void fastXORGen(int nPI, int nPO, vector< vector<bool> > &Mat, vector<int> &pivot);
bool checkAvailable(int nPI, int nPO, vector< vector<bool> > &Mat);
void printXOR(const vector< vector<int> >);
};