2008-01-31 05:01:00 +01:00
|
|
|
/**CFile****************************************************************
|
|
|
|
|
|
|
|
|
|
FileName [if.h]
|
|
|
|
|
|
|
|
|
|
SystemName [ABC: Logic synthesis and verification system.]
|
|
|
|
|
|
|
|
|
|
PackageName [FPGA mapping based on priority cuts.]
|
|
|
|
|
|
|
|
|
|
Synopsis [External declarations.]
|
|
|
|
|
|
|
|
|
|
Author [Alan Mishchenko]
|
|
|
|
|
|
|
|
|
|
Affiliation [UC Berkeley]
|
|
|
|
|
|
|
|
|
|
Date [Ver. 1.0. Started - November 21, 2006.]
|
|
|
|
|
|
|
|
|
|
Revision [$Id: if.h,v 1.00 2006/11/21 00:00:00 alanmi Exp $]
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
2012-01-21 13:30:10 +01:00
|
|
|
#ifndef ABC__map__if__if_h
|
|
|
|
|
#define ABC__map__if__if_h
|
2008-01-31 05:01:00 +01:00
|
|
|
|
2010-11-01 09:35:04 +01:00
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// INCLUDES ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
2010-11-01 09:35:04 +01:00
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <assert.h>
|
2012-07-08 02:46:54 +02:00
|
|
|
|
2012-07-08 05:14:12 +02:00
|
|
|
#include "misc/vec/vec.h"
|
|
|
|
|
#include "misc/mem/mem.h"
|
|
|
|
|
#include "misc/tim/tim.h"
|
2012-11-11 04:37:53 +01:00
|
|
|
#include "misc/util/utilNam.h"
|
2014-02-17 04:30:38 +01:00
|
|
|
#include "misc/vec/vecMem.h"
|
|
|
|
|
#include "misc/util/utilTruth.h"
|
2014-02-26 07:41:34 +01:00
|
|
|
#include "opt/dau/dau.h"
|
2010-11-01 09:35:04 +01:00
|
|
|
|
|
|
|
|
ABC_NAMESPACE_HEADER_START
|
|
|
|
|
|
2009-02-15 17:01:00 +01:00
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// PARAMETERS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// the maximum size of LUTs used for mapping (should be the same as FPGA_MAX_LUTSIZE defined in "fpga.h"!!!)
|
|
|
|
|
#define IF_MAX_LUTSIZE 32
|
|
|
|
|
// the largest possible number of LUT inputs when funtionality of the LUTs are computed
|
|
|
|
|
#define IF_MAX_FUNC_LUTSIZE 15
|
|
|
|
|
// a very large number
|
|
|
|
|
#define IF_INFINITY 100000000
|
|
|
|
|
// the largest possible user cut cost
|
2012-01-15 18:15:10 +01:00
|
|
|
#define IF_COST_MAX 8191 // ((1<<13)-1)
|
2008-01-31 05:01:00 +01:00
|
|
|
|
2014-02-28 06:11:05 +01:00
|
|
|
#define IF_BIG_CHAR ((char)120)
|
2012-11-02 00:24:36 +01:00
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
// object types
|
|
|
|
|
typedef enum {
|
|
|
|
|
IF_NONE, // 0: non-existent object
|
|
|
|
|
IF_CONST1, // 1: constant 1
|
|
|
|
|
IF_CI, // 2: combinational input
|
|
|
|
|
IF_CO, // 3: combinational output
|
|
|
|
|
IF_AND, // 4: AND node
|
|
|
|
|
IF_VOID // 5: unused object
|
|
|
|
|
} If_Type_t;
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// BASIC TYPES ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
typedef struct If_Man_t_ If_Man_t;
|
|
|
|
|
typedef struct If_Par_t_ If_Par_t;
|
|
|
|
|
typedef struct If_Obj_t_ If_Obj_t;
|
|
|
|
|
typedef struct If_Cut_t_ If_Cut_t;
|
|
|
|
|
typedef struct If_Set_t_ If_Set_t;
|
2012-12-10 10:07:41 +01:00
|
|
|
typedef struct If_LibLut_t_ If_LibLut_t;
|
|
|
|
|
typedef struct If_LibBox_t_ If_LibBox_t;
|
2014-02-18 03:28:48 +01:00
|
|
|
typedef struct If_DsdMan_t_ If_DsdMan_t;
|
2008-01-31 05:01:00 +01:00
|
|
|
|
2012-02-23 02:54:24 +01:00
|
|
|
typedef struct Ifif_Par_t_ Ifif_Par_t;
|
|
|
|
|
struct Ifif_Par_t_
|
|
|
|
|
{
|
|
|
|
|
int nLutSize; // the LUT size
|
2012-12-10 10:07:41 +01:00
|
|
|
If_LibLut_t * pLutLib; // the LUT library
|
2012-02-23 02:54:24 +01:00
|
|
|
float pLutDelays[IF_MAX_LUTSIZE]; // pin-to-pin delays of the max LUT
|
|
|
|
|
float DelayWire; // wire delay
|
|
|
|
|
int nDegree; // structure degree
|
|
|
|
|
int fCascade; // cascade
|
|
|
|
|
int fVerbose; // verbose
|
|
|
|
|
int fVeryVerbose; // verbose
|
|
|
|
|
};
|
|
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
// parameters
|
|
|
|
|
struct If_Par_t_
|
|
|
|
|
{
|
|
|
|
|
// user-controlable parameters
|
|
|
|
|
int nLutSize; // the LUT size
|
|
|
|
|
int nCutsMax; // the max number of cuts
|
|
|
|
|
int nFlowIters; // the number of iterations of area recovery
|
|
|
|
|
int nAreaIters; // the number of iterations of area recovery
|
2012-03-28 05:15:02 +02:00
|
|
|
int nGateSize; // the max size of the AND/OR gate to map into
|
2012-11-21 06:34:40 +01:00
|
|
|
int nNonDecLimit; // the max size of non-dec nodes
|
2008-01-31 05:01:00 +01:00
|
|
|
float DelayTarget; // delay target
|
2008-03-05 17:01:00 +01:00
|
|
|
float Epsilon; // value used in comparison floating point numbers
|
2013-09-17 07:50:39 +02:00
|
|
|
int nRelaxRatio; // delay relaxation ratio
|
2013-10-01 09:43:43 +02:00
|
|
|
int nStructType; // type of the structure
|
2008-01-31 05:01:00 +01:00
|
|
|
int fPreprocess; // preprossing
|
|
|
|
|
int fArea; // area-oriented mapping
|
|
|
|
|
int fFancy; // a fancy feature
|
|
|
|
|
int fExpRed; // expand/reduce of the best cuts
|
|
|
|
|
int fLatchPaths; // reset timing on latch paths
|
|
|
|
|
int fEdge; // uses edge-based cut selection heuristics
|
2009-01-18 17:01:00 +01:00
|
|
|
int fPower; // uses power-aware cut selection heuristics
|
2008-01-31 05:01:00 +01:00
|
|
|
int fCutMin; // performs cut minimization by removing functionally reducdant variables
|
|
|
|
|
int fSeqMap; // sequential mapping
|
2008-03-13 16:01:00 +01:00
|
|
|
int fBidec; // use bi-decomposition
|
2010-11-01 09:35:04 +01:00
|
|
|
int fUseBat; // use one specialized feature
|
2011-04-24 19:43:24 +02:00
|
|
|
int fUseBuffs; // use buffers to decouple outputs
|
2011-06-28 05:17:52 +02:00
|
|
|
int fEnableCheck07;// enable additional checking
|
|
|
|
|
int fEnableCheck08;// enable additional checking
|
|
|
|
|
int fEnableCheck10;// enable additional checking
|
2013-08-13 08:27:20 +02:00
|
|
|
int fEnableCheck75;// enable additional checking
|
|
|
|
|
int fEnableCheck75u;// enable additional checking
|
2012-11-11 04:37:53 +01:00
|
|
|
int fUseDsd; // compute DSD of the cut functions
|
2013-06-26 02:19:44 +02:00
|
|
|
int fDeriveLuts; // enables deriving LUT structures
|
2013-11-13 01:03:18 +01:00
|
|
|
int fRepack; // repack after mapping
|
2008-01-31 05:01:00 +01:00
|
|
|
int fVerbose; // the verbosity flag
|
2011-09-25 05:15:54 +02:00
|
|
|
char * pLutStruct; // LUT structure
|
|
|
|
|
float WireDelay; // wire delay
|
2008-01-31 05:01:00 +01:00
|
|
|
// internal parameters
|
2010-11-01 09:35:04 +01:00
|
|
|
int fDelayOpt; // special delay optimization
|
2011-12-29 15:14:01 +01:00
|
|
|
int fUserRecLib; // use recorded library
|
2012-01-12 07:08:35 +01:00
|
|
|
int fSkipCutFilter;// skip cut filter
|
2008-01-31 05:01:00 +01:00
|
|
|
int fAreaOnly; // area only mode
|
|
|
|
|
int fTruth; // truth table computation enabled
|
|
|
|
|
int fUsePerm; // use permutation (delay info)
|
|
|
|
|
int fUseBdds; // use local BDDs as a cost function
|
|
|
|
|
int fUseSops; // use local SOPs as a cost function
|
|
|
|
|
int fUseCnfs; // use local CNFs as a cost function
|
|
|
|
|
int fUseMv; // use local MV-SOPs as a cost function
|
2012-05-20 17:18:23 +02:00
|
|
|
int nLatchesCi; // the number of latches among the CIs
|
|
|
|
|
int nLatchesCo; // the number of latches among the COs
|
|
|
|
|
int nLatchesCiBox; // the number of white box outputs among the CIs
|
|
|
|
|
int nLatchesCoBox; // the number of white box inputs among the COs
|
2008-01-31 05:01:00 +01:00
|
|
|
int fLiftLeaves; // shift the leaves for seq mapping
|
2010-11-01 09:35:04 +01:00
|
|
|
int fUseCoAttrs; // use CO attributes
|
2013-09-17 07:50:39 +02:00
|
|
|
float DelayTargetNew;// new delay target
|
2013-06-27 07:43:24 +02:00
|
|
|
float FinalDelay; // final delay after mapping
|
2012-12-10 10:07:41 +01:00
|
|
|
If_LibLut_t * pLutLib; // the LUT library
|
2008-01-31 05:01:00 +01:00
|
|
|
float * pTimesArr; // arrival times
|
|
|
|
|
float * pTimesReq; // required times
|
2014-02-17 04:30:38 +01:00
|
|
|
int (* pFuncCost) (If_Man_t *, If_Cut_t *); // procedure to compute the user's cost of a cut
|
2014-02-26 07:41:34 +01:00
|
|
|
int (* pFuncUser) (If_Man_t *, If_Obj_t *, If_Cut_t *); // procedure called for each cut when cut computation is finished
|
|
|
|
|
int (* pFuncCell) (If_Man_t *, unsigned *, int, int, char *); // procedure called for cut functions
|
2008-01-31 05:01:00 +01:00
|
|
|
void * pReoMan; // reordering manager
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// the LUT library
|
2012-12-10 10:07:41 +01:00
|
|
|
struct If_LibLut_t_
|
2008-01-31 05:01:00 +01:00
|
|
|
{
|
|
|
|
|
char * pName; // the name of the LUT library
|
|
|
|
|
int LutMax; // the maximum LUT size
|
|
|
|
|
int fVarPinDelays; // set to 1 if variable pin delays are specified
|
|
|
|
|
float pLutAreas[IF_MAX_LUTSIZE+1]; // the areas of LUTs
|
|
|
|
|
float pLutDelays[IF_MAX_LUTSIZE+1][IF_MAX_LUTSIZE+1];// the delays of LUTs
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// manager
|
|
|
|
|
struct If_Man_t_
|
|
|
|
|
{
|
2012-03-28 05:15:02 +02:00
|
|
|
char * pName;
|
2008-01-31 05:01:00 +01:00
|
|
|
// mapping parameters
|
|
|
|
|
If_Par_t * pPars;
|
|
|
|
|
// mapping nodes
|
|
|
|
|
If_Obj_t * pConst1; // the constant 1 node
|
|
|
|
|
Vec_Ptr_t * vCis; // the primary inputs
|
|
|
|
|
Vec_Ptr_t * vCos; // the primary outputs
|
|
|
|
|
Vec_Ptr_t * vObjs; // all objects
|
|
|
|
|
Vec_Ptr_t * vObjsRev; // reverse topological order of objects
|
|
|
|
|
Vec_Ptr_t * vTemp; // temporary array
|
|
|
|
|
int nObjs[IF_VOID];// the number of objects by type
|
|
|
|
|
// various data
|
|
|
|
|
int nLevelMax; // the max number of AIG levels
|
|
|
|
|
float fEpsilon; // epsilon used for comparison
|
|
|
|
|
float RequiredGlo; // global required times
|
|
|
|
|
float RequiredGlo2; // global required times
|
|
|
|
|
float AreaGlo; // global area
|
|
|
|
|
int nNets; // the sum total of fanins of all LUTs in the mapping
|
2009-01-18 17:01:00 +01:00
|
|
|
float dPower; // the sum total of switching activities of all LUTs in the mapping
|
2008-01-31 05:01:00 +01:00
|
|
|
int nCutsUsed; // the number of cuts currently used
|
|
|
|
|
int nCutsMerged; // the total number of cuts merged
|
|
|
|
|
unsigned * puTemp[4]; // used for the truth table computation
|
2014-02-17 04:30:38 +01:00
|
|
|
word * puTempW; // used for the truth table computation
|
2008-01-31 05:01:00 +01:00
|
|
|
int SortMode; // one of the three sorting modes
|
|
|
|
|
int fNextRound; // set to 1 after the first round
|
|
|
|
|
int nChoices; // the number of choice nodes
|
2009-01-18 17:01:00 +01:00
|
|
|
Vec_Int_t * vSwitching; // switching activity of each node
|
2012-11-14 05:44:34 +01:00
|
|
|
int pPerm[3][IF_MAX_LUTSIZE]; // permutations
|
2012-11-20 08:42:05 +01:00
|
|
|
unsigned uSharedMask; // mask of shared variables
|
2012-11-14 05:44:34 +01:00
|
|
|
int nShared; // the number of shared variables
|
2013-03-05 22:13:15 +01:00
|
|
|
int fReqTimeWarn; // warning about exceeding required times was printed
|
2011-12-06 22:15:53 +01:00
|
|
|
// SOP balancing
|
|
|
|
|
Vec_Int_t * vCover; // used to compute ISOP
|
|
|
|
|
Vec_Wrd_t * vAnds; // intermediate storage
|
|
|
|
|
Vec_Wrd_t * vOrGate; // intermediate storage
|
|
|
|
|
Vec_Wrd_t * vAndGate; // intermediate storage
|
2008-01-31 05:01:00 +01:00
|
|
|
// sequential mapping
|
|
|
|
|
Vec_Ptr_t * vLatchOrder; // topological ordering of latches
|
|
|
|
|
Vec_Int_t * vLags; // sequentail lags of all nodes
|
|
|
|
|
int nAttempts; // the number of attempts in binary search
|
|
|
|
|
int nMaxIters; // the maximum number of iterations
|
|
|
|
|
int Period; // the current value of the clock period (for seq mapping)
|
|
|
|
|
// memory management
|
2014-02-17 04:30:38 +01:00
|
|
|
int nTruth6Words; // the size of the truth table if allocated
|
2008-01-31 05:01:00 +01:00
|
|
|
int nPermWords; // the size of the permutation array (in words)
|
|
|
|
|
int nObjBytes; // the size of the object
|
|
|
|
|
int nCutBytes; // the size of the cut
|
|
|
|
|
int nSetBytes; // the size of the cut set
|
|
|
|
|
Mem_Fixed_t * pMemObj; // memory manager for objects (entrysize = nEntrySize)
|
|
|
|
|
Mem_Fixed_t * pMemSet; // memory manager for sets of cuts (entrysize = nCutSize*(nCutsMax+1))
|
|
|
|
|
If_Set_t * pMemCi; // memory for CI cutsets
|
|
|
|
|
If_Set_t * pMemAnd; // memory for AND cutsets
|
2010-11-01 09:35:04 +01:00
|
|
|
If_Set_t * pFreeList; // the list of free cutsets
|
2008-01-31 05:01:00 +01:00
|
|
|
int nSmallSupp; // the small support
|
2010-11-01 09:35:04 +01:00
|
|
|
int nCutsTotal;
|
2011-10-01 12:00:59 +02:00
|
|
|
int nCutsUseless[32];
|
|
|
|
|
int nCutsCount[32];
|
|
|
|
|
int nCutsCountAll;
|
|
|
|
|
int nCutsUselessAll;
|
2013-08-18 19:42:57 +02:00
|
|
|
int nCuts5, nCuts5a;
|
2014-02-18 03:28:48 +01:00
|
|
|
If_DsdMan_t * pIfDsdMan;
|
2014-02-17 04:30:38 +01:00
|
|
|
Vec_Mem_t * vTtMem; // truth table memory and hash table
|
2014-02-28 06:11:05 +01:00
|
|
|
Vec_Int_t * vTtDsds; // mapping of truth table into DSD
|
|
|
|
|
Vec_Str_t * vTtPerms; // mapping of truth table into permutations
|
2014-02-17 04:30:38 +01:00
|
|
|
int nBestCutSmall[2];
|
2014-02-28 19:35:36 +01:00
|
|
|
int nCountNonDec[2];
|
2012-11-11 04:37:53 +01:00
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
// timing manager
|
|
|
|
|
Tim_Man_t * pManTim;
|
2010-11-01 09:35:04 +01:00
|
|
|
Vec_Int_t * vCoAttrs; // CO attributes 0=optimize; 1=keep; 2=relax
|
2011-10-02 11:39:51 +02:00
|
|
|
// hash table for functions
|
2011-10-10 20:55:32 +02:00
|
|
|
int nTableSize[2]; // hash table size
|
|
|
|
|
int nTableEntries[2]; // hash table entries
|
|
|
|
|
void ** pHashTable[2]; // hash table bins
|
|
|
|
|
Mem_Fixed_t * pMemEntries; // memory manager for hash table entries
|
2008-03-08 05:01:00 +01:00
|
|
|
// statistics
|
2013-05-28 00:09:23 +02:00
|
|
|
// abctime timeTruth;
|
2008-01-31 05:01:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// priority cut
|
|
|
|
|
struct If_Cut_t_
|
|
|
|
|
{
|
|
|
|
|
float Area; // area (or area-flow) of the cut
|
|
|
|
|
float AveRefs; // the average number of leaf references
|
|
|
|
|
float Edge; // the edge flow
|
2009-01-18 17:01:00 +01:00
|
|
|
float Power; // the power flow
|
2008-02-28 17:01:00 +01:00
|
|
|
float Delay; // delay of the cut
|
2014-02-17 21:19:42 +01:00
|
|
|
int iCutFunc; // TT ID of the cut
|
|
|
|
|
int iCutDsd; // DSD ID of the cut
|
2008-01-31 05:01:00 +01:00
|
|
|
unsigned uSign; // cut signature
|
2012-01-15 18:15:10 +01:00
|
|
|
unsigned Cost : 13; // the user's cost of the cut (related to IF_COST_MAX)
|
2008-01-31 05:01:00 +01:00
|
|
|
unsigned fCompl : 1; // the complemented attribute
|
|
|
|
|
unsigned fUser : 1; // using the user's area and delay
|
2010-11-01 09:35:04 +01:00
|
|
|
unsigned fUseless: 1; // using the user's area and delay
|
2008-01-31 05:01:00 +01:00
|
|
|
unsigned nLimit : 8; // the maximum number of leaves
|
|
|
|
|
unsigned nLeaves : 8; // the number of leaves
|
|
|
|
|
int * pLeaves; // array of fanins
|
|
|
|
|
char * pPerm; // permutation
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// set of priority cut
|
|
|
|
|
struct If_Set_t_
|
|
|
|
|
{
|
|
|
|
|
short nCutsMax; // the max number of cuts
|
|
|
|
|
short nCuts; // the current number of cuts
|
2010-11-01 09:35:04 +01:00
|
|
|
If_Set_t * pNext; // next cutset in the free list
|
2008-01-31 05:01:00 +01:00
|
|
|
If_Cut_t ** ppCuts; // the array of pointers to the cuts
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// node extension
|
|
|
|
|
struct If_Obj_t_
|
|
|
|
|
{
|
|
|
|
|
unsigned Type : 4; // object
|
|
|
|
|
unsigned fCompl0 : 1; // complemented attribute
|
|
|
|
|
unsigned fCompl1 : 1; // complemented attribute
|
|
|
|
|
unsigned fPhase : 1; // phase of the node
|
|
|
|
|
unsigned fRepr : 1; // representative of the equivalence class
|
|
|
|
|
unsigned fMark : 1; // multipurpose mark
|
|
|
|
|
unsigned fVisit : 1; // multipurpose mark
|
2010-11-01 09:35:04 +01:00
|
|
|
unsigned fSpec : 1; // multipurpose mark
|
2011-07-09 04:40:07 +02:00
|
|
|
unsigned fDriver : 1; // multipurpose mark
|
2011-07-20 13:23:10 +02:00
|
|
|
unsigned fSkipCut: 1; // multipurpose mark
|
|
|
|
|
unsigned Level : 19; // logic level of the node
|
2008-01-31 05:01:00 +01:00
|
|
|
int Id; // integer ID
|
|
|
|
|
int IdPio; // integer ID of PIs/POs
|
|
|
|
|
int nRefs; // the number of references
|
|
|
|
|
int nVisits; // the number of visits to this node
|
|
|
|
|
int nVisitsCopy; // the number of visits to this node
|
|
|
|
|
If_Obj_t * pFanin0; // the first fanin
|
|
|
|
|
If_Obj_t * pFanin1; // the second fanin
|
|
|
|
|
If_Obj_t * pEquiv; // the choice node
|
|
|
|
|
float EstRefs; // estimated reference counter
|
|
|
|
|
float Required; // required time of the onde
|
|
|
|
|
float LValue; // sequential arrival time of the node
|
2012-07-20 20:52:51 +02:00
|
|
|
union{
|
2008-01-31 05:01:00 +01:00
|
|
|
void * pCopy; // used for object duplication
|
2012-07-20 20:52:51 +02:00
|
|
|
int iCopy;
|
|
|
|
|
};
|
|
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
If_Set_t * pCutSet; // the pointer to the cutset
|
|
|
|
|
If_Cut_t CutBest; // the best cut selected
|
|
|
|
|
};
|
|
|
|
|
|
2010-11-01 09:35:04 +01:00
|
|
|
typedef struct If_And_t_ If_And_t;
|
|
|
|
|
struct If_And_t_
|
|
|
|
|
{
|
|
|
|
|
unsigned iFan0 : 15; // fanin0
|
|
|
|
|
unsigned fCompl0 : 1; // compl fanin0
|
|
|
|
|
unsigned iFan1 : 15; // fanin1
|
|
|
|
|
unsigned fCompl1 : 1; // compl fanin1
|
|
|
|
|
unsigned Id : 15; // Id
|
|
|
|
|
unsigned fCompl : 1; // compl output
|
|
|
|
|
unsigned Delay : 16; // delay
|
|
|
|
|
};
|
|
|
|
|
|
2012-12-10 09:59:54 +01:00
|
|
|
typedef struct If_Box_t_ If_Box_t;
|
|
|
|
|
struct If_Box_t_
|
|
|
|
|
{
|
|
|
|
|
char * pName;
|
2013-03-06 01:53:18 +01:00
|
|
|
char fSeq;
|
|
|
|
|
char fBlack;
|
|
|
|
|
char fOuter;
|
|
|
|
|
char fUnused;
|
2012-12-10 09:59:54 +01:00
|
|
|
int Id;
|
|
|
|
|
int nPis;
|
|
|
|
|
int nPos;
|
|
|
|
|
int * pDelays;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct If_LibBox_t_
|
|
|
|
|
{
|
|
|
|
|
Vec_Ptr_t * vBoxes;
|
|
|
|
|
};
|
|
|
|
|
|
2009-02-15 17:01:00 +01:00
|
|
|
static inline If_Obj_t * If_Regular( If_Obj_t * p ) { return (If_Obj_t *)((ABC_PTRUINT_T)(p) & ~01); }
|
|
|
|
|
static inline If_Obj_t * If_Not( If_Obj_t * p ) { return (If_Obj_t *)((ABC_PTRUINT_T)(p) ^ 01); }
|
|
|
|
|
static inline If_Obj_t * If_NotCond( If_Obj_t * p, int c ) { return (If_Obj_t *)((ABC_PTRUINT_T)(p) ^ (c)); }
|
|
|
|
|
static inline int If_IsComplement( If_Obj_t * p ) { return (int )(((ABC_PTRUINT_T)p) & 01); }
|
2008-01-31 05:01:00 +01:00
|
|
|
|
|
|
|
|
static inline int If_ManCiNum( If_Man_t * p ) { return p->nObjs[IF_CI]; }
|
|
|
|
|
static inline int If_ManCoNum( If_Man_t * p ) { return p->nObjs[IF_CO]; }
|
|
|
|
|
static inline int If_ManAndNum( If_Man_t * p ) { return p->nObjs[IF_AND]; }
|
|
|
|
|
static inline int If_ManObjNum( If_Man_t * p ) { return Vec_PtrSize(p->vObjs); }
|
|
|
|
|
|
|
|
|
|
static inline If_Obj_t * If_ManConst1( If_Man_t * p ) { return p->pConst1; }
|
|
|
|
|
static inline If_Obj_t * If_ManCi( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCis, i ); }
|
|
|
|
|
static inline If_Obj_t * If_ManCo( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCos, i ); }
|
2012-05-20 12:27:53 +02:00
|
|
|
static inline If_Obj_t * If_ManLi( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCos, If_ManCoNum(p) - p->pPars->nLatchesCo + i ); }
|
|
|
|
|
static inline If_Obj_t * If_ManLo( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCis, If_ManCiNum(p) - p->pPars->nLatchesCi + i ); }
|
2008-01-31 05:01:00 +01:00
|
|
|
static inline If_Obj_t * If_ManObj( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vObjs, i ); }
|
|
|
|
|
|
|
|
|
|
static inline int If_ObjIsConst1( If_Obj_t * pObj ) { return pObj->Type == IF_CONST1; }
|
|
|
|
|
static inline int If_ObjIsCi( If_Obj_t * pObj ) { return pObj->Type == IF_CI; }
|
|
|
|
|
static inline int If_ObjIsCo( If_Obj_t * pObj ) { return pObj->Type == IF_CO; }
|
2008-03-27 16:01:00 +01:00
|
|
|
static inline int If_ObjIsTerm( If_Obj_t * pObj ) { return pObj->Type == IF_CI || pObj->Type == IF_CO; }
|
|
|
|
|
static inline int If_ObjIsLatch( If_Obj_t * pObj ) { return If_ObjIsCi(pObj) && pObj->pFanin0 != NULL; }
|
2008-01-31 05:01:00 +01:00
|
|
|
static inline int If_ObjIsAnd( If_Obj_t * pObj ) { return pObj->Type == IF_AND; }
|
|
|
|
|
|
2010-11-01 09:35:04 +01:00
|
|
|
static inline int If_ObjId( If_Obj_t * pObj ) { return pObj->Id; }
|
2008-01-31 05:01:00 +01:00
|
|
|
static inline If_Obj_t * If_ObjFanin0( If_Obj_t * pObj ) { return pObj->pFanin0; }
|
|
|
|
|
static inline If_Obj_t * If_ObjFanin1( If_Obj_t * pObj ) { return pObj->pFanin1; }
|
|
|
|
|
static inline int If_ObjFaninC0( If_Obj_t * pObj ) { return pObj->fCompl0; }
|
|
|
|
|
static inline int If_ObjFaninC1( If_Obj_t * pObj ) { return pObj->fCompl1; }
|
|
|
|
|
static inline void * If_ObjCopy( If_Obj_t * pObj ) { return pObj->pCopy; }
|
2008-04-02 17:01:00 +02:00
|
|
|
static inline int If_ObjLevel( If_Obj_t * pObj ) { return pObj->Level; }
|
|
|
|
|
static inline void If_ObjSetLevel( If_Obj_t * pObj, int Level ) { pObj->Level = Level; }
|
2008-01-31 05:01:00 +01:00
|
|
|
static inline void If_ObjSetCopy( If_Obj_t * pObj, void * pCopy ) { pObj->pCopy = pCopy; }
|
2012-11-09 21:43:03 +01:00
|
|
|
static inline void If_ObjSetChoice( If_Obj_t * pObj, If_Obj_t * pEqu ) { pObj->pEquiv = pEqu; }
|
2008-01-31 05:01:00 +01:00
|
|
|
|
2014-02-17 04:30:38 +01:00
|
|
|
static inline int If_CutLeaveNum( If_Cut_t * pCut ) { return pCut->nLeaves; }
|
|
|
|
|
static inline int * If_CutLeaves( If_Cut_t * pCut ) { return pCut->pLeaves; }
|
|
|
|
|
static inline unsigned If_CutSuppMask( If_Cut_t * pCut ) { return (~(unsigned)0) >> (32-pCut->nLeaves); }
|
|
|
|
|
static inline int If_CutTruthWords( int nVarsMax ) { return nVarsMax <= 5 ? 2 : (1 << (nVarsMax - 5)); }
|
|
|
|
|
static inline int If_CutPermWords( int nVarsMax ) { return nVarsMax / sizeof(int) + ((nVarsMax % sizeof(int)) > 0); }
|
|
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
static inline If_Cut_t * If_ObjCutBest( If_Obj_t * pObj ) { return &pObj->CutBest; }
|
|
|
|
|
static inline unsigned If_ObjCutSign( unsigned ObjId ) { return (1 << (ObjId % 31)); }
|
2014-02-17 04:30:38 +01:00
|
|
|
static inline unsigned If_ObjCutSignCompute( If_Cut_t * p ) { unsigned s = 0; int i; for ( i = 0; i < If_CutLeaveNum(p); i++ ) s |= If_ObjCutSign(p->pLeaves[i]); return s; }
|
2008-01-31 05:01:00 +01:00
|
|
|
|
|
|
|
|
static inline float If_ObjArrTime( If_Obj_t * pObj ) { return If_ObjCutBest(pObj)->Delay; }
|
|
|
|
|
static inline void If_ObjSetArrTime( If_Obj_t * pObj, float ArrTime ) { If_ObjCutBest(pObj)->Delay = ArrTime; }
|
|
|
|
|
|
|
|
|
|
static inline float If_ObjLValue( If_Obj_t * pObj ) { return pObj->LValue; }
|
|
|
|
|
static inline void If_ObjSetLValue( If_Obj_t * pObj, float LValue ) { pObj->LValue = LValue; }
|
|
|
|
|
|
|
|
|
|
static inline void * If_CutData( If_Cut_t * pCut ) { return *(void **)pCut; }
|
|
|
|
|
static inline void If_CutSetData( If_Cut_t * pCut, void * pData ) { *(void **)pCut = pData; }
|
|
|
|
|
|
2010-11-01 09:35:04 +01:00
|
|
|
static inline int If_CutDataInt( If_Cut_t * pCut ) { return *(int *)pCut; }
|
|
|
|
|
static inline void If_CutSetDataInt( If_Cut_t * pCut, int Data ) { *(int *)pCut = Data; }
|
|
|
|
|
|
2014-02-17 04:30:38 +01:00
|
|
|
static inline word * If_CutTruthWR( If_Man_t * p, If_Cut_t * pCut ) { return p->vTtMem ? Vec_MemReadEntry(p->vTtMem, Abc_Lit2Var(pCut->iCutFunc)) : NULL; }
|
|
|
|
|
static inline unsigned * If_CutTruthR( If_Man_t * p, If_Cut_t * pCut ) { return (unsigned *)If_CutTruthWR(p, pCut); }
|
|
|
|
|
static inline int If_CutTruthIsCompl( If_Cut_t * pCut ) { assert( pCut->iCutFunc >= 0 ); return Abc_LitIsCompl(pCut->iCutFunc); }
|
|
|
|
|
static inline word * If_CutTruthW( If_Man_t * p, If_Cut_t * pCut ) { if ( p->vTtMem == NULL ) return NULL; assert( pCut->iCutFunc >= 0 ); Abc_TtCopy( p->puTempW, If_CutTruthWR(p, pCut), p->nTruth6Words, If_CutTruthIsCompl(pCut) ); return p->puTempW; }
|
|
|
|
|
static inline unsigned * If_CutTruth( If_Man_t * p, If_Cut_t * pCut ) { return (unsigned *)If_CutTruthW(p, pCut); }
|
2008-01-31 05:01:00 +01:00
|
|
|
|
|
|
|
|
static inline float If_CutLutArea( If_Man_t * p, If_Cut_t * pCut ) { return pCut->fUser? (float)pCut->Cost : (p->pPars->pLutLib? p->pPars->pLutLib->pLutAreas[pCut->nLeaves] : (float)1.0); }
|
2012-12-10 10:07:41 +01:00
|
|
|
static inline float If_CutLutDelay( If_LibLut_t * p, int Size, int iPin ) { return p ? (p->fVarPinDelays ? p->pLutDelays[Size][iPin] : p->pLutDelays[Size][0]) : 1.0; }
|
2008-01-31 05:01:00 +01:00
|
|
|
|
2010-11-01 09:35:04 +01:00
|
|
|
static inline word If_AndToWrd( If_And_t m ) { union { If_And_t x; word y; } v; v.x = m; return v.y; }
|
|
|
|
|
static inline If_And_t If_WrdToAnd( word m ) { union { If_And_t x; word y; } v; v.y = m; return v.x; }
|
|
|
|
|
static inline void If_AndClear( If_And_t * pNode ) { *pNode = If_WrdToAnd(0); }
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 13:54:40 +02:00
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// MACRO DEFINITIONS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#define IF_MIN(a,b) (((a) < (b))? (a) : (b))
|
|
|
|
|
#define IF_MAX(a,b) (((a) > (b))? (a) : (b))
|
|
|
|
|
|
|
|
|
|
// the small and large numbers (min/max float are 1.17e-38/3.40e+38)
|
|
|
|
|
#define IF_FLOAT_LARGE ((float)1.0e+20)
|
|
|
|
|
#define IF_FLOAT_SMALL ((float)1.0e-20)
|
|
|
|
|
#define IF_INT_LARGE (10000000)
|
|
|
|
|
|
|
|
|
|
// iterator over the primary inputs
|
|
|
|
|
#define If_ManForEachCi( p, pObj, i ) \
|
2010-11-01 09:35:04 +01:00
|
|
|
Vec_PtrForEachEntry( If_Obj_t *, p->vCis, pObj, i )
|
2008-01-31 05:01:00 +01:00
|
|
|
// iterator over the primary outputs
|
|
|
|
|
#define If_ManForEachCo( p, pObj, i ) \
|
2010-11-01 09:35:04 +01:00
|
|
|
Vec_PtrForEachEntry( If_Obj_t *, p->vCos, pObj, i )
|
2008-01-31 05:01:00 +01:00
|
|
|
// iterator over the primary inputs
|
|
|
|
|
#define If_ManForEachPi( p, pObj, i ) \
|
2012-05-20 17:18:23 +02:00
|
|
|
Vec_PtrForEachEntryStop( If_Obj_t *, p->vCis, pObj, i, If_ManCiNum(p) - p->pPars->nLatchesCi - p->pPars->nLatchesCiBox )
|
2008-01-31 05:01:00 +01:00
|
|
|
// iterator over the primary outputs
|
|
|
|
|
#define If_ManForEachPo( p, pObj, i ) \
|
2012-05-20 17:18:23 +02:00
|
|
|
Vec_PtrForEachEntryStartStop( If_Obj_t *, p->vCos, pObj, i, p->pPars->nLatchesCoBox, If_ManCoNum(p) - p->pPars->nLatchesCo )
|
2008-01-31 05:01:00 +01:00
|
|
|
// iterator over the latches
|
|
|
|
|
#define If_ManForEachLatchInput( p, pObj, i ) \
|
2012-05-20 12:27:53 +02:00
|
|
|
Vec_PtrForEachEntryStart( If_Obj_t *, p->vCos, pObj, i, If_ManCoNum(p) - p->pPars->nLatchesCo )
|
2008-01-31 05:01:00 +01:00
|
|
|
#define If_ManForEachLatchOutput( p, pObj, i ) \
|
2012-05-20 17:18:23 +02:00
|
|
|
Vec_PtrForEachEntryStartStop( If_Obj_t *, p->vCis, pObj, i, If_ManCiNum(p) - p->pPars->nLatchesCi - p->pPars->nLatchesCiBox, If_ManCiNum(p) - p->pPars->nLatchesCiBox )
|
2008-01-31 05:01:00 +01:00
|
|
|
// iterator over all objects in topological order
|
|
|
|
|
#define If_ManForEachObj( p, pObj, i ) \
|
2010-11-01 09:35:04 +01:00
|
|
|
Vec_PtrForEachEntry( If_Obj_t *, p->vObjs, pObj, i )
|
2008-01-31 05:01:00 +01:00
|
|
|
// iterator over all objects in reverse topological order
|
|
|
|
|
#define If_ManForEachObjReverse( p, pObj, i ) \
|
2010-11-01 09:35:04 +01:00
|
|
|
Vec_PtrForEachEntry( If_Obj_t *, p->vObjsRev, pObj, i )
|
2008-01-31 05:01:00 +01:00
|
|
|
// iterator over logic nodes
|
|
|
|
|
#define If_ManForEachNode( p, pObj, i ) \
|
|
|
|
|
If_ManForEachObj( p, pObj, i ) if ( pObj->Type != IF_AND ) {} else
|
|
|
|
|
// iterator over cuts of the node
|
|
|
|
|
#define If_ObjForEachCut( pObj, pCut, i ) \
|
|
|
|
|
for ( i = 0; (i < (pObj)->pCutSet->nCuts) && ((pCut) = (pObj)->pCutSet->ppCuts[i]); i++ )
|
|
|
|
|
// iterator over the leaves of the cut
|
|
|
|
|
#define If_CutForEachLeaf( p, pCut, pLeaf, i ) \
|
|
|
|
|
for ( i = 0; (i < (int)(pCut)->nLeaves) && ((pLeaf) = If_ManObj(p, (pCut)->pLeaves[i])); i++ )
|
|
|
|
|
#define If_CutForEachLeafReverse( p, pCut, pLeaf, i ) \
|
|
|
|
|
for ( i = (int)(pCut)->nLeaves - 1; (i >= 0) && ((pLeaf) = If_ManObj(p, (pCut)->pLeaves[i])); i-- )
|
2008-07-02 17:01:00 +02:00
|
|
|
//#define If_CutForEachLeaf( p, pCut, pLeaf, i ) \ \\prevent multiline comment
|
2008-01-31 05:01:00 +01:00
|
|
|
// for ( i = 0; (i < (int)(pCut)->nLeaves) && ((pLeaf) = If_ManObj(p, p->pPars->fLiftLeaves? (pCut)->pLeaves[i] >> 8 : (pCut)->pLeaves[i])); i++ )
|
|
|
|
|
// iterator over the leaves of the sequential cut
|
|
|
|
|
#define If_CutForEachLeafSeq( p, pCut, pLeaf, Shift, i ) \
|
|
|
|
|
for ( i = 0; (i < (int)(pCut)->nLeaves) && ((pLeaf) = If_ManObj(p, (pCut)->pLeaves[i] >> 8)) && (((Shift) = ((pCut)->pLeaves[i] & 255)) >= 0); i++ )
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// FUNCTION DECLARATIONS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/*=== ifCore.c ===========================================================*/
|
|
|
|
|
extern int If_ManPerformMapping( If_Man_t * p );
|
|
|
|
|
extern int If_ManPerformMappingComb( If_Man_t * p );
|
|
|
|
|
/*=== ifCut.c ============================================================*/
|
|
|
|
|
extern int If_CutFilter( If_Set_t * pCutSet, If_Cut_t * pCut );
|
|
|
|
|
extern void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut );
|
2008-04-11 17:01:00 +02:00
|
|
|
extern void If_CutOrder( If_Cut_t * pCut );
|
2012-11-14 05:44:34 +01:00
|
|
|
extern int If_CutMerge( If_Man_t * p, If_Cut_t * pCut0, If_Cut_t * pCut1, If_Cut_t * pCut );
|
2008-04-11 17:01:00 +02:00
|
|
|
extern int If_CutCheck( If_Cut_t * pCut );
|
|
|
|
|
extern void If_CutPrint( If_Cut_t * pCut );
|
2008-01-31 05:01:00 +01:00
|
|
|
extern void If_CutPrintTiming( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern void If_CutLift( If_Cut_t * pCut );
|
|
|
|
|
extern void If_CutCopy( If_Man_t * p, If_Cut_t * pCutDest, If_Cut_t * pCutSrc );
|
|
|
|
|
extern float If_CutAreaFlow( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutEdgeFlow( If_Man_t * p, If_Cut_t * pCut );
|
2009-01-18 17:01:00 +01:00
|
|
|
extern float If_CutPowerFlow( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot );
|
2008-01-31 05:01:00 +01:00
|
|
|
extern float If_CutAverageRefs( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutAreaDeref( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutAreaRef( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutAreaDerefed( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutAreaRefed( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutEdgeDeref( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutEdgeRef( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutEdgeDerefed( If_Man_t * p, If_Cut_t * pCut );
|
|
|
|
|
extern float If_CutEdgeRefed( If_Man_t * p, If_Cut_t * pCut );
|
2009-01-18 17:01:00 +01:00
|
|
|
extern float If_CutPowerDeref( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot );
|
|
|
|
|
extern float If_CutPowerRef( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot );
|
|
|
|
|
extern float If_CutPowerDerefed( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot );
|
|
|
|
|
extern float If_CutPowerRefed( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot );
|
2011-05-08 09:22:32 +02:00
|
|
|
/*=== ifDec.c =============================================================*/
|
2013-09-23 19:41:28 +02:00
|
|
|
extern word If_CutPerformDerive07( If_Man_t * p, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
2011-10-02 11:39:51 +02:00
|
|
|
extern int If_CutPerformCheck07( If_Man_t * p, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
|
|
|
|
extern int If_CutPerformCheck08( If_Man_t * p, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
|
|
|
|
extern int If_CutPerformCheck10( If_Man_t * p, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
|
|
|
|
extern int If_CutPerformCheck16( If_Man_t * p, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
2013-08-13 08:27:20 +02:00
|
|
|
extern int If_CutPerformCheck45( If_Man_t * p, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
|
|
|
|
extern int If_CutPerformCheck54( If_Man_t * p, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
|
|
|
|
extern int If_CutPerformCheck75( If_Man_t * p, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
2011-09-25 05:15:54 +02:00
|
|
|
extern float If_CutDelayLutStruct( If_Man_t * p, If_Cut_t * pCut, char * pStr, float WireDelay );
|
2011-10-28 08:34:11 +02:00
|
|
|
extern int If_CluCheckExt( void * p, word * pTruth, int nVars, int nLutLeaf, int nLutRoot,
|
|
|
|
|
char * pLut0, char * pLut1, word * pFunc0, word * pFunc1 );
|
|
|
|
|
extern int If_CluCheckExt3( void * p, word * pTruth, int nVars, int nLutLeaf, int nLutLeaf2, int nLutRoot,
|
|
|
|
|
char * pLut0, char * pLut1, char * pLut2, word * pFunc0, word * pFunc1, word * pFunc2 );
|
2014-02-18 03:28:48 +01:00
|
|
|
/*=== ifDsd.c =============================================================*/
|
2014-03-01 06:06:21 +01:00
|
|
|
extern If_DsdMan_t * If_DsdManAlloc( int nVars, int nLutSize );
|
2014-02-20 08:49:41 +01:00
|
|
|
extern void If_DsdManDump( If_DsdMan_t * p );
|
2014-03-07 06:48:15 +01:00
|
|
|
extern void If_DsdManPrint( If_DsdMan_t * p, char * pFileName, int Number, int fVerbose );
|
2014-03-07 06:21:02 +01:00
|
|
|
extern void If_DsdManTune( If_DsdMan_t * p, int LutSize, int fFast, int fSpec, int fVerbose );
|
2014-02-28 19:35:36 +01:00
|
|
|
extern void If_DsdManFree( If_DsdMan_t * p, int fVerbose );
|
2014-03-01 06:06:21 +01:00
|
|
|
extern void If_DsdManSave( If_DsdMan_t * p, char * pFileName );
|
|
|
|
|
extern If_DsdMan_t * If_DsdManLoad( char * pFileName );
|
2014-02-26 07:41:34 +01:00
|
|
|
extern int If_DsdManCompute( If_DsdMan_t * p, word * pTruth, int nLeaves, unsigned char * pPerm, char * pLutStruct );
|
2014-03-01 06:06:21 +01:00
|
|
|
extern char * If_DsdManFileName( If_DsdMan_t * p );
|
|
|
|
|
extern int If_DsdManVarNum( If_DsdMan_t * p );
|
|
|
|
|
extern int If_DsdManLutSize( If_DsdMan_t * p );
|
2014-02-28 06:11:05 +01:00
|
|
|
extern int If_DsdManCheckDec( If_DsdMan_t * p, int iDsd );
|
2014-03-01 06:06:21 +01:00
|
|
|
extern unsigned If_DsdManCheckXY( If_DsdMan_t * p, int iDsd, int LutSize, int fDerive, int fVerbose );
|
2008-03-30 17:01:00 +02:00
|
|
|
/*=== ifLib.c =============================================================*/
|
2012-12-10 10:07:41 +01:00
|
|
|
extern If_LibLut_t * If_LibLutRead( char * FileName );
|
|
|
|
|
extern If_LibLut_t * If_LibLutDup( If_LibLut_t * p );
|
|
|
|
|
extern void If_LibLutFree( If_LibLut_t * pLutLib );
|
|
|
|
|
extern void If_LibLutPrint( If_LibLut_t * pLutLib );
|
|
|
|
|
extern int If_LibLutDelaysAreDiscrete( If_LibLut_t * pLutLib );
|
|
|
|
|
extern int If_LibLutDelaysAreDifferent( If_LibLut_t * pLutLib );
|
|
|
|
|
extern If_LibLut_t * If_LibLutSetSimple( int nLutSize );
|
|
|
|
|
extern float If_LibLutFastestPinDelay( If_LibLut_t * p );
|
|
|
|
|
extern float If_LibLutSlowestPinDelay( If_LibLut_t * p );
|
2012-12-10 09:59:54 +01:00
|
|
|
/*=== ifLibBox.c =============================================================*/
|
|
|
|
|
extern If_LibBox_t * If_LibBoxStart();
|
|
|
|
|
extern void If_LibBoxFree( If_LibBox_t * p );
|
|
|
|
|
extern If_Box_t * If_LibBoxReadBox( If_LibBox_t * p, int Id );
|
2013-03-06 01:53:18 +01:00
|
|
|
extern If_Box_t * If_LibBoxFindBox( If_LibBox_t * p, char * pName );
|
2012-12-10 09:59:54 +01:00
|
|
|
extern void If_LibBoxAdd( If_LibBox_t * p, If_Box_t * pBox );
|
|
|
|
|
extern If_LibBox_t * If_LibBoxRead( char * pFileName );
|
2013-03-06 01:53:18 +01:00
|
|
|
extern If_LibBox_t * If_LibBoxRead2( char * pFileName );
|
2012-12-10 09:59:54 +01:00
|
|
|
extern void If_LibBoxPrint( FILE * pFile, If_LibBox_t * p );
|
|
|
|
|
extern void If_LibBoxWrite( char * pFileName, If_LibBox_t * p );
|
2013-03-09 03:58:54 +01:00
|
|
|
extern int If_LibBoxLoad( char * pFileName );
|
2008-01-31 05:01:00 +01:00
|
|
|
/*=== ifMan.c =============================================================*/
|
|
|
|
|
extern If_Man_t * If_ManStart( If_Par_t * pPars );
|
|
|
|
|
extern void If_ManRestart( If_Man_t * p );
|
|
|
|
|
extern void If_ManStop( If_Man_t * p );
|
|
|
|
|
extern If_Obj_t * If_ManCreateCi( If_Man_t * p );
|
|
|
|
|
extern If_Obj_t * If_ManCreateCo( If_Man_t * p, If_Obj_t * pDriver );
|
|
|
|
|
extern If_Obj_t * If_ManCreateAnd( If_Man_t * p, If_Obj_t * pFan0, If_Obj_t * pFan1 );
|
|
|
|
|
extern If_Obj_t * If_ManCreateXor( If_Man_t * p, If_Obj_t * pFan0, If_Obj_t * pFan1 );
|
|
|
|
|
extern If_Obj_t * If_ManCreateMux( If_Man_t * p, If_Obj_t * pFan0, If_Obj_t * pFan1, If_Obj_t * pCtrl );
|
|
|
|
|
extern void If_ManCreateChoice( If_Man_t * p, If_Obj_t * pRepr );
|
|
|
|
|
extern void If_ManSetupCutTriv( If_Man_t * p, If_Cut_t * pCut, int ObjId );
|
|
|
|
|
extern void If_ManSetupCiCutSets( If_Man_t * p );
|
|
|
|
|
extern If_Set_t * If_ManSetupNodeCutSet( If_Man_t * p, If_Obj_t * pObj );
|
|
|
|
|
extern void If_ManDerefNodeCutSet( If_Man_t * p, If_Obj_t * pObj );
|
|
|
|
|
extern void If_ManDerefChoiceCutSet( If_Man_t * p, If_Obj_t * pObj );
|
|
|
|
|
extern void If_ManSetupSetAll( If_Man_t * p, int nCrossCut );
|
|
|
|
|
/*=== ifMap.c =============================================================*/
|
2014-02-17 04:30:38 +01:00
|
|
|
extern void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPreprocess, int fFirst );
|
2008-01-31 05:01:00 +01:00
|
|
|
extern void If_ObjPerformMappingChoice( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPreprocess );
|
2014-02-17 04:30:38 +01:00
|
|
|
extern int If_ManPerformMappingRound( If_Man_t * p, int nCutsUsed, int Mode, int fPreprocess, int fFirst, char * pLabel );
|
2008-01-31 05:01:00 +01:00
|
|
|
/*=== ifReduce.c ==========================================================*/
|
|
|
|
|
extern void If_ManImproveMapping( If_Man_t * p );
|
2014-03-04 23:48:36 +01:00
|
|
|
/*=== ifSat.c ==========================================================*/
|
|
|
|
|
extern void * If_ManSatBuildXY( int nLutSize );
|
2014-03-07 06:21:02 +01:00
|
|
|
extern void * If_ManSatBuild55();
|
2014-03-05 03:39:00 +01:00
|
|
|
extern void * If_ManSatBuildXYZ( int nLutSize );
|
|
|
|
|
extern void If_ManSatUnbuild( void * p );
|
2014-03-04 23:48:36 +01:00
|
|
|
extern int If_ManSatCheckXY( void * pSat, int nLutSize, word * pTruth, int nVars, unsigned uSet, word * pTBound, word * pTFree, Vec_Int_t * vLits );
|
2014-03-05 03:39:00 +01:00
|
|
|
extern unsigned If_ManSatCheckXYall( void * pSat, int nLutSize, word * pTruth, int nVars, Vec_Int_t * vLits );
|
2014-03-07 06:21:02 +01:00
|
|
|
extern unsigned If_ManSatCheck55all( void * pSat, word * pTruth, int nVars, Vec_Int_t * vLits );
|
2008-01-31 05:01:00 +01:00
|
|
|
/*=== ifSeq.c =============================================================*/
|
|
|
|
|
extern int If_ManPerformMappingSeq( If_Man_t * p );
|
|
|
|
|
/*=== ifTime.c ============================================================*/
|
2010-11-01 09:35:04 +01:00
|
|
|
extern int If_CutDelaySopCost( If_Man_t * p, If_Cut_t * pCut );
|
2012-03-16 23:43:08 +01:00
|
|
|
extern int If_CutDelaySopCost2( If_Man_t * p, If_Cut_t * pCut );
|
2012-03-28 05:15:02 +02:00
|
|
|
extern int If_CutDelaySop( If_Man_t * p, If_Cut_t * pCut );
|
2010-11-01 09:35:04 +01:00
|
|
|
extern Vec_Wrd_t * If_CutDelaySopArray( If_Man_t * p, If_Cut_t * pCut );
|
2011-07-10 08:56:05 +02:00
|
|
|
extern float If_CutDelay( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pCut );
|
|
|
|
|
extern void If_CutPropagateRequired( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pCut, float Required );
|
2008-01-31 05:01:00 +01:00
|
|
|
/*=== ifTruth.c ===========================================================*/
|
2014-02-17 04:30:38 +01:00
|
|
|
extern void If_CutRotatePins( If_Man_t * p, If_Cut_t * pCut );
|
2012-10-27 07:36:00 +02:00
|
|
|
extern int If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_t * pCut1, int fCompl0, int fCompl1 );
|
2008-01-31 05:01:00 +01:00
|
|
|
/*=== ifUtil.c ============================================================*/
|
|
|
|
|
extern void If_ManCleanNodeCopy( If_Man_t * p );
|
|
|
|
|
extern void If_ManCleanCutData( If_Man_t * p );
|
|
|
|
|
extern void If_ManCleanMarkV( If_Man_t * p );
|
|
|
|
|
extern float If_ManDelayMax( If_Man_t * p, int fSeq );
|
|
|
|
|
extern void If_ManComputeRequired( If_Man_t * p );
|
|
|
|
|
extern float If_ManScanMapping( If_Man_t * p );
|
|
|
|
|
extern float If_ManScanMappingDirect( If_Man_t * p );
|
|
|
|
|
extern float If_ManScanMappingSeq( If_Man_t * p );
|
|
|
|
|
extern void If_ManResetOriginalRefs( If_Man_t * p );
|
|
|
|
|
extern int If_ManCrossCut( If_Man_t * p );
|
|
|
|
|
|
|
|
|
|
extern Vec_Ptr_t * If_ManReverseOrder( If_Man_t * p );
|
|
|
|
|
extern void If_ManMarkMapping( If_Man_t * p );
|
|
|
|
|
extern Vec_Ptr_t * If_ManCollectMappingDirect( If_Man_t * p );
|
2008-03-27 16:01:00 +01:00
|
|
|
extern Vec_Int_t * If_ManCollectMappingInt( If_Man_t * p );
|
|
|
|
|
|
2008-03-01 17:01:00 +01:00
|
|
|
extern int If_ManCountSpecialPos( If_Man_t * p );
|
2012-10-26 07:10:24 +02:00
|
|
|
extern void If_CutTraverse( If_Man_t * p, If_Obj_t * pRoot, If_Cut_t * pCut, Vec_Ptr_t * vNodes );
|
2012-10-28 02:33:13 +02:00
|
|
|
extern void If_ObjPrint( If_Obj_t * pObj );
|
2008-03-01 17:01:00 +01:00
|
|
|
|
|
|
|
|
|
2010-11-01 09:35:04 +01:00
|
|
|
ABC_NAMESPACE_HEADER_END
|
2008-01-31 05:01:00 +01:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// END OF FILE ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|