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

Classes

class  BoolOption
 
class  bqueue
 
class  Clause
 
class  ClauseAllocator
 
class  CMap
 
struct  DeepEqual
 
struct  DeepHash
 
class  DoubleOption
 
struct  DoubleRange
 
struct  Equal
 
struct  Hash
 
class  Heap
 
class  Int64Option
 
struct  Int64Range
 
class  IntOption
 
struct  IntRange
 
class  lbool
 
struct  LessThan_default
 
struct  Lit
 
class  Map
 
class  OccLists
 
class  Option
 
class  Queue
 
class  RegionAllocator
 
class  SimpSolver
 
class  Solver
 
class  StreamBuffer
 
class  StringOption
 
class  vec
 

Typedefs

typedef int Var
 
typedef RegionAllocator< uint32_t >::Ref CRef
 

Functions

void parseOptions (int &argc, char **argv, bool strict=false)
 
void printUsageAndExit (int argc, char **argv, bool verbose=false)
 
void setUsageHelp (const char *str)
 
void setHelpPrefixStr (const char *str)
 
Lit mkLit (Var var, bool sign=false)
 
Lit operator~ (Lit p)
 
Lit operator^ (Lit p, bool b)
 
bool sign (Lit p)
 
int var (Lit p)
 
int toInt (Var v)
 
int toInt (Lit p)
 
Lit toLit (int i)
 
int toInt (lbool l)
 
lbool toLbool (int v)
 
template<class T, class LessThan>
void selectionSort (T *array, int size, LessThan lt)
 
template<class T, class LessThan>
void sort (T *array, int size, LessThan lt)
 
template<class T, class LessThan>
void sort (vec< T > &v, LessThan lt)
 
template<class T>
void sort (vec< T > &v)
 
double memUsed ()
 
double memUsedPeak ()
 

Variables

const Lit lit_Undef = { -2 }
 
const Lit lit_Error = { -1 }
 
const CRef CRef_Undef = RegionAllocator<uint32_t>::Ref_Undef
 

Typedef Documentation

◆ CRef

Definition at line 130 of file SolverTypes.h.

◆ Var

typedef int Gluco::Var

Definition at line 52 of file SolverTypes.h.

Function Documentation

◆ memUsed()

ABC_NAMESPACE_IMPL_START double Gluco::memUsed ( )
extern

Definition at line 110 of file System.cpp.

110 {
111 return 0; }
Here is the caller graph for this function:

◆ memUsedPeak()

double Gluco::memUsedPeak ( )
extern

◆ mkLit()

Lit Gluco::mkLit ( Var var,
bool sign = false )
inline

Definition at line 67 of file SolverTypes.h.

67{ Lit p; p.x = var + var + (int)sign; return p; }
Cube * p
Definition exorList.c:222
int var(Lit p)
Definition SolverTypes.h:71
bool sign(Lit p)
Definition SolverTypes.h:70
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator^()

Lit Gluco::operator^ ( Lit p,
bool b )
inline

Definition at line 69 of file SolverTypes.h.

69{ Lit q; q.x = p.x ^ (unsigned int)b; return q; }

◆ operator~()

Lit Gluco::operator~ ( Lit p)
inline

Definition at line 68 of file SolverTypes.h.

68{ Lit q; q.x = p.x ^ 1; return q; }

◆ parseOptions()

void Gluco::parseOptions ( int & argc,
char ** argv,
bool strict = false )
extern

Definition at line 28 of file Options.cpp.

29{
30 int i, j;
31 for (i = j = 1; i < argc; i++){
32 const char* str = argv[i];
33 if (match(str, "--") && match(str, Option::getHelpPrefixString()) && match(str, "help")){
34 if (*str == '\0')
35 printUsageAndExit(argc, argv);
36 else if (match(str, "-verb"))
37 printUsageAndExit(argc, argv, true);
38 } else {
39 bool parsed_ok = false;
40
41 for (int k = 0; !parsed_ok && k < Option::getOptionList().size(); k++){
42 parsed_ok = Option::getOptionList()[k]->parse(argv[i]);
43
44 // fprintf(stderr, "checking %d: %s against flag <%s> (%s)\n", i, argv[i], Option::getOptionList()[k]->name, parsed_ok ? "ok" : "skip");
45 }
46
47 if (!parsed_ok) {
48 if (strict && match(argv[i], "-"))
49 fprintf(stderr, "ERROR! Unknown flag \"%s\". Use '--%shelp' for help.\n", argv[i], Option::getHelpPrefixString()), exit(1);
50 else
51 argv[j++] = argv[i];
52 }
53 }
54 }
55
56 argc -= (i - j);
57}
static vec< Option * > & getOptionList()
Definition Options.h:60
static const char *& getHelpPrefixString()
Definition Options.h:62
void printUsageAndExit(int argc, char **argv, bool verbose=false)
Definition Options.cpp:62
VOID_HACK exit()
Here is the call graph for this function:

◆ printUsageAndExit()

void Gluco::printUsageAndExit ( int argc,
char ** argv,
bool verbose = false )
extern

Definition at line 62 of file Options.cpp.

63{
64 const char* usage = Option::getUsageString();
65 if (usage != NULL)
66 fprintf(stderr, usage, argv[0]);
67
69
70 const char* prev_cat = NULL;
71 const char* prev_type = NULL;
72
73 for (int i = 0; i < Option::getOptionList().size(); i++){
74 const char* cat = Option::getOptionList()[i]->category;
75 const char* type = Option::getOptionList()[i]->type_name;
76
77 if (cat != prev_cat)
78 fprintf(stderr, "\n%s OPTIONS:\n\n", cat);
79 else if (type != prev_type)
80 fprintf(stderr, "\n");
81
82 Option::getOptionList()[i]->help(verbose);
83
84 prev_cat = Option::getOptionList()[i]->category;
85 prev_type = Option::getOptionList()[i]->type_name;
86 }
87
88 fprintf(stderr, "\nHELP OPTIONS:\n\n");
89 fprintf(stderr, " --%shelp Print help message.\n", Option::getHelpPrefixString());
90 fprintf(stderr, " --%shelp-verb Print verbose help message.\n", Option::getHelpPrefixString());
91 fprintf(stderr, "\n");
92 exit(0);
93}
static const char *& getUsageString()
Definition Options.h:61
type
CUBE COVER and CUBE typedefs ///.
Definition exor.h:90
usage()
Definition main.c:626
void sort(T *array, int size, LessThan lt)
Definition Sort.h:58
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectionSort()

template<class T, class LessThan>
void Gluco::selectionSort ( T * array,
int size,
LessThan lt )

Definition at line 40 of file Sort.h.

41{
42 int i, j, best_i;
43 T tmp;
44
45 for (i = 0; i < size-1; i++){
46 best_i = i;
47 for (j = i+1; j < size; j++){
48 if (lt(array[j], array[best_i]))
49 best_i = j;
50 }
51 tmp = array[i]; array[i] = array[best_i]; array[best_i] = tmp;
52 }
53}
Here is the caller graph for this function:

◆ setHelpPrefixStr()

void Gluco::setHelpPrefixStr ( const char * str)
extern

Definition at line 61 of file Options.cpp.

Here is the call graph for this function:

◆ setUsageHelp()

void Gluco::setUsageHelp ( const char * str)
extern

Definition at line 60 of file Options.cpp.

60{ Option::getUsageString() = str; }
Here is the call graph for this function:

◆ sign()

bool Gluco::sign ( Lit p)
inline

Definition at line 70 of file SolverTypes.h.

70{ return p.x & 1; }
Here is the caller graph for this function:

◆ sort() [1/3]

template<class T, class LessThan>
void Gluco::sort ( T * array,
int size,
LessThan lt )

Definition at line 58 of file Sort.h.

59{
60 if (size <= 15)
61 selectionSort(array, size, lt);
62
63 else{
64 T pivot = array[size / 2];
65 T tmp;
66 int i = -1;
67 int j = size;
68
69 for(;;){
70 do i++; while(lt(array[i], pivot));
71 do j--; while(lt(pivot, array[j]));
72
73 if (i >= j) break;
74
75 tmp = array[i]; array[i] = array[j]; array[j] = tmp;
76 }
77
78 sort(array , i , lt);
79 sort(&array[i], size-i, lt);
80 }
81}
void selectionSort(T *array, int size, LessThan lt)
Definition Sort.h:40
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sort() [2/3]

template<class T>
void Gluco::sort ( vec< T > & v)

Definition at line 92 of file Sort.h.

Here is the call graph for this function:

◆ sort() [3/3]

template<class T, class LessThan>
void Gluco::sort ( vec< T > & v,
LessThan lt )

Definition at line 90 of file Sort.h.

90 {
91 sort((T*)v, v.size(), lt); }
Here is the call graph for this function:

◆ toInt() [1/3]

int Gluco::toInt ( lbool l)
inline

Definition at line 123 of file SolverTypes.h.

123{ return l.value; }

◆ toInt() [2/3]

int Gluco::toInt ( Lit p)
inline

Definition at line 75 of file SolverTypes.h.

75{ return p.x; }

◆ toInt() [3/3]

int Gluco::toInt ( Var v)
inline

Definition at line 74 of file SolverTypes.h.

74{ return v; }
Here is the caller graph for this function:

◆ toLbool()

lbool Gluco::toLbool ( int v)
inline

Definition at line 124 of file SolverTypes.h.

124{ return lbool((uint8_t)v); }
ABC_NAMESPACE_HEADER_START typedef unsigned char uint8_t
Definition Fxch.h:31
signed char lbool
Definition satVec.h:135

◆ toLit()

Lit Gluco::toLit ( int i)
inline

Definition at line 76 of file SolverTypes.h.

76{ Lit p; p.x = i; return p; }
Here is the caller graph for this function:

◆ var()

int Gluco::var ( Lit p)
inline

Definition at line 71 of file SolverTypes.h.

71{ return p.x >> 1; }
Here is the caller graph for this function:

Variable Documentation

◆ CRef_Undef

const CRef Gluco::CRef_Undef = RegionAllocator<uint32_t>::Ref_Undef

Definition at line 216 of file SolverTypes.h.

◆ lit_Error

const Lit Gluco::lit_Error = { -1 }

Definition at line 82 of file SolverTypes.h.

82{ -1 }; // }

◆ lit_Undef

const Lit Gluco::lit_Undef = { -2 }

Definition at line 81 of file SolverTypes.h.

81{ -2 }; // }- Useful special constants.