ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
rrr Namespace Reference

Namespaces

namespace  NewBdd
 

Classes

struct  Action
 
class  Analyzer
 
class  AndNetwork
 
class  BddAnalyzer
 
class  BddMspfAnalyzer
 
struct  is_invokable
 
class  LevelBasePartitioner
 
struct  NS
 
class  Optimizer
 
struct  Parameter
 
class  Partitioner
 
class  SatSolver
 
class  Scheduler
 
class  Simulator
 
struct  SW
 

Typedefs

using seconds = int64_t
 
using clock_type = std::chrono::steady_clock
 
using time_point = std::chrono::time_point<clock_type>
 
template<typename T>
using summary = std::vector<std::pair<std::string, T>>
 

Enumerations

enum  NodeType {
  PI , PO , AND , XOR ,
  LUT
}
 
enum  SatResult { SAT , UNSAT , UNDET }
 
enum  VarValue : char {
  UNDEF , TRUE , FALSE , TEMP_TRUE ,
  TEMP_FALSE
}
 
enum  ActionType {
  NONE , REMOVE_FANIN , REMOVE_UNUSED , REMOVE_BUFFER ,
  REMOVE_CONST , ADD_FANIN , TRIVIAL_COLLAPSE , TRIVIAL_DECOMPOSE ,
  SORT_FANINS , READ , SAVE , LOAD ,
  POP_BACK , INSERT
}
 

Functions

template<typename Ntk>
void Perform (Ntk *pNtk, Parameter const *pPar)
 
template<typename Ntk>
void GiaReader (Gia_Man_t *pGia, Ntk *pNtk)
 
template<typename Ntk>
Gia_Man_tCreateGia (Ntk *pNtk, bool fHash=true)
 
template<typename Ntk>
void Abc9Execute (Ntk *pNtk, std::string Command)
 
template<typename T>
std::ostream & operator<< (std::ostream &os, const std::vector< T > &v)
 
template<typename T>
std::ostream & operator<< (std::ostream &os, const std::set< T > &s)
 
void PrintComplementedEdges (std::function< void(std::function< void(int, bool)> const &)> const &ForEachEdge)
 
template<typename T>
void PrintNext (std::ostream &os, T t)
 
template<typename T, typename... Args>
void PrintNext (std::ostream &os, T t, Args... args)
 
bool ForEachCombinationStopRec (std::vector< int > &v, int n, int k, std::function< bool(std::vector< int > const &)> const &func)
 

Typedef Documentation

◆ clock_type

using rrr::clock_type = std::chrono::steady_clock

Definition at line 62 of file rrrTypes.h.

◆ seconds

using rrr::seconds = int64_t

Definition at line 61 of file rrrTypes.h.

◆ summary

template<typename T>
using rrr::summary = std::vector<std::pair<std::string, T>>

Definition at line 66 of file rrrTypes.h.

◆ time_point

using rrr::time_point = std::chrono::time_point<clock_type>

Definition at line 63 of file rrrTypes.h.

Enumeration Type Documentation

◆ ActionType

Enumerator
NONE 
REMOVE_FANIN 
REMOVE_UNUSED 
REMOVE_BUFFER 
REMOVE_CONST 
ADD_FANIN 
TRIVIAL_COLLAPSE 
TRIVIAL_DECOMPOSE 
SORT_FANINS 
READ 
SAVE 
LOAD 
POP_BACK 
INSERT 

Definition at line 32 of file rrrTypes.h.

32 {
33 NONE,
42 READ,
43 SAVE,
44 LOAD,
46 INSERT
47 };
@ POP_BACK
Definition rrrTypes.h:45
@ REMOVE_BUFFER
Definition rrrTypes.h:36
@ REMOVE_UNUSED
Definition rrrTypes.h:35
@ TRIVIAL_DECOMPOSE
Definition rrrTypes.h:40
@ TRIVIAL_COLLAPSE
Definition rrrTypes.h:39
@ INSERT
Definition rrrTypes.h:46
@ SAVE
Definition rrrTypes.h:43
@ REMOVE_CONST
Definition rrrTypes.h:37
@ LOAD
Definition rrrTypes.h:44
@ NONE
Definition rrrTypes.h:33
@ SORT_FANINS
Definition rrrTypes.h:41
@ REMOVE_FANIN
Definition rrrTypes.h:34
@ ADD_FANIN
Definition rrrTypes.h:38
@ READ
Definition rrrTypes.h:42

◆ NodeType

Enumerator
PI 
PO 
AND 
XOR 
LUT 

Definition at line 10 of file rrrTypes.h.

10 {
11 PI,
12 PO,
13 AND,
14 XOR,
15 LUT
16 };
@ AND
Definition rrrTypes.h:13
@ XOR
Definition rrrTypes.h:14
@ PI
Definition rrrTypes.h:11
@ PO
Definition rrrTypes.h:12
@ LUT
Definition rrrTypes.h:15

◆ SatResult

Enumerator
SAT 
UNSAT 
UNDET 

Definition at line 18 of file rrrTypes.h.

18 {
19 SAT,
20 UNSAT,
21 UNDET
22 };
@ SAT
Definition rrrTypes.h:19
@ UNDET
Definition rrrTypes.h:21
@ UNSAT
Definition rrrTypes.h:20

◆ VarValue

enum rrr::VarValue : char
Enumerator
UNDEF 
TRUE 
FALSE 
TEMP_TRUE 
TEMP_FALSE 

Definition at line 24 of file rrrTypes.h.

24 : char {
25 UNDEF,
26 TRUE,
27 FALSE,
30 };
@ UNDEF
Definition rrrTypes.h:25
@ TEMP_FALSE
Definition rrrTypes.h:29
@ TRUE
Definition rrrTypes.h:26
@ FALSE
Definition rrrTypes.h:27
@ TEMP_TRUE
Definition rrrTypes.h:28

Function Documentation

◆ Abc9Execute()

template<typename Ntk>
void rrr::Abc9Execute ( Ntk * pNtk,
std::string Command )

Definition at line 69 of file rrrAbc.h.

69 {
71 Abc_FrameUpdateGia(pAbc, CreateGia(pNtk));
73 int r = Cmd_CommandExecute(pAbc, Command.c_str());
74 assert(r == 0);
75 } else {
77 int r = Cmd_CommandExecute(pAbc, Command.c_str());
78 assert(r == 0);
80 }
81 pNtk->Read(Abc_FrameReadGia(pAbc), GiaReader<Ntk>, false);
82 }
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition abc.c:824
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
Definition abcapis.h:38
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
Definition mainFrame.c:643
ABC_DLL void Abc_FrameSetBatchMode(int Mode)
Definition mainFrame.c:111
ABC_DLL Gia_Man_t * Abc_FrameReadGia(Abc_Frame_t *p)
Definition mainFrame.c:343
ABC_DLL int Abc_FrameIsBatchMode()
Definition mainFrame.c:110
ABC_DLL int Cmd_CommandExecute(Abc_Frame_t *pAbc, const char *sCommand)
Definition cmdApi.c:193
void GiaReader(Gia_Man_t *pGia, Ntk *pNtk)
Definition rrrAbc.h:14
Gia_Man_t * CreateGia(Ntk *pNtk, bool fHash=true)
Definition rrrAbc.h:32
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ CreateGia()

template<typename Ntk>
Gia_Man_t * rrr::CreateGia ( Ntk * pNtk,
bool fHash = true )

Definition at line 32 of file rrrAbc.h.

32 {
33 Gia_Man_t *pGia = Gia_ManStart(pNtk->GetNumNodes());
34 if(fHash) {
35 Gia_ManHashStart(pGia);
36 }
37 std::vector<int> v(pNtk->GetNumNodes());
38 v[0] = Gia_ManConst0Lit();
39 pNtk->ForEachPi([&](int id) {
40 v[id] = Gia_ManAppendCi(pGia);
41 });
42 pNtk->ForEachInt([&](int id) {
43 assert(pNtk->GetNodeType(id) == rrr::AND);
44 int x = -1;
45 pNtk->ForEachFanin(id, [&](int fi, bool c) {
46 if(x == -1) {
47 x = Abc_LitNotCond(v[fi], c);
48 } else if(fHash) {
49 x = Gia_ManHashAnd(pGia, x, Abc_LitNotCond(v[fi], c));
50 } else {
51 x = Gia_ManAppendAnd(pGia, x, Abc_LitNotCond(v[fi], c));
52 }
53 });
54 if(x == -1) {
55 x = Abc_LitNot(v[0]);
56 }
57 v[id] = x;
58 });
59 pNtk->ForEachPoDriver([&](int fi, bool c) {
60 Gia_ManAppendCo(pGia, Abc_LitNotCond(v[fi], c));
61 });
62 if(fHash) {
63 Gia_ManHashStop(pGia);
64 }
65 return pGia;
66 }
void Gia_ManHashStart(Gia_Man_t *p)
Definition giaHash.c:125
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:576
void Gia_ManHashStop(Gia_Man_t *p)
Definition giaHash.c:149
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ForEachCombinationStopRec()

bool rrr::ForEachCombinationStopRec ( std::vector< int > & v,
int n,
int k,
std::function< bool(std::vector< int > const &)> const & func )

Definition at line 240 of file rrrUtils.h.

240 {
241 if(k == 0) {
242 return func(v);
243 }
244 for(int i = v.back() + 1; i < n - k + 1; i++) {
245 v.push_back(i);
246 if(ForEachCombinationStopRec(v, n, k-1, func)) {
247 return true;
248 }
249 v.pop_back();
250 }
251 return false;
252 }
bool ForEachCombinationStopRec(std::vector< int > &v, int n, int k, std::function< bool(std::vector< int > const &)> const &func)
Definition rrrUtils.h:240
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GiaReader()

template<typename Ntk>
void rrr::GiaReader ( Gia_Man_t * pGia,
Ntk * pNtk )

Definition at line 14 of file rrrAbc.h.

14 {
15 int i;
16 Gia_Obj_t *pObj;
17 pNtk->Reserve(Gia_ManObjNum(pGia));
18 Gia_ManConst0(pGia)->Value = pNtk->GetConst0();
19 Gia_ManForEachObj1(pGia, pObj, i) {
20 if(Gia_ObjIsCi(pObj)) {
21 pObj->Value = pNtk->AddPi();
22 } else if(Gia_ObjIsCo(pObj)) {
23 pNtk->AddPo(Gia_ObjFanin0(pObj)->Value, Gia_ObjFaninC0(pObj));
24 } else {
25 // TODO: support XOR (and BUF and MUX?), maybe create another function
26 pObj->Value = pNtk->AddAnd(Gia_ObjFanin0(pObj)->Value, Gia_ObjFanin1(pObj)->Value, Gia_ObjFaninC0(pObj), Gia_ObjFaninC1(pObj));
27 }
28 }
29 }
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define Gia_ManForEachObj1(p, pObj, i)
Definition gia.h:1192
unsigned Value
Definition gia.h:89
Here is the caller graph for this function:

◆ operator<<() [1/2]

template<typename T>
std::ostream & rrr::operator<< ( std::ostream & os,
const std::set< T > & s )

Definition at line 74 of file rrrUtils.h.

74 {
75 std::string delim;
76 os << "{";
77 for(T const &e: s) {
78 os << delim << e;
79 delim = ", ";
80 }
81 os << "}";
82 return os;
83 }

◆ operator<<() [2/2]

template<typename T>
std::ostream & rrr::operator<< ( std::ostream & os,
const std::vector< T > & v )

Definition at line 62 of file rrrUtils.h.

62 {
63 std::string delim;
64 os << "[";
65 for(T const &e: v) {
66 os << delim << e;
67 delim = ", ";
68 }
69 os << "]";
70 return os;
71 }

◆ Perform()

template<typename Ntk>
void rrr::Perform ( Ntk * pNtk,
Parameter const * pPar )

Definition at line 19 of file rrr.h.

19 {
20 assert(!pPar->fUseBddCspf || !pPar->fUseBddMspf);
21 switch(pPar->nPartitionType) {
22 case 0:
23 if(pPar->fUseBddCspf) {
25 sch.Run();
26 } else if(pPar->fUseBddMspf) {
27 Scheduler<Ntk, Optimizer<Ntk, BddMspfAnalyzer<Ntk>>, Partitioner<Ntk>> sch(pNtk, pPar);
28 sch.Run();
29 } else {
31 sch.Run();
32 }
33 break;
34 case 1:
35 if(pPar->fUseBddCspf) {
37 sch.Run();
38 } else if(pPar->fUseBddMspf) {
40 sch.Run();
41 } else {
43 sch.Run();
44 }
45 break;
46 default:
47 assert(0);
48 }
49 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintComplementedEdges()

void rrr::PrintComplementedEdges ( std::function< void(std::function< void(int, bool)> const &)> const & ForEachEdge)

Definition at line 85 of file rrrUtils.h.

85 {
86 std::string delim;
87 std::cout << "[";
88 ForEachEdge([&] (int id, bool c) {
89 std::cout << delim << (c? "!": "") << id;
90 delim = ", ";
91 });
92 std::cout << "]";
93 }
Here is the caller graph for this function:

◆ PrintNext() [1/2]

template<typename T>
void rrr::PrintNext ( std::ostream & os,
T t )

Definition at line 218 of file rrrUtils.h.

218 {
219 os << t;
220 }
Here is the caller graph for this function:

◆ PrintNext() [2/2]

template<typename T, typename... Args>
void rrr::PrintNext ( std::ostream & os,
T t,
Args... args )

Definition at line 223 of file rrrUtils.h.

223 {
224 os << t << " ";
225 PrintNext(os, args...);
226 }
void PrintNext(std::ostream &os, T t)
Definition rrrUtils.h:218
Here is the call graph for this function: