mpmLib.c 1.99 KB
Newer Older
Alan Mishchenko committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
/**CFile****************************************************************

  FileName    [mpmLib.c]

  SystemName  [ABC: Logic synthesis and verification system.]

  PackageName [Configurable technology mapper.]

  Synopsis    [DSD manipulation for 6-input functions.]

  Author      [Alan Mishchenko]
  
  Affiliation [UC Berkeley]

  Date        [Ver. 1.0. Started - June 1, 2013.]

  Revision    [$Id: mpmLib.c,v 1.00 2013/06/01 00:00:00 alanmi Exp $]

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

#include "mpmInt.h"

ABC_NAMESPACE_IMPL_START


////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
///                     FUNCTION DEFINITIONS                         ///
////////////////////////////////////////////////////////////////////////

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

  Synopsis    []

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Mpm_LibLut_t * Mpm_LibLutSetSimple( int nLutSize )
{
    Mpm_LibLut_t * pLib;
    int i, k;
Alan Mishchenko committed
49
    assert( nLutSize <= MPM_VAR_MAX );
Alan Mishchenko committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
    pLib = ABC_CALLOC( Mpm_LibLut_t, 1 );
    pLib->LutMax = nLutSize;
    for ( i = 1; i <= pLib->LutMax; i++ )
    {
        pLib->pLutAreas[i] = MPM_UNIT_AREA;
        for ( k = 0; k < i; k++ )
            pLib->pLutDelays[i][k] = MPM_UNIT_TIME;
    }
    return pLib;
}
void Mpm_LibLutFree( Mpm_LibLut_t * pLib )
{
    if ( pLib == NULL )
        return;
    ABC_FREE( pLib->pName );
    ABC_FREE( pLib );
}

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


ABC_NAMESPACE_IMPL_END