source: vis_dev/vis-2.3/src/tbl/tblAigEntryUtil.c @ 64

Last change on this file since 64 was 14, checked in by cecile, 13 years ago

vis2.3

File size: 3.5 KB
Line 
1/**CFile***********************************************************************
2
3  FileName    [tblAigEntryUtil.c]
4
5  PackageName [tbl]
6
7  Synopsis    []
8
9  Description [Defines functions to manuplate table Entry using And/Inverter graph]
10
11  SeeAlso     [tblUtil.c, tblAigUtil.c]
12
13  Author      [Mohammad Awedh]
14
15  Copyright   []
16
17******************************************************************************/
18
19#include "tblInt.h"
20#include "baig.h"
21
22static char rcsid[] UNUSED = "$Id: tblAigEntryUtil.c,v 1.4 2005/04/17 14:37:23 awedh Exp $";
23
24/**AutomaticStart*************************************************************/
25
26/*---------------------------------------------------------------------------*/
27/* Static function prototypes                                                */
28/*---------------------------------------------------------------------------*/
29
30
31/**AutomaticEnd***************************************************************/
32/*---------------------------------------------------------------------------*/
33/* Definition of exported functions                                          */
34/*---------------------------------------------------------------------------*/
35
36
37/*---------------------------------------------------------------------------*/
38/* Definition of internal functions                                          */
39/*---------------------------------------------------------------------------*/
40
41/**Function********************************************************************
42
43  Synopsis    [Returns the mAigEdge_t for a table entry]
44
45  Description [Given an array of constituent mAigEdge_t, and a table entry, this returns
46  an mAig for the entry. The array of mAigEdge_t's must contain an mAigEdge_t for value i in
47  position i, for all values i.]
48
49  SideEffects []
50
51  SeeAlso     []
52[Done]
53******************************************************************************/
54mAigEdge_t
55TblEntryNormalConstructAig(
56    mAig_Manager_t *manager,
57    Tbl_Entry_t    *entry,
58    array_t        *mAigArray)
59{
60  lsGen gen;
61  Tbl_Range_t *range;
62  int i;
63  mAigEdge_t result, temp, x;
64   
65  result = mAig_Zero;
66  lsForEachItem(entry->EntryData.listOfRanges, gen, range) {
67    for (i=range->begin; i< (range->end +1); i++) {
68      temp = result;
69      x = MvfAig_FunctionReadComponent(mAigArray,i);
70      result = mAig_Or(manager, temp, x);
71    }
72  }
73  return result;
74}
75
76/**Function********************************************************************
77
78  Synopsis    [Returns the mAigEdge_t for a table entry]
79
80  Description [Given an array of constituent mAigEdge_t, and a table entry, this returns
81  an mAig for the entry. The array of mAigEdge_t's must contain an mAigEdge_t for value i in
82  position i, for all values i.]
83
84  SideEffects []
85
86  SeeAlso     []
87[Done]
88******************************************************************************/
89mAigEdge_t
90TblEntryEqualConstructMAig(
91    mAig_Manager_t    * manager,
92    Tbl_Entry_t       * entry,
93    MvfAig_Function_t * mAigArray,
94    MvfAig_Function_t * mEigArray)
95{
96  lsGen        gen;
97  Tbl_Range_t *range;
98  int          i;
99  mAigEdge_t   result, temp, x;
100
101  assert(entry->type == Tbl_EntryNormal_c);
102  result = mAig_Zero;
103  lsForEachItem(entry->EntryData.listOfRanges, gen, range) {
104    for (i=range->begin; i< (range->end +1); i++) {
105      temp = result;
106      x = MvfAig_FunctionReadComponent(mAigArray,i);
107      result = mAig_Or(manager, temp, x);
108      temp = result;
109      x = MvfAig_FunctionReadComponent(mAigArray,i);
110      result = mAig_Or(manager, temp, x);
111    }
112  }
113  return result;
114}
115
116
117
Note: See TracBrowser for help on using the repository browser.