mioInt.h 5.58 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    [mioInt.h]

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

  Synopsis    [File reading/writing for technology mapping.]

  Author      [MVSIS Group]
  
  Affiliation [UC Berkeley]

  Date        [Ver. 1.0. Started - September 8, 2003.]

  Revision    [$Id: mioInt.h,v 1.4 2004/06/28 14:20:25 alanmi Exp $]

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

19 20
#ifndef ABC__map__mio__mioInt_h
#define ABC__map__mio__mioInt_h
Alan Mishchenko committed
21

22

Alan Mishchenko committed
23 24 25 26
////////////////////////////////////////////////////////////////////////
///                          INCLUDES                                ///
////////////////////////////////////////////////////////////////////////

27 28 29 30
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
31 32 33
#include "misc/vec/vec.h"
#include "misc/mem/mem.h"
#include "misc/st/st.h"
Alan Mishchenko committed
34
#include "mio.h"
35
 
36 37 38
ABC_NAMESPACE_HEADER_START


Alan Mishchenko committed
39 40 41 42 43
////////////////////////////////////////////////////////////////////////
///                         PARAMETERS                               ///
////////////////////////////////////////////////////////////////////////

#define    MIO_STRING_GATE       "GATE"
44
#define    MIO_STRING_LATCH      "LATCH"
Alan Mishchenko committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
#define    MIO_STRING_PIN        "PIN"
#define    MIO_STRING_NONINV     "NONINV"
#define    MIO_STRING_INV        "INV"
#define    MIO_STRING_UNKNOWN    "UNKNOWN"

#define    MIO_STRING_CONST0     "CONST0"
#define    MIO_STRING_CONST1     "CONST1"
 
// the bit masks
#define    MIO_MASK(n)         ((~((unsigned)0)) >> (32-(n)))
#define    MIO_FULL             (~((unsigned)0))

////////////////////////////////////////////////////////////////////////
///                    STRUCTURE DEFINITIONS                         ///
////////////////////////////////////////////////////////////////////////

struct  Mio_LibraryStruct_t_
{
    char *             pName;       // the name of the library
    int                nGates;      // the number of the gates
Alan Mishchenko committed
65 66
    Mio_Gate_t **      ppGates0;    // the array of gates in the original order
    Mio_Gate_t **      ppGatesName; // the array of gates sorted by name
Alan Mishchenko committed
67 68 69 70 71 72
    Mio_Gate_t *       pGates;      // the linked list of all gates in no particular order
    Mio_Gate_t *       pGate0;      // the constant zero gate
    Mio_Gate_t *       pGate1;      // the constant one gate
    Mio_Gate_t *       pGateBuf;    // the buffer
    Mio_Gate_t *       pGateInv;    // the inverter
    Mio_Gate_t *       pGateNand2;  // the NAND2 gate
Alan Mishchenko committed
73
    Mio_Gate_t *       pGateAnd2;   // the AND2 gate
74 75
    Mio_Gate_t *       pGateNor2;   // the NOR2 gate
    Mio_Gate_t *       pGateOr2;    // the OR2 gate
76
    st__table *         tName2Gate;  // the mapping of gate names into their pointer
77
    Mem_Flex_t *       pMmFlex;     // the memory manaqer for SOPs
Alan Mishchenko committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
    Vec_Str_t *        vCube;       // temporary cube
}; 

struct  Mio_GateStruct_t_
{
    // information derived from the genlib file
    char *             pName;       // the name of the gate
    double             dArea;       // the area of the gate
    char *             pForm;       // the formula describing functionality of the gate
    Mio_Pin_t *        pPins;       // the linked list of all pins (one pin if info is the same)
    char *             pOutName;    // the name of the output pin 
    // the library to which this gate belongs
    Mio_Library_t *    pLib; 
    // the next gate in the list
    Mio_Gate_t *       pNext;    
93
    Mio_Gate_t *       pTwin;    
Alan Mishchenko committed
94 95

    // the derived information
96
    int                Cell;        // cell id
Alan Mishchenko committed
97
    int                nInputs;     // the number of inputs
98
    int                Profile;     // the number of occurrences
99
    int                Profile2;    // the number of occurrences
Alan Mishchenko committed
100
    double             dDelayMax;   // the maximum delay
Alan Mishchenko committed
101
    char *             pSop;        // sum-of-products
102 103 104
    Vec_Int_t *        vExpr;       // boolean expression
    union { word       uTruth;      // truth table
    word *             pTruth; };   // pointer to the truth table
Alan Mishchenko committed
105
    int                Value;       // user's information
Alan Mishchenko committed
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
};

struct  Mio_PinStruct_t_
{
    char *             pName;
    Mio_PinPhase_t     Phase;
    double             dLoadInput;
    double             dLoadMax;
    double             dDelayBlockRise;
    double             dDelayFanoutRise;
    double             dDelayBlockFall;
    double             dDelayFanoutFall;
    double             dDelayBlockMax;
    Mio_Pin_t *        pNext;     
};


////////////////////////////////////////////////////////////////////////
///                       GLOBAL VARIABLES                           ///
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
Alan Mishchenko committed
128
///                       MACRO DEFINITIONS                          ///
Alan Mishchenko committed
129 130 131
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
Alan Mishchenko committed
132
///                     FUNCTION DEFINITIONS                         ///
Alan Mishchenko committed
133 134 135 136 137 138
////////////////////////////////////////////////////////////////////////

/*=== mio.c =============================================================*/
/*=== mioRead.c =============================================================*/
/*=== mioUtils.c =============================================================*/

139 140 141

ABC_NAMESPACE_HEADER_END

Alan Mishchenko committed
142 143
#endif

Alan Mishchenko committed
144 145 146
////////////////////////////////////////////////////////////////////////
///                       END OF FILE                                ///
////////////////////////////////////////////////////////////////////////