decMan.c 2.46 KB
Newer Older
Alan Mishchenko committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/**CFile****************************************************************

  FileName    [decMan.c]

  PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]

  Synopsis    [Decomposition manager.]

  Author      [MVSIS Group]
  
  Affiliation [UC Berkeley]

  Date        [Ver. 1.0. Started - February 1, 2003.]

  Revision    [$Id: decMan.c,v 1.1 2003/05/22 19:20:05 alanmi Exp $]

***********************************************************************/

19 20
#include "base/abc/abc.h"
#include "misc/mvc/mvc.h"
Alan Mishchenko committed
21 22
#include "dec.h"

23 24 25
ABC_NAMESPACE_IMPL_START


Alan Mishchenko committed
26 27 28 29 30
////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
Alan Mishchenko committed
31
///                     FUNCTION DEFINITIONS                         ///
Alan Mishchenko committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
////////////////////////////////////////////////////////////////////////

/**Function*************************************************************

  Synopsis    [Start the MVC manager used in the factoring package.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Dec_Man_t * Dec_ManStart()
{
    Dec_Man_t * p;
48
//    abctime clk = Abc_Clock();
Alan Mishchenko committed
49
    p = ABC_ALLOC( Dec_Man_t, 1 );
Alan Mishchenko committed
50 51 52 53 54
    p->pMvcMem = Mvc_ManagerStart();
    p->vCubes = Vec_IntAlloc( 8 );
    p->vLits = Vec_IntAlloc( 8 );
    // canonical forms, phases, perms
    Extra_Truth4VarNPN( &p->puCanons, &p->pPhases, &p->pPerms, &p->pMap );
55
//ABC_PRT( "NPN classes precomputation time", Abc_Clock() - clk ); 
Alan Mishchenko committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
    return p;
}

/**Function*************************************************************

  Synopsis    [Stops the MVC maanager used in the factoring package.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Dec_ManStop( Dec_Man_t * p )
{
72
    Mvc_ManagerFree( (Mvc_Manager_t *)p->pMvcMem );
Alan Mishchenko committed
73 74
    Vec_IntFree( p->vCubes );
    Vec_IntFree( p->vLits );
Alan Mishchenko committed
75 76 77 78 79
    ABC_FREE( p->puCanons );
    ABC_FREE( p->pPhases );
    ABC_FREE( p->pPerms );
    ABC_FREE( p->pMap );
    ABC_FREE( p );
Alan Mishchenko committed
80 81 82 83 84 85 86
}

////////////////////////////////////////////////////////////////////////
///                       END OF FILE                                ///
////////////////////////////////////////////////////////////////////////


87 88
ABC_NAMESPACE_IMPL_END