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

Go to the source code of this file.

Macros

#define USE_COMPL_LIFT   0
 
#define USE_COMPL_LIFT_ONSET   1
 
#define USE_COMPL_LIFT_ONSET_COMPLEX   2
 
#define NO_LIFTING   3
 

Functions

pcover complement (pcube *T)
 
void simp_comp (pcube *T, pcover *Tnew, pcover *Tbar)
 
pcover simplify (pcube *T)
 

Macro Definition Documentation

◆ NO_LIFTING

#define NO_LIFTING   3

Definition at line 35 of file compl.c.

◆ USE_COMPL_LIFT

#define USE_COMPL_LIFT   0

Definition at line 32 of file compl.c.

◆ USE_COMPL_LIFT_ONSET

#define USE_COMPL_LIFT_ONSET   1

Definition at line 33 of file compl.c.

◆ USE_COMPL_LIFT_ONSET_COMPLEX

#define USE_COMPL_LIFT_ONSET_COMPLEX   2

Definition at line 34 of file compl.c.

Function Documentation

◆ complement()

pcover complement ( pcube * T)

Definition at line 49 of file compl.c.

51{
52 register pcube cl, cr;
53 register int best;
54 pcover Tbar, Tl, Tr;
55 int lifting;
56 static int compl_level = 0;
57
58 if (debug & COMPL)
59 debug_print(T, "COMPLEMENT", compl_level++);
60
61 if (compl_special_cases(T, &Tbar) == MAYBE) {
62
63 /* Allocate space for the partition cubes */
64 cl = new_cube();
65 cr = new_cube();
66 best = binate_split_select(T, cl, cr, COMPL);
67
68 /* Complement the left and right halves */
69 Tl = complement(scofactor(T, cl, best));
70 Tr = complement(scofactor(T, cr, best));
71
72 if (Tr->count*Tl->count > (Tr->count+Tl->count)*CUBELISTSIZE(T)) {
73 lifting = USE_COMPL_LIFT_ONSET;
74 } else {
75 lifting = USE_COMPL_LIFT;
76 }
77 Tbar = compl_merge(T, Tl, Tr, cl, cr, best, lifting);
78
79 free_cube(cl);
80 free_cube(cr);
82 }
83
84 if (debug & COMPL)
85 debug1_print(Tbar, "exit COMPLEMENT", --compl_level);
86 return Tbar;
87}
#define USE_COMPL_LIFT
Definition compl.c:32
#define USE_COMPL_LIFT_ONSET
Definition compl.c:33
#define pcover
Definition espresso.h:264
#define new_cube()
Definition espresso.h:262
pcube * scofactor()
#define COMPL
Definition espresso.h:351
void debug1_print()
void debug_print()
#define pcube
Definition espresso.h:261
ABC_NAMESPACE_HEADER_END int binate_split_select()
#define free_cube(r)
Definition espresso.h:263
unsigned int debug
Definition globals.c:19
#define free_cubelist(T)
Definition espresso.h:267
#define CUBELISTSIZE(T)
Definition espresso.h:329
#define MAYBE
Definition espresso.h:257
pcover complement()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ simp_comp()

void simp_comp ( pcube * T,
pcover * Tnew,
pcover * Tbar )

Definition at line 425 of file compl.c.

429{
430 register pcube cl, cr;
431 register int best;
432 pcover Tl, Tr, Tlbar, Trbar;
433 int lifting;
434 static int simplify_level = 0;
435
436 if (debug & COMPL)
437 debug_print(T, "SIMPCOMP", simplify_level++);
438
439 if (simp_comp_special_cases(T, Tnew, Tbar) == MAYBE) {
440
441 /* Allocate space for the partition cubes */
442 cl = new_cube();
443 cr = new_cube();
444 best = binate_split_select(T, cl, cr, COMPL);
445
446 /* Complement the left and right halves */
447 simp_comp(scofactor(T, cl, best), &Tl, &Tlbar);
448 simp_comp(scofactor(T, cr, best), &Tr, &Trbar);
449
450 lifting = USE_COMPL_LIFT;
451 *Tnew = compl_merge(T, Tl, Tr, cl, cr, best, lifting);
452
453 lifting = USE_COMPL_LIFT;
454 *Tbar = compl_merge(T, Tlbar, Trbar, cl, cr, best, lifting);
455
456 /* All of this work for nothing ? Let's hope not ... */
457 if ((*Tnew)->count > CUBELISTSIZE(T)) {
458 sf_free(*Tnew);
459 *Tnew = cubeunlist(T);
460 }
461
462 free_cube(cl);
463 free_cube(cr);
464 free_cubelist(T);
465 }
466
467 if (debug & COMPL) {
468 debug1_print(*Tnew, "exit SIMPCOMP (new)", simplify_level);
469 debug1_print(*Tbar, "exit SIMPCOMP (compl)", simplify_level);
470 simplify_level--;
471 }
472}
void simp_comp()
pcover cubeunlist()
void sf_free()
Here is the call graph for this function:

◆ simplify()

pcover simplify ( pcube * T)

Definition at line 566 of file compl.c.

568{
569 register pcube cl, cr;
570 register int best;
571 pcover Tbar, Tl, Tr;
572 int lifting;
573 static int simplify_level = 0;
574
575 if (debug & COMPL) {
576 debug_print(T, "SIMPLIFY", simplify_level++);
577 }
578
579 if (simplify_special_cases(T, &Tbar) == MAYBE) {
580
581 /* Allocate space for the partition cubes */
582 cl = new_cube();
583 cr = new_cube();
584
585 best = binate_split_select(T, cl, cr, COMPL);
586
587 /* Complement the left and right halves */
588 Tl = simplify(scofactor(T, cl, best));
589 Tr = simplify(scofactor(T, cr, best));
590
591 lifting = USE_COMPL_LIFT;
592 Tbar = compl_merge(T, Tl, Tr, cl, cr, best, lifting);
593
594 /* All of this work for nothing ? Let's hope not ... */
595 if (Tbar->count > CUBELISTSIZE(T)) {
596 sf_free(Tbar);
597 Tbar = cubeunlist(T);
598 }
599
600 free_cube(cl);
601 free_cube(cr);
602 free_cubelist(T);
603 }
604
605 if (debug & COMPL) {
606 debug1_print(Tbar, "exit SIMPLIFY", --simplify_level);
607 }
608 return Tbar;
609}
pcover simplify()
Here is the call graph for this function:
Here is the caller graph for this function: