[14] | 1 | /**CHeaderFile***************************************************************** |
---|
| 2 | |
---|
| 3 | FileName [ord.h] |
---|
| 4 | |
---|
| 5 | PackageName [ord] |
---|
| 6 | |
---|
| 7 | Synopsis [Routines for ordering MDD variables of a flattened network.] |
---|
| 8 | |
---|
| 9 | Description [The routines in this package relate to ordering MDD variables |
---|
| 10 | corresponding to the nodes of a network. The enumerated type Ord_OrderType |
---|
| 11 | is used to specify to which set of nodes certain ordering routines should |
---|
| 12 | be applied. The following matrix shows which node types are included in |
---|
| 13 | each ordering type: |
---|
| 14 | <pre> |
---|
| 15 | | Ord_OrderType |
---|
| 16 | node type | All InputAndLatch NextStateNode |
---|
| 17 | ----------------+--------------------------------------- |
---|
| 18 | primary input | x x |
---|
| 19 | pseudo input | x x |
---|
| 20 | latch | x x |
---|
| 21 | shadow | x x x |
---|
| 22 | combinational | x |
---|
| 23 | |
---|
| 24 | </pre> |
---|
| 25 | |
---|
| 26 | In addition, the order type Partial can be used to specify an arbitrary |
---|
| 27 | subset of nodes.<p> |
---|
| 28 | |
---|
| 29 | There are various methods for ordering the roots of a network, and for |
---|
| 30 | ordering the nodes of a network. These are explained in the documentation |
---|
| 31 | for the static_order command.] |
---|
| 32 | |
---|
| 33 | Author [Adnan Aziz, Tom Shiple, Serdar Tasiran] |
---|
| 34 | |
---|
| 35 | Copyright [Copyright (c) 1994-1996 The Regents of the Univ. of California. |
---|
| 36 | All rights reserved. |
---|
| 37 | |
---|
| 38 | Permission is hereby granted, without written agreement and without license |
---|
| 39 | or royalty fees, to use, copy, modify, and distribute this software and its |
---|
| 40 | documentation for any purpose, provided that the above copyright notice and |
---|
| 41 | the following two paragraphs appear in all copies of this software. |
---|
| 42 | |
---|
| 43 | IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR |
---|
| 44 | DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT |
---|
| 45 | OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF |
---|
| 46 | CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 47 | |
---|
| 48 | THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, |
---|
| 49 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
---|
| 50 | FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN |
---|
| 51 | "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE |
---|
| 52 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.] |
---|
| 53 | |
---|
| 54 | Revision [$Id: ord.h,v 1.10 2002/09/08 23:26:15 fabio Exp $] |
---|
| 55 | |
---|
| 56 | ******************************************************************************/ |
---|
| 57 | |
---|
| 58 | #ifndef _ORD |
---|
| 59 | #define _ORD |
---|
| 60 | |
---|
| 61 | /*---------------------------------------------------------------------------*/ |
---|
| 62 | /* Nested includes */ |
---|
| 63 | /*---------------------------------------------------------------------------*/ |
---|
| 64 | #include <time.h> |
---|
| 65 | #include <math.h> |
---|
| 66 | #include "ntk.h" |
---|
| 67 | |
---|
| 68 | /*---------------------------------------------------------------------------*/ |
---|
| 69 | /* Constant declarations */ |
---|
| 70 | /*---------------------------------------------------------------------------*/ |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | /*---------------------------------------------------------------------------*/ |
---|
| 74 | /* Type declarations */ |
---|
| 75 | /*---------------------------------------------------------------------------*/ |
---|
| 76 | /**Enum************************************************************************ |
---|
| 77 | |
---|
| 78 | Synopsis [Used to specify particular subsets of network nodes.] |
---|
| 79 | |
---|
| 80 | Description [Used to specify particular subsets of network nodes. This |
---|
| 81 | enumerated type is used to specify which nodes are to be ordered, or which |
---|
| 82 | nodes are supplied in an ordering file. "All" nodes of a network is exactly |
---|
| 83 | the set returned by Ntk_NetworkReadNodes (this includes shadow nodes). ] |
---|
| 84 | |
---|
| 85 | SeeAlso [Ord_NetworkOrderVariables] |
---|
| 86 | |
---|
| 87 | ******************************************************************************/ |
---|
| 88 | typedef enum { |
---|
| 89 | Ord_All_c, /* all nodes in network */ |
---|
| 90 | Ord_NextStateNode_c, /* latch NS nodes */ |
---|
| 91 | Ord_Partial_c, /* arbitrary subset of all nodes in network */ |
---|
| 92 | Ord_InputAndLatch_c, /* primary and pseudo inputs, latches, and latch NS */ |
---|
| 93 | Ord_Unassigned_c /* not specified */ |
---|
| 94 | } Ord_OrderType; |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | /**Enum************************************************************************ |
---|
| 98 | |
---|
| 99 | Synopsis [Used to specify a particular method to order the roots of a network.] |
---|
| 100 | |
---|
| 101 | Description [Used to specify a particular method to order the roots of a |
---|
| 102 | network. The nodes of a network are explored in DFS order, starting from |
---|
| 103 | the ordered list of roots.] |
---|
| 104 | |
---|
| 105 | SeeAlso [Ord_NetworkOrderRoots] |
---|
| 106 | |
---|
| 107 | ******************************************************************************/ |
---|
| 108 | typedef enum { |
---|
| 109 | Ord_RootsByDepth_c, /* decreasing order of logic depth */ |
---|
| 110 | Ord_RootsByPerm_c, /* permutation that minimizes a communication-based |
---|
| 111 | cost function */ |
---|
| 112 | Ord_RootsByDefault_c /* hardcoded default method (one of the above) */ |
---|
| 113 | } Ord_RootMethod; |
---|
| 114 | |
---|
| 115 | |
---|
| 116 | /**Enum************************************************************************ |
---|
| 117 | |
---|
| 118 | Synopsis [Used to specify a particular method to order the nodes of a network.] |
---|
| 119 | |
---|
| 120 | Description [Used to specify a particular method to order the nodes of a |
---|
| 121 | network. These methods produce a total ordering on all of the nodes of a |
---|
| 122 | network, including the next state nodes.] |
---|
| 123 | |
---|
| 124 | SeeAlso [Ord_NetworkOrderNodes] |
---|
| 125 | |
---|
| 126 | ******************************************************************************/ |
---|
| 127 | typedef enum { |
---|
| 128 | Ord_NodesByInterleaving_c, /* Interleaving algorithm of Fujii et al. */ |
---|
| 129 | Ord_NodesByMergingLeft_c, /* DFS by depth, merging left orderings of fanins */ |
---|
| 130 | Ord_NodesByMergingRight_c, /* DFS by depth, merging right orderings of fanins */ |
---|
| 131 | Ord_NodesByAppending_c, /* DFS by depth, appending nodes as visited */ |
---|
| 132 | Ord_NodesByDefault_c /* hardcoded default method (one of the above) */ |
---|
| 133 | } Ord_NodeMethod; |
---|
| 134 | |
---|
| 135 | |
---|
| 136 | /**Enum************************************************************************ |
---|
| 137 | |
---|
| 138 | Synopsis [Used to specify a particular method to merge two lists.] |
---|
| 139 | |
---|
| 140 | SeeAlso [Ord_ListMergeListUsingTable] |
---|
| 141 | |
---|
| 142 | ******************************************************************************/ |
---|
| 143 | typedef enum { |
---|
| 144 | Ord_ListMergeLeft_c, /* merge left two lists */ |
---|
| 145 | Ord_ListMergeRight_c /* merge right two lists */ |
---|
| 146 | } Ord_ListMergeMethod; |
---|
| 147 | |
---|
| 148 | |
---|
| 149 | /**AutomaticStart*************************************************************/ |
---|
| 150 | |
---|
| 151 | /*---------------------------------------------------------------------------*/ |
---|
| 152 | /* Function prototypes */ |
---|
| 153 | /*---------------------------------------------------------------------------*/ |
---|
| 154 | |
---|
| 155 | EXTERN void Ord_Init(void); |
---|
| 156 | EXTERN void Ord_End(void); |
---|
| 157 | EXTERN boolean Ord_NetworkTestAreVariablesOrdered(Ntk_Network_t * network, Ord_OrderType orderType); |
---|
| 158 | EXTERN int Ord_NetworkPrintVariableOrder(FILE * fp, Ntk_Network_t * network, Ord_OrderType orderType); |
---|
| 159 | EXTERN char ** Ord_NetworkGetCombInputNamesInOrder(Ntk_Network_t *network); |
---|
| 160 | EXTERN boolean Ord_FileReadNodeList(FILE * fp, Ntk_Network_t * network, lsList * nodeList, int verbose); |
---|
| 161 | EXTERN void Ord_NetworkOrderVariables(Ntk_Network_t *network, Ord_RootMethod rootOrderMethod, Ord_NodeMethod nodeOrderMethod, boolean nsAfterSupport, Ord_OrderType generatedOrderType, Ord_OrderType suppliedOrderType, lsList suppliedNodeList, int verbose); |
---|
| 162 | EXTERN lsList Ord_NetworkOrderNodes(Ntk_Network_t *network, Ord_RootMethod rootOrderMethod, Ord_NodeMethod nodeOrderMethod, boolean nsAfterSupport, Ord_OrderType generatedOrderType, Ord_OrderType suppliedOrderType, lsList suppliedNodeList, int verbose); |
---|
| 163 | EXTERN void Ord_NetworkAssignMddIdForNode(Ntk_Network_t *network, Ntk_Node_t *node); |
---|
| 164 | EXTERN void Ord_ListMergeLeftListUsingTable(lsList list1, lsList list2, st_table *dataToHandle1); |
---|
| 165 | EXTERN void Ord_ListMergeRightListUsingTable(lsList list1, lsList list2, st_table *dataToHandle1); |
---|
| 166 | EXTERN void Ord_ListMergeListUsingTable(lsList list1, lsList list2, st_table *dataToHandle1, Ord_ListMergeMethod method); |
---|
| 167 | EXTERN void Ord_ListAppendList(lsList list1, lsList list2); |
---|
| 168 | EXTERN void Ord_ListMergeList(lsList list1, lsList list2, Ord_ListMergeMethod method); |
---|
| 169 | EXTERN lsList Ord_NetworkOrderRoots(Ntk_Network_t *network, Ord_RootMethod rootMethod, lsList partialOrder, boolean verbose); |
---|
| 170 | |
---|
| 171 | /**AutomaticEnd***************************************************************/ |
---|
| 172 | |
---|
| 173 | #endif /* _ORD */ |
---|