ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cvrmisc.c File Reference
#include "espresso.h"
Include dependency graph for cvrmisc.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void cover_cost (IN pcover F, INOUT pcost cost)
 
char * fmt_cost (IN pcost cost)
 
char * print_cost (IN pcover F)
 
void copy_cost (pcost s, pcost d)
 
void size_stamp (IN pcover T, IN char *name)
 
void print_trace (pcover T, char *name, long time)
 
void totals (long time, int i, pcover T, pcost cost)
 
void fatal (char *s)
 

Function Documentation

◆ copy_cost()

void copy_cost ( pcost s,
pcost d )

Definition at line 86 of file cvrmisc.c.

88{
89 d->cubes = s->cubes;
90 d->in = s->in;
91 d->out = s->out;
92 d->mv = s->mv;
93 d->total = s->total;
94 d->primes = s->primes;
95}

◆ cover_cost()

ABC_NAMESPACE_IMPL_START void cover_cost ( IN pcover F,
INOUT pcost cost )

Definition at line 17 of file cvrmisc.c.

20{
21 register pcube p, last;
22 pcube *T;
23 int var;
24
25 /* use the routine used by cofactor to decide splitting variables */
28
29 cost->cubes = F->count;
30 cost->total = cost->in = cost->out = cost->mv = cost->primes = 0;
31
32 /* Count transistors (zeros) for each binary variable (inputs) */
33 for(var = 0; var < cube.num_binary_vars; var++)
34 cost->in += cdata.var_zeros[var];
35
36 /* Count transistors for each mv variable based on sparse/dense */
37 for(var = cube.num_binary_vars; var < cube.num_vars - 1; var++)
38 if (cube.sparse[var])
39 cost->mv += F->count * cube.part_size[var] - cdata.var_zeros[var];
40 else
41 cost->mv += cdata.var_zeros[var];
42
43 /* Count the transistors (ones) for the output variable */
44 if (cube.num_binary_vars != cube.num_vars) {
45 var = cube.num_vars - 1;
46 cost->out = F->count * cube.part_size[var] - cdata.var_zeros[var];
47 }
48
49 /* Count the number of nonprime cubes */
50 foreach_set(F, last, p)
51 cost->primes += TESTP(p, PRIME) != 0;
52
53 /* Count the total number of literals */
54 cost->total = cost->in + cost->out + cost->mv;
55}
#define TESTP(set, flag)
Definition espresso.h:124
void massive_count()
#define pcube
Definition espresso.h:261
#define foreach_set(R, last, p)
Definition espresso.h:135
#define PRIME
Definition espresso.h:127
#define free_cubelist(T)
Definition espresso.h:267
pcube * cube1list()
Cube * p
Definition exorList.c:222
unsigned short var
Definition giaNewBdd.h:35
Definition exor.h:123
Here is the call graph for this function:

◆ fatal()

void fatal ( char * s)

Definition at line 140 of file cvrmisc.c.

142{
143 (void) fprintf(stderr, "espresso: %s\n", s);
144 exit(1);
145}
VOID_HACK exit()
Here is the call graph for this function:

◆ fmt_cost()

char * fmt_cost ( IN pcost cost)

Definition at line 59 of file cvrmisc.c.

61{
62 static char s[200];
63
64 if (cube.num_binary_vars == cube.num_vars - 1)
65 (void) sprintf(s, "c=%d(%d) in=%d out=%d tot=%d",
66 cost->cubes, cost->cubes - cost->primes, cost->in,
67 cost->out, cost->total);
68 else
69 (void) sprintf(s, "c=%d(%d) in=%d mv=%d out=%d",
70 cost->cubes, cost->cubes - cost->primes, cost->in,
71 cost->mv, cost->out);
72 return s;
73}
char * sprintf()
Here is the call graph for this function:

◆ print_cost()

char * print_cost ( IN pcover F)

Definition at line 76 of file cvrmisc.c.

78{
79 cost_t cost;
80 cover_cost(F, &cost);
81 return fmt_cost(&cost);
82}
struct cost_struct cost_t
char * fmt_cost()
void cover_cost()
Here is the call graph for this function:

◆ print_trace()

void print_trace ( pcover T,
char * name,
long time )

Definition at line 109 of file cvrmisc.c.

113{
114 (void) printf("# %s\tTime was %s, cost is %s\n",
115 name, print_time(time), print_cost(T));
116 (void) fflush(stdout);
117}
#define print_time(t)
Definition espresso.h:22
char * print_cost()
char * name
Definition main.h:24
Here is the call graph for this function:

◆ size_stamp()

void size_stamp ( IN pcover T,
IN char * name )

Definition at line 99 of file cvrmisc.c.

102{
103 (void) printf("# %s\tCost is %s\n", name, print_cost(T));
104 (void) fflush(stdout);
105}
Here is the call graph for this function:

◆ totals()

void totals ( long time,
int i,
pcover T,
pcost cost )

Definition at line 121 of file cvrmisc.c.

126{
127 time = ptime() - time;
128 total_time[i] += time;
129 total_calls[i]++;
130 cover_cost(T, cost);
131 if (trace) {
132 (void) printf("# %s\tTime was %s, cost is %s\n",
133 total_name[i], print_time(time), fmt_cost(cost));
134 (void) fflush(stdout);
135 }
136}
int total_calls[TIME_COUNT]
Definition globals.c:23
bool trace
Definition globals.c:36
long total_time[TIME_COUNT]
Definition globals.c:22
char * total_name[TIME_COUNT]
Definition globals.c:21
#define ptime()
Definition util_old.h:283
Here is the call graph for this function: