#include <stdio.h>#include <stdlib.h>#include <string.h>#include <float.h>#include <math.h>#include "base/main/main.h"#include "map/mio/mio.h"#include "mapper.h"

Go to the source code of this file.
Classes | |
| struct | Map_ManStruct_t_ |
| STRUCTURE DEFINITIONS ///. More... | |
| struct | Map_SuperLibStruct_t_ |
| struct | Map_NodeStruct_t_ |
| struct | Map_MatchStruct_t_ |
| struct | Map_CutStruct_t_ |
| struct | Map_SuperStruct_t_ |
| struct | Map_NodeVecStruct_t_ |
| struct | Map_HashTableStruct_t_ |
| struct | Map_HashEntryStruct_t_ |
Macros | |
| #define | MAP_MASK(n) |
| INCLUDES ///. | |
| #define | MAP_FULL (~((unsigned)0)) |
| #define | MAP_NO_VAR (-9999.0) |
| #define | MAP_MIN(a, b) |
| #define | MAP_MAX(a, b) |
| #define | MAP_FLOAT_LARGE ((float)(FLT_MAX/10)) |
| #define | MAP_FLOAT_SMALL ((float)1.0e-03) |
| #define | MAP_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand())) |
| #define | Map_CutIsComplement(p) |
| #define | Map_CutRegular(p) |
| #define | Map_CutNot(p) |
| #define | Map_CutNotCond(p, c) |
| #define | Map_NodeReadRef(p) |
| #define | Map_NodeRef(p) |
| #define | Map_InfoSetVar(p, i) |
| #define | Map_InfoRemVar(p, i) |
| #define | Map_InfoFlipVar(p, i) |
| #define | Map_InfoReadVar(p, i) |
| #define | Map_NodeIsSimComplement(p) |
| #define | Map_NodeReadNextFanout(pNode, pFanout) |
| #define | Map_NodeReadNextFanoutPlace(pNode, pFanout) |
| #define | Map_NodeForEachFanout(pNode, pFanout) |
| #define | Map_NodeForEachFanoutSafe(pNode, pFanout, pFanout2) |
| #define Map_CutIsComplement | ( | p | ) |
Definition at line 68 of file mapperInt.h.
| #define Map_CutNot | ( | p | ) |
Definition at line 70 of file mapperInt.h.
| #define Map_CutNotCond | ( | p, | |
| c ) |
Definition at line 71 of file mapperInt.h.
| #define Map_CutRegular | ( | p | ) |
Definition at line 69 of file mapperInt.h.
| #define MAP_FLOAT_LARGE ((float)(FLT_MAX/10)) |
Definition at line 61 of file mapperInt.h.
| #define MAP_FLOAT_SMALL ((float)1.0e-03) |
Definition at line 62 of file mapperInt.h.
| #define MAP_FULL (~((unsigned)0)) |
Definition at line 53 of file mapperInt.h.
| #define Map_InfoFlipVar | ( | p, | |
| i ) |
Definition at line 80 of file mapperInt.h.
| #define Map_InfoReadVar | ( | p, | |
| i ) |
Definition at line 81 of file mapperInt.h.
| #define Map_InfoRemVar | ( | p, | |
| i ) |
Definition at line 79 of file mapperInt.h.
| #define Map_InfoSetVar | ( | p, | |
| i ) |
Definition at line 78 of file mapperInt.h.
| #define MAP_MASK | ( | n | ) |
INCLUDES ///.
CFile****************************************************************
FileName [mapperInt.h]
PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]
Synopsis [Generic technology mapping engine.]
Author [MVSIS Group]
Affiliation [UC Berkeley]
Date [Ver. 2.0. Started - June 1, 2004.]
Revision [
] PARAMETERS /// MACRO DEFINITIONS ///
Definition at line 52 of file mapperInt.h.
| #define MAP_MAX | ( | a, | |
| b ) |
Definition at line 58 of file mapperInt.h.
| #define MAP_MIN | ( | a, | |
| b ) |
Definition at line 57 of file mapperInt.h.
| #define MAP_NO_VAR (-9999.0) |
Definition at line 54 of file mapperInt.h.
| #define Map_NodeForEachFanout | ( | pNode, | |
| pFanout ) |
Definition at line 340 of file mapperInt.h.
| #define Map_NodeForEachFanoutSafe | ( | pNode, | |
| pFanout, | |||
| pFanout2 ) |
Definition at line 345 of file mapperInt.h.
| #define Map_NodeIsSimComplement | ( | p | ) |
Definition at line 84 of file mapperInt.h.
| #define Map_NodeReadNextFanout | ( | pNode, | |
| pFanout ) |
Definition at line 329 of file mapperInt.h.
| #define Map_NodeReadNextFanoutPlace | ( | pNode, | |
| pFanout ) |
Definition at line 335 of file mapperInt.h.
| #define Map_NodeReadRef | ( | p | ) |
Definition at line 74 of file mapperInt.h.
| #define Map_NodeRef | ( | p | ) |
Definition at line 75 of file mapperInt.h.
| #define MAP_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand())) |
Definition at line 65 of file mapperInt.h.
DECLARATIONS ///.
CFile****************************************************************
FileName [mapperCutUtils.c]
PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]
Synopsis [Generic technology mapping engine.]
Author [MVSIS Group]
Affiliation [UC Berkeley]
Date [Ver. 2.0. Started - June 1, 2004.]
Revision [
] FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Allocates the cut.]
Description []
SideEffects []
SeeAlso []
Definition at line 43 of file mapperCutUtils.c.
|
extern |
function*************************************************************
synopsis [Dereferences the cut.]
description []
sideeffects []
seealso []
Definition at line 391 of file mapperRefs.c.


Function*************************************************************
Synopsis [Deallocates the cut.]
Description []
SideEffects []
SeeAlso []
Definition at line 75 of file mapperCutUtils.c.

|
extern |
function*************************************************************
synopsis [Computes the exact area associated with the cut.]
description []
sideeffects []
seealso []
Definition at line 355 of file mapperRefs.c.


|
extern |
function*************************************************************
synopsis [Computes the area flow of the cut.]
description [Computes the area flow of the cut if it is implemented using the best supergate with the best phase.]
sideeffects []
seealso []
Definition at line 179 of file mapperRefs.c.


|
extern |
function*************************************************************
synopsis [Computes the exact area associated with the cut.]
description [Assumes that the cut is referenced.]
sideeffects []
seealso []
Definition at line 335 of file mapperRefs.c.

|
extern |
function*************************************************************
synopsis [Computes the exact area associated with the cut.]
description []
sideeffects []
seealso []
Definition at line 131 of file mapperCutUtils.c.

|
extern |
function*************************************************************
synopsis [Computes the exact area associated with the cut.]
description []
sideeffects []
seealso []
Definition at line 114 of file mapperCutUtils.c.

|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 165 of file mapperCutUtils.c.
|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 214 of file mapperCutUtils.c.
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 193 of file mapperCutUtils.c.

|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 92 of file mapperCutUtils.c.
|
extern |
function*************************************************************
synopsis [References the cut.]
description []
sideeffects []
seealso []
Definition at line 375 of file mapperRefs.c.


|
extern |
|
extern |
Function*************************************************************
Synopsis [Derives information about the library.]
Description []
SideEffects []
SeeAlso []
Definition at line 586 of file mapperTree.c.


|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 403 of file mapperSuper.c.
|
extern |
Function*************************************************************
Synopsis [Prints the supergate library after deriving parameters.]
Description [This procedure is very useful to see the library after it has been read into the mapper by "read_super" and all the information about the supergates derived.]
SideEffects []
SeeAlso []
Definition at line 979 of file mapperTree.c.

|
extern |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Reads the supergate library from file.]
Description []
SideEffects []
SeeAlso []
Definition at line 50 of file mapperSuper.c.

|
extern |
Function*************************************************************
Synopsis [Reads the supergate library from file.]
Description []
SideEffects []
SeeAlso []
Definition at line 391 of file mapperTree.c.


|
extern |
Definition at line 525 of file mapperTree.c.


|
extern |
Function*************************************************************
Synopsis [Compute the arrival times.]
Description []
SideEffects []
SeeAlso []
Definition at line 713 of file mapperUtils.c.

|
extern |
Function*************************************************************
Synopsis [Counts how many AIG nodes are mapped in both polarities.]
Description []
SideEffects []
SeeAlso []
Definition at line 583 of file mapperUtils.c.

|
extern |
Function*************************************************************
Synopsis [Computes the number of logic levels not counting PIs/POs.]
Description []
SideEffects [Note that this procedure will reassign the levels assigned originally by NodeCreate() because it counts the number of levels with choices differently!]
SeeAlso []
Definition at line 105 of file mapperUtils.c.

|
extern |
GLOBAL VARIABLES ///.
FUNCTION DEFINITIONS ///
Definition at line 172 of file mapperCut.c.


|
extern |
Definition at line 77 of file mapperUtils.c.


|
extern |
Function*************************************************************
Synopsis [Sets the estimated reference counter.]
Description [When this procedure is called for the first time, the reference counter is estimated from the AIG. Otherwise, it is a linear combination of reference counters in the last two iterations.]
SideEffects []
SeeAlso []
Definition at line 151 of file mapperRefs.c.

|
extern |
Function*************************************************************
Synopsis [Sets the estimated reference counter for the PIs.]
Description []
SideEffects []
SeeAlso []
Definition at line 126 of file mapperRefs.c.

|
extern |
Function*************************************************************
Synopsis [Expand the truth table]
Description []
SideEffects []
SeeAlso []
Definition at line 670 of file mapperUtils.c.
|
extern |
Function*************************************************************
Synopsis [Computes the array of mapping.]
Description []
SideEffects []
SeeAlso []
Definition at line 485 of file mapperRefs.c.


|
extern |
Function*************************************************************
Synopsis [Computes the total are flow of the network.]
Description []
SideEffects []
SeeAlso []
Definition at line 487 of file mapperUtils.c.


|
extern |
Function*************************************************************
Synopsis [Sets up the mask.]
Description []
SideEffects []
SeeAlso []
Definition at line 750 of file mapperUtils.c.

|
extern |
Function*************************************************************
Synopsis [Computes the array of mapping.]
Description []
SideEffects []
SeeAlso []
Definition at line 187 of file mapperSwitch.c.


|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 207 of file mapperUtils.c.


|
extern |
Function*************************************************************
Synopsis [Computes the best matches of the nodes.]
Description [Uses parameter p->fMappingMode to decide how to assign the matches for both polarities of the node. While the matches are being assigned, one of them may turn out to be better than the other (in terms of delay, for example). In this case, the worse match can be permanently dropped, and the corresponding pointer set to NULL.]
SideEffects []
SeeAlso []
Definition at line 581 of file mapperMatch.c.


|
extern |
Function*************************************************************
Synopsis [Returns 1 if current mapping of the node violates fanout limits.]
Description []
SideEffects []
SeeAlso []
Definition at line 471 of file mapperUtils.c.
|
extern |
Function*************************************************************
Synopsis [Prints a bunch of latest arriving outputs.]
Description []
SideEffects []
SeeAlso []
Definition at line 289 of file mapperUtils.c.


|
extern |
|
extern |
|
extern |
Function*************************************************************
Synopsis [Reports statistics on choice nodes.]
Description [The number of choice nodes is the number of primary nodes, which has pNextE set to a pointer. The number of choices is the number of entries in the equivalent-node lists of the primary nodes.]
SideEffects []
SeeAlso []
Definition at line 842 of file mapperUtils.c.


|
extern |
Function*************************************************************
Synopsis [Resets the levels of the nodes in the choice graph.]
Description [Makes the level of the choice nodes to be equal to the maximum of the level of the nodes in the equivalence class. This way sorting by level leads to the reverse topological order, which is needed for the required time computation.]
SideEffects []
SeeAlso []
Definition at line 821 of file mapperUtils.c.


|
extern |
|
extern |
Definition at line 450 of file mapperRefs.c.


|
extern |
Function*************************************************************
Synopsis [Sets up the mask.]
Description []
SideEffects []
SeeAlso []
Definition at line 402 of file mapperUtils.c.
|
extern |
Function*************************************************************
Synopsis [Orders the nodes in the decreasing order of levels.]
Description []
SideEffects []
SeeAlso []
Definition at line 544 of file mapperUtils.c.

|
extern |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Derives truth tables for each cut.]
Description []
SideEffects []
SeeAlso []
Definition at line 47 of file mapperTruth.c.


|
extern |
Function*************************************************************
Synopsis [Unmarks the nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 163 of file mapperUtils.c.

|
extern |
Function*************************************************************
Synopsis [Recursively unmarks the nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 181 of file mapperUtils.c.


|
extern |
|
extern |

|
extern |
|
extern |
function*************************************************************
synopsis [Computes the exact area associated with the cut.]
description []
sideeffects []
seealso []
Definition at line 148 of file mapperCutUtils.c.
|
extern |
|
extern |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Allocates a vector with the given capacity.]
Description []
SideEffects []
SeeAlso []
Definition at line 45 of file mapperVec.c.

|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 174 of file mapperVec.c.
|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 87 of file mapperVec.c.

|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 68 of file mapperVec.c.

|
extern |
Function*************************************************************
Synopsis [Resizes the vector to the given capacity.]
Description []
SideEffects []
SeeAlso []
Definition at line 138 of file mapperVec.c.

|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 234 of file mapperVec.c.
|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 190 of file mapperVec.c.


|
extern |
Function*************************************************************
Synopsis [Add the element while ensuring uniqueness.]
Description [Returns 1 if the element was found, and 0 if it was new. ]
SideEffects []
SeeAlso []
Definition at line 213 of file mapperVec.c.

|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 106 of file mapperVec.c.

|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 290 of file mapperVec.c.
|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 122 of file mapperVec.c.

|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 250 of file mapperVec.c.
|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 157 of file mapperVec.c.
|
extern |
Function*************************************************************
Synopsis [Sorting the entries by their integer value.]
Description []
SideEffects []
SeeAlso []
Definition at line 307 of file mapperVec.c.
|
extern |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 273 of file mapperVec.c.
|
extern |
DECLARATIONS ///.
FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Reads in the supergate library and prepares it for use.]
Description [The supergates library comes in a .super file. This file contains descriptions of supergates along with some relevant information. This procedure reads the supergate file, canonicizes the supergates, and constructs an additional lookup table, which can be used to map truth tables of the cuts into the pair (phase, supergate). The phase indicates how the current truth table should be phase assigned to match the canonical form of the supergate. The resulting phase is the bitwise EXOR of the phase needed to canonicize the supergate and the phase needed to transform the truth table into its canonical form.]
SideEffects []
SeeAlso []
Definition at line 61 of file mapperLib.c.


|
extern |
Function*************************************************************
Synopsis [Deallocates the supergate library.]
Description []
SideEffects []
SeeAlso []
Definition at line 170 of file mapperLib.c.

|
extern |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Creates the hash table for supergates.]
Description []
SideEffects []
SeeAlso []
Definition at line 48 of file mapperTable.c.


|
extern |
|
extern |
Function*************************************************************
Synopsis [Inserts a new entry into the library.]
Description [This function inserts the new gate (pGate), which will be accessible through its unfolded function (uTruth).]
SideEffects []
SeeAlso []
Definition at line 137 of file mapperTable.c.

|
extern |
Function*************************************************************
Synopsis [Inserts a new entry into the hash table.]
Description [This function inserts the new gate (pGate), which will be accessible through its canonical form (uTruthC).]
SideEffects []
SeeAlso []
Definition at line 92 of file mapperTable.c.


|
extern |
Function*************************************************************
Synopsis [Looks up an entry in the library.]
Description [This function looks up the function, given by its truth table, and return two things: (1) the linked list of supergates, which can implement the functions of this N-class; (2) the phase, which should be applied to the given function, in order to derive the canonical form of this N-class.]
SideEffects []
SeeAlso []
Definition at line 208 of file mapperTable.c.
|
extern |
Function*************************************************************
Synopsis [Sorts supergates by usefulness and prints out most useful.]
Description []
SideEffects []
SeeAlso []
Definition at line 315 of file mapperTable.c.

|
extern |
Function*************************************************************
Synopsis [Sorts supergates by max delay for each truth table.]
Description []
SideEffects []
SeeAlso []
Definition at line 362 of file mapperTable.c.


|
extern |
function*************************************************************
synopsis [References the cut.]
description []
sideeffects []
seealso []
Definition at line 82 of file mapperSwitch.c.

|
extern |
FUNCTION DEFINITIONS ///.
function*************************************************************
synopsis [Computes the exact area associated with the cut.]
description []
sideeffects []
seealso []
Definition at line 45 of file mapperSwitch.c.

|
extern |
function*************************************************************
synopsis [References the cut.]
description []
sideeffects []
seealso []
Definition at line 66 of file mapperSwitch.c.

|
extern |
DECLARATIONS ///.
CFile****************************************************************
FileName [mapperTime.c]
PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]
Synopsis [Generic technology mapping engine.]
Author [MVSIS Group]
Affiliation [UC Berkeley]
Date [Ver. 2.0. Started - June 1, 2004.]
Revision [
] FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Computes the maximum arrival times.]
Description []
SideEffects []
SeeAlso []
Definition at line 45 of file mapperTime.c.


|
extern |
Definition at line 385 of file mapperTime.c.


|
extern |
Function*************************************************************
Synopsis [Computes the arrival times of the cut.]
Description [Computes the arrival times of the cut if it is implemented using the given supergate with the given phase. Uses the constraint-type specification of rise/fall arrival times.]
SideEffects []
SeeAlso []
Definition at line 75 of file mapperTime.c.

|
extern |
|
extern |