abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
misc/espresso/main.c File Reference
#include "espresso.h"
#include "base/main/main.h"

Go to the source code of this file.

Functions

 main (int argc, argv)
 
 getPLA (int opt, int argc, argv, int option, pPLA *PLA, int out_type)
 
 runtime ()
 
 init_runtime ()
 
 subcommands ()
 
 usage ()
 
 backward_compatibility_hack (int *argc, char **argv, int *option, int *out_type)
 
 delete_arg (int *argc, argv, int num)
 
bool check_arg (int *argc, argv,*s)
 

Variables

static
ABC_NAMESPACE_IMPL_START FILE * 
last_fp
 
static int input_type = FD_type
 

Function Documentation

backward_compatibility_hack ( int *  argc,
char **  argv,
int *  option,
int *  out_type 
)

Definition at line 659 of file misc/espresso/main.c.

664 {
665  int i, j;
666 
667  /* Scan the argument list for something to do (default is ESPRESSO) */
668  *option = 0;
669  for(i = 1; i < (*argc)-1; i++) {
670  if (strcmp(argv[i], "-do") == 0) {
671  for(j = 0; option_table[j].name != 0; j++)
672  if (strcmp(argv[i+1], option_table[j].name) == 0) {
673  *option = j;
674  delete_arg(argc, argv, i+1);
675  delete_arg(argc, argv, i);
676  break;
677  }
678  if (option_table[j].name == 0) {
679  (void) fprintf(stderr,
680  "espresso: bad keyword \"%s\" following -do\n",argv[i+1]);
681  exit(1);
682  }
683  break;
684  }
685  }
686 
687  for(i = 1; i < (*argc)-1; i++) {
688  if (strcmp(argv[i], "-out") == 0) {
689  for(j = 0; pla_types[j].key != 0; j++)
690  if (strcmp(pla_types[j].key+1, argv[i+1]) == 0) {
691  *out_type = pla_types[j].value;
692  delete_arg(argc, argv, i+1);
693  delete_arg(argc, argv, i);
694  break;
695  }
696  if (pla_types[j].key == 0) {
697  (void) fprintf(stderr,
698  "espresso: bad keyword \"%s\" following -out\n",argv[i+1]);
699  exit(1);
700  }
701  break;
702  }
703  }
704 
705  for(i = 1; i < (*argc); i++) {
706  if (argv[i][0] == '-') {
707  for(j = 0; esp_opt_table[j].name != 0; j++) {
708  if (strcmp(argv[i]+1, esp_opt_table[j].name) == 0) {
709  delete_arg(argc, argv, i);
710  *(esp_opt_table[j].variable) = esp_opt_table[j].value;
711  break;
712  }
713  }
714  }
715  }
716 
717  if (check_arg(argc, argv, "-fdr")) input_type = FDR_type;
718  if (check_arg(argc, argv, "-fr")) input_type = FR_type;
719  if (check_arg(argc, argv, "-f")) input_type = F_type;
720 }
VOID_HACK exit()
bool check_arg(int *argc, argv,*s)
struct @49 option_table[]
struct @51 esp_opt_table[]
struct pla_types_struct pla_types[]
Definition: globals.c:42
int strcmp()
#define FDR_type
Definition: espresso.h:348
char * name
static int input_type
#define FR_type
Definition: espresso.h:346
enum keys key
int value
#define F_type
Definition: espresso.h:337
delete_arg(int *argc, argv, int num)
bool check_arg ( int *  argc,
argv  ,
s 
)

Definition at line 737 of file misc/espresso/main.c.

740 {
741  register int i;
742  for(i = 1; i < *argc; i++) {
743  if (strcmp(argv[i], s) == 0) {
744  delete_arg(argc, argv, i);
745  return TRUE;
746  }
747  }
748  return FALSE;
749 }
#define FALSE
Definition: cudd.h:91
int strcmp()
#define TRUE
Definition: cudd.h:88
delete_arg(int *argc, argv, int num)
delete_arg ( int *  argc,
argv  ,
int  num 
)

Definition at line 724 of file misc/espresso/main.c.

727 {
728  register int i;
729  (*argc)--;
730  for(i = num; i < *argc; i++) {
731  argv[i] = argv[i+1];
732  }
733 }
getPLA ( int  opt,
int  argc,
argv  ,
int  option,
pPLA PLA,
int  out_type 
)

Definition at line 524 of file misc/espresso/main.c.

531 {
532  FILE *fp;
534  char *fname;
535 
536  if (opt >= argc) {
537  fp = stdin;
538  fname = "(stdin)";
539  } else {
540  fname = argv[opt];
541  if (strcmp(fname, "-") == 0) {
542  fp = stdin;
543  } else if ((fp = fopen(argv[opt], "r")) == NULL) {
544  (void) fprintf(stderr, "%s: Unable to open %s\n", argv[0], fname);
545  exit(1);
546  }
547  }
548  if (option_table[option].key == KEY_echo) {
549  needs_dcset = (out_type & D_type) != 0;
550  needs_offset = (out_type & R_type) != 0;
551  } else {
552  needs_dcset = option_table[option].needs_dcset;
553  needs_offset = option_table[option].needs_offset;
554  }
555 
556  if (read_pla(fp, needs_dcset, needs_offset, input_type, PLA) == EOF) {
557  (void) fprintf(stderr, "%s: Unable to find PLA on file %s\n", argv[0], fname);
558  exit(1);
559  }
560  (*PLA)->filename = util_strsav(fname);
561  filename = (*PLA)->filename;
562 /* (void) fclose(fp);*/
563 /* hackto support -Dmany */
564  last_fp = fp;
565 }
char * filename
Definition: globals.c:40
VOID_HACK exit()
struct @49 option_table[]
bool needs_offset
int read_pla(IN FILE *fp, IN bool needs_dcset, IN bool needs_offset, IN int pla_type, OUT pPLA *PLA_return)
Definition: cvrin.c:493
int strcmp()
static ABC_NAMESPACE_IMPL_START FILE * last_fp
static int input_type
enum keys key
#define D_type
Definition: espresso.h:338
#define R_type
Definition: espresso.h:339
bool needs_dcset
init_runtime ( )

Definition at line 587 of file misc/espresso/main.c.

588 {
589  total_name[READ_TIME] = "READ ";
590  total_name[WRITE_TIME] = "WRITE ";
591  total_name[COMPL_TIME] = "COMPL ";
592  total_name[REDUCE_TIME] = "REDUCE ";
593  total_name[EXPAND_TIME] = "EXPAND ";
594  total_name[ESSEN_TIME] = "ESSEN ";
595  total_name[IRRED_TIME] = "IRRED ";
596  total_name[GREDUCE_TIME] = "REDUCE_GASP";
597  total_name[GEXPAND_TIME] = "EXPAND_GASP";
598  total_name[GIRRED_TIME] = "IRRED_GASP ";
599  total_name[MV_REDUCE_TIME] ="MV_REDUCE ";
600  total_name[RAISE_IN_TIME] = "RAISE_IN ";
601  total_name[VERIFY_TIME] = "VERIFY ";
602  total_name[PRIMES_TIME] = "PRIMES ";
603  total_name[MINCOV_TIME] = "MINCOV ";
604 }
#define PRIMES_TIME
Definition: espresso.h:382
#define MV_REDUCE_TIME
Definition: espresso.h:384
#define WRITE_TIME
Definition: espresso.h:387
#define REDUCE_TIME
Definition: espresso.h:378
#define ESSEN_TIME
Definition: espresso.h:375
#define GIRRED_TIME
Definition: espresso.h:380
char * total_name[TIME_COUNT]
Definition: globals.c:21
#define MINCOV_TIME
Definition: espresso.h:383
#define RAISE_IN_TIME
Definition: espresso.h:385
#define GREDUCE_TIME
Definition: espresso.h:381
#define GEXPAND_TIME
Definition: espresso.h:379
#define READ_TIME
Definition: espresso.h:372
#define IRRED_TIME
Definition: espresso.h:377
#define VERIFY_TIME
Definition: espresso.h:386
#define EXPAND_TIME
Definition: espresso.h:376
#define COMPL_TIME
Definition: espresso.h:373
main ( int  argc,
argv   
)

Definition at line 26 of file misc/espresso/main.c.

29 {
30  int i, j, first, last, strategy, out_type, option;
31  pPLA PLA, PLA1;
32  pcover F, Fold, Dold;
33  pset last1, p;
34  cost_t cost;
35  bool error, exact_cover;
36  long start;
37  extern char *util_optarg;
38  extern int util_optind;
39 
40  start = ptime();
41 
42  error = FALSE;
43  init_runtime();
44 #ifdef RANDOM
45  srandom(314973);
46 #endif
47 
48  option = 0; /* default -D: ESPRESSO */
49  out_type = F_type; /* default -o: default is ON-set only */
50  debug = 0; /* default -d: no debugging info */
51  verbose_debug = FALSE; /* default -v: not verbose */
52  print_solution = TRUE; /* default -x: print the solution (!) */
53  summary = FALSE; /* default -s: no summary */
54  trace = FALSE; /* default -t: no trace information */
55  strategy = 0; /* default -S: strategy number */
56  first = -1; /* default -R: select range */
57  last = -1;
58  remove_essential = TRUE; /* default -e: */
62  pos = FALSE;
66  kiss = FALSE;
69  exact_cover = FALSE; /* for -qm option, the default */
70 
71  backward_compatibility_hack(&argc, argv, &option, &out_type);
72 
73 
74  /* parse command line options*/
75  while ((i = util_getopt(argc, argv, "D:S:de:o:r:stv:x")) != EOF) {
76  switch(i) {
77  case 'D': /* -Dcommand invokes a subcommand */
78  for(j = 0; option_table[j].name != 0; j++) {
79  if (strcmp(util_optarg, option_table[j].name) == 0) {
80  option = j;
81  break;
82  }
83  }
84  if (option_table[j].name == 0) {
85  (void) fprintf(stderr, "%s: bad subcommand \"%s\"\n",
86  argv[0], util_optarg);
87  exit(1);
88  }
89  break;
90 
91  case 'o': /* -ooutput selects and output option */
92  for(j = 0; pla_types[j].key != 0; j++) {
93  if (strcmp(util_optarg, pla_types[j].key+1) == 0) {
94  out_type = pla_types[j].value;
95  break;
96  }
97  }
98  if (pla_types[j].key == 0) {
99  (void) fprintf(stderr, "%s: bad output type \"%s\"\n",
100  argv[0], util_optarg);
101  exit(1);
102  }
103  break;
104 
105  case 'e': /* -eespresso selects an option for espresso */
106  for(j = 0; esp_opt_table[j].name != 0; j++) {
107  if (strcmp(util_optarg, esp_opt_table[j].name) == 0) {
108  *(esp_opt_table[j].variable) = esp_opt_table[j].value;
109  break;
110  }
111  }
112  if (esp_opt_table[j].name == 0) {
113  (void) fprintf(stderr, "%s: bad espresso option \"%s\"\n",
114  argv[0], util_optarg);
115  exit(1);
116  }
117  break;
118 
119  case 'd': /* -d turns on (softly) all debug switches */
120  debug = debug_table[0].value;
121  trace = TRUE;
122  summary = TRUE;
123  break;
124 
125  case 'v': /* -vdebug invokes a debug option */
127  for(j = 0; debug_table[j].name != 0; j++) {
128  if (strcmp(util_optarg, debug_table[j].name) == 0) {
129  debug |= debug_table[j].value;
130  break;
131  }
132  }
133  if (debug_table[j].name == 0) {
134  (void) fprintf(stderr, "%s: bad debug type \"%s\"\n",
135  argv[0], util_optarg);
136  exit(1);
137  }
138  break;
139 
140  case 't':
141  trace = TRUE;
142  break;
143 
144  case 's':
145  summary = TRUE;
146  break;
147 
148  case 'x': /* -x suppress printing of results */
150  break;
151 
152  case 'S': /* -S sets a strategy for several cmds */
153  strategy = atoi(util_optarg);
154  break;
155 
156  case 'r': /* -r selects range (outputs or vars) */
157  if (sscanf(util_optarg, "%d-%d", &first, &last) < 2) {
158  (void) fprintf(stderr, "%s: bad output range \"%s\"\n",
159  argv[0], util_optarg);
160  exit(1);
161  }
162  break;
163 
164  default:
165  usage();
166  exit(1);
167  }
168  }
169 
170  /* provide version information and summaries */
171  if (summary || trace) {
172  /* echo command line and arguments */
173  printf("#");
174  for(i = 0; i < argc; i++) {
175  printf(" %s", argv[i]);
176  }
177  printf("\n");
178  printf("# %s\n", VERSION);
179  }
180 
181  /* the remaining arguments are argv[util_optind ... argc-1] */
182  PLA = PLA1 = NIL(PLA_t);
183  switch(option_table[option].num_plas) {
184  case 2:
185  if (util_optind+2 < argc) fatal("trailing arguments on command line");
186  getPLA(util_optind++, argc, argv, option, &PLA, out_type);
187  getPLA(util_optind++, argc, argv, option, &PLA1, out_type);
188  break;
189  case 1:
190  if (util_optind+1 < argc) fatal("trailing arguments on command line");
191  getPLA(util_optind++, argc, argv, option, &PLA, out_type);
192  break;
193  }
194  if (util_optind < argc) fatal("trailing arguments on command line");
195 
196  if (summary || trace) {
197  if (PLA != NIL(PLA_t)) PLA_summary(PLA);
198  if (PLA1 != NIL(PLA_t)) PLA_summary(PLA1);
199  }
200 
201 /*
202  * Now a case-statement to decide what to do
203  */
204 
205  switch(option_table[option].key) {
206 
207 
208 /******************** Espresso operations ********************/
209 
210  case KEY_ESPRESSO:
211  Fold = sf_save(PLA->F);
212  PLA->F = espresso(PLA->F, PLA->D, PLA->R);
213  EXECUTE(error=verify(PLA->F,Fold,PLA->D), VERIFY_TIME, PLA->F, cost);
214  if (error) {
216  PLA->F = Fold;
217  (void) check_consistency(PLA);
218  } else {
219  free_cover(Fold);
220  }
221  break;
222 
223  case KEY_MANY_ESPRESSO: {
224  int pla_type;
225  do {
226  EXEC(PLA->F=espresso(PLA->F,PLA->D,PLA->R),"ESPRESSO ",PLA->F);
227  if (print_solution) {
228  fprint_pla(stdout, PLA, out_type);
229  (void) fflush(stdout);
230  }
231  pla_type = PLA->pla_type;
232  free_PLA(PLA);
233  setdown_cube();
234  FREE(cube.part_size);
235  } while (read_pla(last_fp, TRUE, TRUE, pla_type, &PLA) != EOF);
236  exit(0);
237  }
238 
239  case KEY_simplify:
240  EXEC(PLA->F = simplify(cube1list(PLA->F)), "SIMPLIFY ", PLA->F);
241  break;
242 
243  case KEY_so: /* minimize all functions as single-output */
244  if (strategy < 0 || strategy > 1) {
245  strategy = 0;
246  }
247  so_espresso(PLA, strategy);
248  break;
249 
250  case KEY_so_both: /* minimize all functions as single-output */
251  if (strategy < 0 || strategy > 1) {
252  strategy = 0;
253  }
254  so_both_espresso(PLA, strategy);
255  break;
256 
257  case KEY_expand: /* execute expand */
258  EXECUTE(PLA->F=expand(PLA->F,PLA->R,FALSE),EXPAND_TIME, PLA->F, cost);
259  break;
260 
261  case KEY_irred: /* extract minimal irredundant subset */
262  EXECUTE(PLA->F = irredundant(PLA->F, PLA->D), IRRED_TIME, PLA->F, cost);
263  break;
264 
265  case KEY_reduce: /* perform reduction */
266  EXECUTE(PLA->F = reduce(PLA->F, PLA->D), REDUCE_TIME, PLA->F, cost);
267  break;
268 
269  case KEY_essen: /* check for essential primes */
270  foreach_set(PLA->F, last1, p) {
271  SET(p, RELESSEN);
272  RESET(p, NONESSEN);
273  }
274  EXECUTE(F = essential(&(PLA->F), &(PLA->D)), ESSEN_TIME, PLA->F, cost);
275  free_cover(F);
276  break;
277 
278  case KEY_super_gasp:
279  PLA->F = super_gasp(PLA->F, PLA->D, PLA->R, &cost);
280  break;
281 
282  case KEY_gasp:
283  PLA->F = last_gasp(PLA->F, PLA->D, PLA->R, &cost);
284  break;
285 
286  case KEY_make_sparse: /* make_sparse step of Espresso */
287  PLA->F = make_sparse(PLA->F, PLA->D, PLA->R);
288  break;
289 
290  case KEY_exact:
291  exact_cover = TRUE;
292 
293  case KEY_qm:
294  Fold = sf_save(PLA->F);
295  PLA->F = minimize_exact(PLA->F, PLA->D, PLA->R, exact_cover);
296  EXECUTE(error=verify(PLA->F,Fold,PLA->D), VERIFY_TIME, PLA->F, cost);
297  if (error) {
299  PLA->F = Fold;
300  (void) check_consistency(PLA);
301  }
302  free_cover(Fold);
303  break;
304 
305  case KEY_primes: /* generate all prime implicants */
306  EXEC(PLA->F = primes_consensus(cube2list(PLA->F, PLA->D)),
307  "PRIMES ", PLA->F);
308  break;
309 
310  case KEY_map: /* print out a Karnaugh map of function */
311  map(PLA->F);
313  break;
314 
315 
316 
317 /******************** Output phase and bit pairing ********************/
318 
319  case KEY_opo: /* sasao output phase assignment */
320  phase_assignment(PLA, strategy);
321  break;
322 
323  case KEY_opoall: /* try all phase assignments (!) */
324  if (first < 0 || first >= cube.part_size[cube.output]) {
325  first = 0;
326  }
327  if (last < 0 || last >= cube.part_size[cube.output]) {
328  last = cube.part_size[cube.output] - 1;
329  }
330  opoall(PLA, first, last, strategy);
331  break;
332 
333  case KEY_pair: /* find an optimal pairing */
334  find_optimal_pairing(PLA, strategy);
335  break;
336 
337  case KEY_pairall: /* try all pairings !! */
338  pair_all(PLA, strategy);
339  break;
340 
341 
342 
343 /******************** Simple cover operations ********************/
344 
345  case KEY_echo: /* echo the PLA */
346  break;
347 
348  case KEY_taut: /* tautology check */
349  printf("ON-set is%sa tautology\n",
350  tautology(cube1list(PLA->F)) ? " " : " not ");
352  break;
353 
354  case KEY_contain: /* single cube containment */
355  PLA->F = sf_contain(PLA->F);
356  break;
357 
358  case KEY_intersect: /* cover intersection */
359  PLA->F = cv_intersect(PLA->F, PLA1->F);
360  break;
361 
362  case KEY_union: /* cover union */
363  PLA->F = sf_union(PLA->F, PLA1->F);
364  break;
365 
366  case KEY_disjoint: /* make cover disjoint */
367  PLA->F = make_disjoint(PLA->F);
368  break;
369 
370  case KEY_dsharp: /* cover disjoint-sharp */
371  PLA->F = cv_dsharp(PLA->F, PLA1->F);
372  break;
373 
374  case KEY_sharp: /* cover sharp */
375  PLA->F = cv_sharp(PLA->F, PLA1->F);
376  break;
377 
378  case KEY_lexsort: /* lexical sort order */
379  PLA->F = lex_sort(PLA->F);
380  break;
381 
382  case KEY_stats: /* print info on size */
383  if (! summary) PLA_summary(PLA);
385  break;
386 
387  case KEY_minterms: /* explode into minterms */
388  if (first < 0 || first >= cube.num_vars) {
389  first = 0;
390  }
391  if (last < 0 || last >= cube.num_vars) {
392  last = cube.num_vars - 1;
393  }
394  PLA->F = sf_dupl(unravel_range(PLA->F, first, last));
395  break;
396 
397  case KEY_d1merge: /* distance-1 merge */
398  if (first < 0 || first >= cube.num_vars) {
399  first = 0;
400  }
401  if (last < 0 || last >= cube.num_vars) {
402  last = cube.num_vars - 1;
403  }
404  for(i = first; i <= last; i++) {
405  PLA->F = d1merge(PLA->F, i);
406  }
407  break;
408 
409  case KEY_d1merge_in: /* distance-1 merge inputs only */
410  for(i = 0; i < cube.num_binary_vars; i++) {
411  PLA->F = d1merge(PLA->F, i);
412  }
413  break;
414 
415  case KEY_PLA_verify: /* check two PLAs for equivalence */
416  EXECUTE(error = PLA_verify(PLA, PLA1), VERIFY_TIME, PLA->F, cost);
417  if (error) {
418  printf("PLA comparison failed; the PLA's are not equivalent\n");
419  exit(1);
420  } else {
421  printf("PLA's compared equal\n");
422  exit(0);
423  }
424  break; /* silly */
425 
426  case KEY_verify: /* check two covers for equivalence */
427  Fold = PLA->F; Dold = PLA->D; F = PLA1->F;
428  EXECUTE(error=verify(F, Fold, Dold), VERIFY_TIME, PLA->F, cost);
429  if (error) {
430  printf("PLA comparison failed; the PLA's are not equivalent\n");
431  exit(1);
432  } else {
433  printf("PLA's compared equal\n");
434  exit(0);
435  }
436  break; /* silly */
437 
438  case KEY_check: /* check consistency */
439  (void) check_consistency(PLA);
441  break;
442 
443  case KEY_mapdc: /* compute don't care set */
444  map_dcset(PLA);
445  out_type = FD_type;
446  break;
447 
448  case KEY_equiv:
449  find_equiv_outputs(PLA);
451  break;
452 
453  case KEY_separate: /* remove PLA->D from PLA->F */
454  PLA->F = complement(cube2list(PLA->D, PLA->R));
455  break;
456 
457  case KEY_xor: {
458  pcover T1 = cv_intersect(PLA->F, PLA1->R);
459  pcover T2 = cv_intersect(PLA1->F, PLA->R);
460  free_cover(PLA->F);
461  PLA->F = sf_contain(sf_join(T1, T2));
462  free_cover(T1);
463  free_cover(T2);
464  break;
465  }
466 
467  case KEY_fsm: {
468  disassemble_fsm(PLA, summary);
470  break;
471  }
472 
473  case KEY_test: {
474  pcover T, E;
475  T = sf_join(PLA->D, PLA->R);
476  E = new_cover(10);
477  sf_free(PLA->F);
478  EXECUTE(PLA->F = complement(cube1list(T)), COMPL_TIME, PLA->F, cost);
479  EXECUTE(PLA->F = expand(PLA->F, T, FALSE), EXPAND_TIME, PLA->F, cost);
480  EXECUTE(PLA->F = irredundant(PLA->F, E), IRRED_TIME, PLA->F, cost);
481  sf_free(T);
482  T = sf_join(PLA->F, PLA->R);
483  EXECUTE(PLA->D = expand(PLA->D, T, FALSE), EXPAND_TIME, PLA->D, cost);
484  EXECUTE(PLA->D = irredundant(PLA->D, E), IRRED_TIME, PLA->D, cost);
485  sf_free(T);
486  sf_free(E);
487  break;
488  }
489 
490 
491  }
492 
493  /* Print a runtime summary if trace mode enabled */
494  if (trace) {
495  runtime();
496  }
497 
498  /* Print total runtime */
499  if (summary || trace) {
500  print_trace(PLA->F, option_table[option].name, ptime()-start);
501  }
502 
503  /* Output the solution */
504  if (print_solution) {
505  EXECUTE(fprint_pla(stdout, PLA, out_type), WRITE_TIME, PLA->F, cost);
506  }
507 
508  /* Crash and burn if there was a verify error */
509  if (error) {
510  fatal("cover verification failed");
511  }
512 
513  /* cleanup all used memory */
514  free_PLA(PLA);
515  FREE(cube.part_size);
516  setdown_cube(); /* free the cube/cdata structure data */
517  sf_cleanup(); /* free unused set structures */
518  sm_cleanup(); /* sparse matrix cleanup */
519 
520  exit(0);
521 }
pcover primes_consensus()
void sm_cleanup()
Definition: matrix.c:552
VOID_HACK exit()
void fatal(char *s)
Definition: cvrmisc.c:140
bool single_expand
Definition: globals.c:34
#define FD_type
Definition: espresso.h:345
struct @50 debug_table[]
#define FALSE
Definition: cudd.h:91
ABC_NAMESPACE_IMPL_START pcover espresso(pcover F, pcover D1, pcover R)
Definition: espresso.c:53
bool PLA_verify()
void so_espresso(pPLA PLA, int strategy)
Definition: cvrm.c:410
void PLA_summary(pPLA PLA)
Definition: cvrin.c:597
pset_family sf_dupl(INOUT pset_family A)
Definition: contain.c:99
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void opoall()
#define free_cover(r)
Definition: espresso.h:266
#define pcover
Definition: espresso.h:264
bool tautology()
void so_both_espresso(pPLA PLA, int strategy)
Definition: cvrm.c:429
bool unwrap_onset
Definition: globals.c:37
#define VERSION
Definition: espresso.h:367
int util_optind
pcover last_gasp()
void disassemble_fsm(pPLA PLA, int verbose_mode)
Definition: hack.c:482
void print_trace(pcover T, char *name, long time)
Definition: cvrmisc.c:109
pcover cv_sharp()
bool pos
Definition: globals.c:30
bool summary
Definition: globals.c:35
struct @49 option_table[]
bool trace
Definition: globals.c:36
pset_family d1merge(INOUT pset_family A, IN int var)
Definition: contain.c:161
void map()
int read_pla(IN FILE *fp, IN bool needs_dcset, IN bool needs_offset, IN int pla_type, OUT pPLA *PLA_return)
Definition: cvrin.c:493
void sf_free()
char * util_optarg
#define WRITE_TIME
Definition: espresso.h:387
int num_plas
pcover complement(pcube *T)
Definition: compl.c:49
#define SET(set, flag)
Definition: espresso.h:122
#define foreach_set(R, last, p)
Definition: espresso.h:135
#define RESET(set, flag)
Definition: espresso.h:123
struct @51 esp_opt_table[]
#define REDUCE_TIME
Definition: espresso.h:378
#define ESSEN_TIME
Definition: espresso.h:375
struct pla_types_struct pla_types[]
Definition: globals.c:42
pcover unravel_range(IN pcover B, IN int start, IN int end)
Definition: cvrm.c:77
#define NIL(type)
Definition: avl.h:25
pcover lex_sort(pcover T)
Definition: cvrm.c:121
int strcmp()
ABC_NAMESPACE_IMPL_START pset_family sf_contain(INOUT pset_family A)
Definition: contain.c:37
pcover expand()
pset_family sf_join()
#define NONESSEN
Definition: espresso.h:128
init_runtime()
pcover irredundant()
pcover essential()
unsigned int debug
Definition: globals.c:19
void setdown_cube()
Definition: cubestr.c:95
void phase_assignment()
static ABC_NAMESPACE_IMPL_START FILE * last_fp
bool print_solution
Definition: globals.c:31
char * name
getPLA(int opt, int argc, argv, int option, pPLA *PLA, int out_type)
void find_optimal_pairing()
pcube * cube2list(pcover A, pcover B)
Definition: cofactor.c:306
bool force_irredundant
Definition: globals.c:27
#define FREE(obj)
Definition: avl.h:31
#define new_cover(i)
Definition: espresso.h:265
unsigned int * pset
Definition: espresso.h:73
pcover reduce()
ABC_NAMESPACE_IMPL_START void find_equiv_outputs(pPLA PLA)
Definition: equiv.c:16
bool use_super_gasp
Definition: globals.c:39
bool check_consistency()
bool echo_unknown_commands
Definition: globals.c:26
backward_compatibility_hack(int *argc, char **argv, int *option, int *out_type)
pcover F
Definition: espresso.h:316
void pair_all()
bool echo_comments
Definition: globals.c:25
#define ptime()
Definition: util_old.h:283
pcover make_sparse()
bool use_random_order
Definition: globals.c:38
int util_getopt()
ABC_NAMESPACE_IMPL_START void fprint_pla(INOUT FILE *fp, IN pPLA PLA, IN int output_type)
Definition: cvrout.c:20
#define TRUE
Definition: cudd.h:88
int pla_type
Definition: espresso.h:318
void sf_cleanup()
Definition: set.c:374
pcover cv_dsharp()
runtime()
bool verbose_debug
Definition: globals.c:20
bool kiss
Definition: globals.c:29
pcover D
Definition: espresso.h:316
#define IRRED_TIME
Definition: espresso.h:377
pcover R
Definition: espresso.h:316
pcover super_gasp()
enum keys key
VOID_HACK srandom()
bool verify()
void free_PLA(pPLA PLA)
Definition: cvrin.c:676
pcover cv_intersect()
#define VERIFY_TIME
Definition: espresso.h:386
pcover simplify(pcube *T)
Definition: compl.c:566
int value
void map_dcset()
#define F_type
Definition: espresso.h:337
pcover minimize_exact()
#define EXEC(fct, name, S)
Definition: espresso.h:418
pset_family sf_union(INOUT pset_family A, INOUT pset_family B)
Definition: contain.c:121
pcover make_disjoint()
#define EXPAND_TIME
Definition: espresso.h:376
#define COMPL_TIME
Definition: espresso.h:373
bool remove_essential
Definition: globals.c:33
#define EXECUTE(fct, i, S, cost)
Definition: espresso.h:422
#define RELESSEN
Definition: espresso.h:132
pset_family sf_save()
bool recompute_onset
Definition: globals.c:32
pcube * cube1list(pcover A)
Definition: cofactor.c:289
runtime ( )

Definition at line 568 of file misc/espresso/main.c.

569 {
570  int i;
571  long total = 1, temp;
572 
573  for(i = 0; i < TIME_COUNT; i++) {
574  total += total_time[i];
575  }
576  for(i = 0; i < TIME_COUNT; i++) {
577  if (total_calls[i] != 0) {
578  temp = 100 * total_time[i];
579  printf("# %s\t%2d call(s) for %s (%2ld.%01ld%%)\n",
581  temp/total, (10 * (temp%total)) / total);
582  }
583  }
584 }
long total_time[TIME_COUNT]
Definition: globals.c:22
char * total_name[TIME_COUNT]
Definition: globals.c:21
#define print_time(t)
Definition: espresso.h:22
int total_calls[TIME_COUNT]
Definition: globals.c:23
#define TIME_COUNT
Definition: espresso.h:371
subcommands ( )

Definition at line 607 of file misc/espresso/main.c.

608 {
609  int i, col;
610  printf(" ");
611  col = 16;
612  for(i = 0; option_table[i].name != 0; i++) {
613  if ((col + strlen(option_table[i].name) + 1) > 76) {
614  printf(",\n ");
615  col = 16;
616  } else if (i != 0) {
617  printf(", ");
618  }
619  printf("%s", option_table[i].name);
620  col += strlen(option_table[i].name) + 2;
621  }
622  printf("\n");
623 }
struct @49 option_table[]
char * name
int strlen()
usage ( )

Definition at line 626 of file misc/espresso/main.c.

627 {
628  printf("%s\n\n", VERSION);
629  printf("SYNOPSIS: espresso [options] [file]\n\n");
630  printf(" -d Enable debugging\n");
631  printf(" -e[opt] Select espresso option:\n");
632  printf(" fast, ness, nirr, nunwrap, onset, pos, strong,\n");
633  printf(" eat, eatdots, kiss, random\n");
634  printf(" -o[type] Select output format:\n");
635  printf(" f, fd, fr, fdr, pleasure, eqntott, kiss, cons\n");
636  printf(" -rn-m Select range for subcommands:\n");
637  printf(" d1merge: first and last variables (0 ... m-1)\n");
638  printf(" minterms: first and last variables (0 ... m-1)\n");
639  printf(" opoall: first and last outputs (0 ... m-1)\n");
640  printf(" -s Provide short execution summary\n");
641  printf(" -t Provide longer execution trace\n");
642  printf(" -x Suppress printing of solution\n");
643  printf(" -v[type] Verbose debugging detail (-v '' for all)\n");
644  printf(" -D[cmd] Execute subcommand 'cmd':\n");
645  subcommands();
646  printf(" -Sn Select strategy for subcommands:\n");
647  printf(" opo: bit2=exact bit1=repeated bit0=skip sparse\n");
648  printf(" opoall: 0=minimize, 1=exact\n");
649  printf(" pair: 0=algebraic, 1=strongd, 2=espresso, 3=exact\n");
650  printf(" pairall: 0=minimize, 1=exact, 2=opo\n");
651  printf(" so_espresso: 0=minimize, 1=exact\n");
652  printf(" so_both: 0=minimize, 1=exact\n");
653 }
#define VERSION
Definition: espresso.h:367
subcommands()

Variable Documentation

int input_type = FD_type
static

Definition at line 23 of file misc/espresso/main.c.

ABC_NAMESPACE_IMPL_START FILE* last_fp
static

Definition at line 22 of file misc/espresso/main.c.