Commit 19ccaf21 by Alan Mishchenko

Experiments with new network data-structure.

parent 33290869
...@@ -1042,6 +1042,34 @@ SOURCE=.\src\base\exor\exorList.c ...@@ -1042,6 +1042,34 @@ SOURCE=.\src\base\exor\exorList.c
SOURCE=.\src\base\exor\exorUtil.c SOURCE=.\src\base\exor\exorUtil.c
# End Source File # End Source File
# End Group # End Group
# Begin Group "acb"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\src\base\acb\acb.c
# End Source File
# Begin Source File
SOURCE=.\src\base\acb\acb.h
# End Source File
# Begin Source File
SOURCE=.\src\base\acb\acbAbc.c
# End Source File
# Begin Source File
SOURCE=.\src\base\acb\acbAig.c
# End Source File
# Begin Source File
SOURCE=.\src\base\acb\acbCom.c
# End Source File
# Begin Source File
SOURCE=.\src\base\acb\acbFunc.c
# End Source File
# End Group
# End Group # End Group
# Begin Group "bdd" # Begin Group "bdd"
...@@ -4779,6 +4807,10 @@ SOURCE=.\src\aig\gia\giaTsim.c ...@@ -4779,6 +4807,10 @@ SOURCE=.\src\aig\gia\giaTsim.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\aig\gia\giaUnate.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaUtil.c SOURCE=.\src\aig\gia\giaUtil.c
# End Source File # End Source File
# End Group # End Group
...@@ -4787,12 +4819,20 @@ SOURCE=.\src\aig\gia\giaUtil.c ...@@ -4787,12 +4819,20 @@ SOURCE=.\src\aig\gia\giaUtil.c
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=.\src\aig\miniaig\abcOper.h
# End Source File
# Begin Source File
SOURCE=.\src\aig\miniaig\miniaig.h SOURCE=.\src\aig\miniaig\miniaig.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\aig\miniaig\minilut.h SOURCE=.\src\aig\miniaig\minilut.h
# End Source File # End Source File
# Begin Source File
SOURCE=.\src\aig\miniaig\ndr.h
# End Source File
# End Group # End Group
# End Group # End Group
# Begin Group "bool" # Begin Group "bool"
......
/**CFile****************************************************************
FileName [acbTypes.h]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Hierarchical word-level netlist.]
Synopsis [External declarations.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - July 21, 2015.]
Revision [$Id: acbTypes.h,v 1.00 2014/11/29 00:00:00 alanmi Exp $]
***********************************************************************/
#ifndef ABC__base__acb__acb__types_h
#define ABC__base__acb__acb__types_h
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_HEADER_START
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
// network objects
typedef enum {
ABC_OPER_NONE = 0, // 00 unused
ABC_OPER_PI, // 01 input
ABC_OPER_PO, // 02 output
ABC_OPER_CI, // 03 combinational input
ABC_OPER_CO, // 04 combinational output
ABC_OPER_FON, // 05 output placeholder
ABC_OPER_BOX, // 06 box
ABC_OPER_CONST_F, // 07
ABC_OPER_CONST_T, // 08
ABC_OPER_CONST_X, // 09
ABC_OPER_CONST_Z, // 10
ABC_OPER_BIT_BUF, // 11
ABC_OPER_BIT_INV, // 12
ABC_OPER_BIT_AND, // 13
ABC_OPER_BIT_NAND, // 14
ABC_OPER_BIT_OR, // 15
ABC_OPER_BIT_NOR, // 16
ABC_OPER_BIT_XOR, // 17
ABC_OPER_BIT_NXOR, // 18
ABC_OPER_BIT_SHARP, // 19
ABC_OPER_BIT_SHARPL, // 20
ABC_OPER_BIT_MUX, // 21
ABC_OPER_BIT_MAJ, // 22
ABC_OPER_ABC, // 23
ABC_OPER_BA, // 24
ABC_OPER_BO, // 25
ABC_OPER_BX, // 26
ABC_OPER_BN, // 27
ABC_OPER_BAO, // 28
ABC_OPER_BOA, // 29
ABC_OPER_RED_AND, // 30
ABC_OPER_RED_NAND, // 31
ABC_OPER_RED_OR, // 32
ABC_OPER_RED_NOR, // 33
ABC_OPER_RED_XOR, // 34
ABC_OPER_RED_NXOR, // 35
ABC_OPER_LOGIC_NOT, // 36
ABC_OPER_LOGIC_AND, // 37
ABC_OPER_LOGIC_NAND, // 38
ABC_OPER_LOGIC_OR, // 39
ABC_OPER_LOGIC_NOR, // 40
ABC_OPER_LOGIC_XOR, // 41
ABC_OPER_LOGIC_XNOR, // 42
ABC_OPER_SEL_NMUX, // 43
ABC_OPER_SEL_SEL, // 44
ABC_OPER_SEL_PSEL, // 45
ABC_OPER_SEL_ENC, // 46
ABC_OPER_SEL_PENC, // 47
ABC_OPER_SEL_DEC, // 48
ABC_OPER_SEL_EDEC, // 49
ABC_OPER_ARI_ADD, // 50
ABC_OPER_ARI_SUB, // 51
ABC_OPER_ARI_MUL, // 52
ABC_OPER_ARI_SMUL, // 53
ABC_OPER_ARI_DIV, // 54
ABC_OPER_ARI_MOD, // 55
ABC_OPER_ARI_REM, // 56
ABC_OPER_ARI_POW, // 57
ABC_OPER_ARI_MIN, // 58
ABC_OPER_ARI_SQRT, // 59
ABC_OPER_ARI_ABS, // 60
ABC_OPER_COMP_SLESS, // 61
ABC_OPER_COMP_LESS, // 62
ABC_OPER_COMP_LESSEQU, // 63
ABC_OPER_COMP_MOREEQU, // 64
ABC_OPER_COMP_MORE, // 65
ABC_OPER_COMP_EQU, // 66
ABC_OPER_COMP_NOTEQU, // 67
ABC_OPER_SHIFT_L, // 68
ABC_OPER_SHIFT_R, // 69
ABC_OPER_SHIFT_LA, // 70
ABC_OPER_SHIFT_RA, // 71
ABC_OPER_SHIFT_ROTL, // 72
ABC_OPER_SHIFT_ROTR, // 73
ABC_OPER_NODE, // 74
ABC_OPER_LUT, // 75
ABC_OPER_GATE, // 76
ABC_OPER_TABLE, // 77
ABC_OPER_TRI, // 78
ABC_OPER_RAM, // 79
ABC_OPER_RAMR, // 80
ABC_OPER_RAMW, // 81
ABC_OPER_RAMWC, // 82
ABC_OPER_RAML, // 83
ABC_OPER_RAMS, // 84
ABC_OPER_RAMBOX, // 85
ABC_OPER_LATCH, // 86
ABC_OPER_LATCHRS, // 87
ABC_OPER_DFF, // 88
ABC_OPER_DFFCPL, // 89
ABC_OPER_DFFRS, // 90
ABC_OPER_SLICE, // 91
ABC_OPER_CONCAT, // 92
ABC_OPER_ZEROPAD, // 93
ABC_OPER_SIGNEXT, // 94
ABC_OPER_LOGIC_IMPL, // 95
ABC_OPER_ARI_SQUARE, // 96
ABC_OPER_CONST, // 97
ABC_OPER_LAST // 98
} Acb_ObjType_t;
// printing operator types
static inline char * Abc_OperName( int Type )
{
if ( Type == ABC_OPER_NONE ) return NULL;
if ( Type == ABC_OPER_PI ) return "pi";
if ( Type == ABC_OPER_PO ) return "po";
if ( Type == ABC_OPER_CI ) return "ci";
if ( Type == ABC_OPER_CO ) return "co";
if ( Type == ABC_OPER_FON ) return "fon";
if ( Type == ABC_OPER_BOX ) return "box";
if ( Type == ABC_OPER_BIT_BUF ) return "buf";
if ( Type == ABC_OPER_BIT_INV ) return "~";
if ( Type == ABC_OPER_BIT_MUX ) return "mux";
if ( Type == ABC_OPER_BIT_MAJ ) return "maj";
if ( Type == ABC_OPER_BIT_AND ) return "&";
if ( Type == ABC_OPER_BIT_OR ) return "|";
if ( Type == ABC_OPER_BIT_XOR ) return "^";
if ( Type == ABC_OPER_BIT_NAND ) return "~&";
if ( Type == ABC_OPER_BIT_NOR ) return "~|";
if ( Type == ABC_OPER_BIT_NXOR ) return "~^";
if ( Type == ABC_OPER_RED_AND ) return "&";
if ( Type == ABC_OPER_RED_OR ) return "|";
if ( Type == ABC_OPER_RED_XOR ) return "^";
if ( Type == ABC_OPER_RED_NAND ) return "~&";
if ( Type == ABC_OPER_RED_NOR ) return "~|";
if ( Type == ABC_OPER_RED_NXOR ) return "~^";
if ( Type == ABC_OPER_LOGIC_NOT ) return "!";
if ( Type == ABC_OPER_LOGIC_IMPL ) return "=>";
if ( Type == ABC_OPER_LOGIC_AND ) return "&&";
if ( Type == ABC_OPER_LOGIC_OR ) return "||";
if ( Type == ABC_OPER_LOGIC_XOR ) return "^^";
if ( Type == ABC_OPER_ARI_ADD ) return "+";
if ( Type == ABC_OPER_ARI_SUB ) return "-";
if ( Type == ABC_OPER_ARI_MUL ) return "*";
if ( Type == ABC_OPER_ARI_DIV ) return "/";
if ( Type == ABC_OPER_ARI_REM ) return "%";
if ( Type == ABC_OPER_ARI_MOD ) return "mod";
if ( Type == ABC_OPER_ARI_POW ) return "**";
if ( Type == ABC_OPER_ARI_MIN ) return "-";
if ( Type == ABC_OPER_ARI_SQRT ) return "sqrt";
if ( Type == ABC_OPER_ARI_SQUARE ) return "squar";
if ( Type == ABC_OPER_COMP_EQU ) return "==";
if ( Type == ABC_OPER_COMP_NOTEQU ) return "!=";
if ( Type == ABC_OPER_COMP_LESS ) return "<";
if ( Type == ABC_OPER_COMP_MORE ) return ">";
if ( Type == ABC_OPER_COMP_LESSEQU ) return "<=";
if ( Type == ABC_OPER_COMP_MOREEQU ) return ">=";
if ( Type == ABC_OPER_SHIFT_L ) return "<<";
if ( Type == ABC_OPER_SHIFT_R ) return ">>";
if ( Type == ABC_OPER_SHIFT_LA ) return "<<<";
if ( Type == ABC_OPER_SHIFT_RA ) return ">>>";
if ( Type == ABC_OPER_SHIFT_ROTL ) return "rotL";
if ( Type == ABC_OPER_SHIFT_ROTR ) return "rotR";
if ( Type == ABC_OPER_SLICE ) return "[:]";
if ( Type == ABC_OPER_CONCAT ) return "{}";
if ( Type == ABC_OPER_ZEROPAD ) return "zPad";
if ( Type == ABC_OPER_SIGNEXT ) return "sExt";
if ( Type == ABC_OPER_TABLE ) return "table";
if ( Type == ABC_OPER_LAST ) return NULL;
assert( 0 );
return NULL;
}
////////////////////////////////////////////////////////////////////////
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// ITERATORS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_HEADER_END
#endif
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...@@ -786,6 +786,7 @@ extern ABC_DLL void Abc_NtkFixNonDrivenNets( Abc_Ntk_t * pNtk ); ...@@ -786,6 +786,7 @@ extern ABC_DLL void Abc_NtkFixNonDrivenNets( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkMakeComb( Abc_Ntk_t * pNtk, int fRemoveLatches ); extern ABC_DLL void Abc_NtkMakeComb( Abc_Ntk_t * pNtk, int fRemoveLatches );
extern ABC_DLL void Abc_NtkPermute( Abc_Ntk_t * pNtk, int fInputs, int fOutputs, int fFlops, char * pFlopPermFile ); extern ABC_DLL void Abc_NtkPermute( Abc_Ntk_t * pNtk, int fInputs, int fOutputs, int fFlops, char * pFlopPermFile );
extern ABC_DLL void Abc_NtkUnpermute( Abc_Ntk_t * pNtk ); extern ABC_DLL void Abc_NtkUnpermute( Abc_Ntk_t * pNtk );
extern ABC_DLL Abc_Ntk_t * Abc_NtkCreateFromSops( char * pName, Vec_Ptr_t * vSops );
/*=== abcObj.c ==========================================================*/ /*=== abcObj.c ==========================================================*/
extern ABC_DLL Abc_Obj_t * Abc_ObjAlloc( Abc_Ntk_t * pNtk, Abc_ObjType_t Type ); extern ABC_DLL Abc_Obj_t * Abc_ObjAlloc( Abc_Ntk_t * pNtk, Abc_ObjType_t Type );
extern ABC_DLL void Abc_ObjRecycle( Abc_Obj_t * pObj ); extern ABC_DLL void Abc_ObjRecycle( Abc_Obj_t * pObj );
......
...@@ -2201,6 +2201,45 @@ Abc_Ntk_t * Abc_NtkNodeDup( Abc_Ntk_t * pNtkInit, int nLimit, int fVerbose ) ...@@ -2201,6 +2201,45 @@ Abc_Ntk_t * Abc_NtkNodeDup( Abc_Ntk_t * pNtkInit, int nLimit, int fVerbose )
return pNtk; return pNtk;
} }
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t * Abc_NtkCreateFromSops( char * pName, Vec_Ptr_t * vSops )
{
int i, k, nObjBeg;
char * pSop = (char *)Vec_PtrEntry(vSops, 0);
Abc_Ntk_t * pNtk = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_SOP, 1 );
pNtk->pName = Extra_UtilStrsav( pName );
for ( k = 0; pSop[k] != ' '; k++ )
Abc_NtkCreatePi( pNtk );
nObjBeg = Abc_NtkObjNumMax(pNtk);
Vec_PtrForEachEntry( char *, vSops, pSop, i )
{
Abc_Obj_t * pObj = Abc_NtkCreateNode( pNtk );
pObj->pData = Abc_SopRegister( (Mem_Flex_t*)pNtk->pManFunc, pSop );
for ( k = 0; pSop[k] != ' '; k++ )
Abc_ObjAddFanin( pObj, Abc_NtkCi(pNtk, k) );
}
for ( i = 0; i < Vec_PtrSize(vSops); i++ )
{
Abc_Obj_t * pObj = Abc_NtkObj( pNtk, nObjBeg + i );
Abc_Obj_t * pObjPo = Abc_NtkCreatePo( pNtk );
Abc_ObjAddFanin( pObjPo, pObj );
}
Abc_NtkAddDummyPiNames( pNtk );
Abc_NtkAddDummyPoNames( pNtk );
return pNtk;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// END OF FILE /// /// END OF FILE ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "map/mio/mio.h" #include "map/mio/mio.h"
#include "bool/dec/dec.h" #include "bool/dec/dec.h"
#include "opt/fxu/fxu.h" #include "opt/fxu/fxu.h"
#include "aig/miniaig/ndr.h"
#ifdef ABC_USE_CUDD #ifdef ABC_USE_CUDD
#include "bdd/extrab/extraBdd.h" #include "bdd/extrab/extraBdd.h"
...@@ -3087,6 +3088,59 @@ Abc_Ntk_t * Abc_NtkCreatePropertyMonitorTest( Abc_Ntk_t * p ) ...@@ -3087,6 +3088,59 @@ Abc_Ntk_t * Abc_NtkCreatePropertyMonitorTest( Abc_Ntk_t * p )
return pNtk; return pNtk;
} }
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_GateToType( Abc_Obj_t * pObj )
{
char * pGateName = Mio_GateReadName((Mio_Gate_t *)pObj->pData);
if ( !strncmp(pGateName, "buf", 3) ) return ABC_OPER_BIT_BUF;
if ( !strncmp(pGateName, "inv", 3) ) return ABC_OPER_BIT_INV;
if ( !strncmp(pGateName, "and", 3) ) return ABC_OPER_BIT_AND;
if ( !strncmp(pGateName, "nand", 4) ) return ABC_OPER_BIT_NAND;
if ( !strncmp(pGateName, "or", 2) ) return ABC_OPER_BIT_OR;
if ( !strncmp(pGateName, "nor", 3) ) return ABC_OPER_BIT_NOR;
if ( !strncmp(pGateName, "xor", 3) ) return ABC_OPER_BIT_XOR;
if ( !strncmp(pGateName, "nxor", 4) ) return ABC_OPER_BIT_NXOR;
assert( 0 );
return -1;
}
Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops )
{
Vec_Wec_t * vRes = NULL;
Abc_Ntk_t * pNtk = Abc_NtkCreateFromSops( "top", vSops );
Abc_Ntk_t * pNtkNew;
Abc_Obj_t * pObj, * pFanin;
int i, k, iNode = 0;
Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2; map -a" );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
Abc_NtkDelete( pNtk );
vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) );
Abc_NtkForEachPi( pNtkNew, pObj, i )
pObj->iTemp = iNode++;
Abc_NtkForEachNode( pNtkNew, pObj, i )
{
Vec_Int_t * vNode = Vec_WecEntry(vRes, iNode);
Vec_IntPush( vNode, Abc_GateToType(pObj) );
Abc_ObjForEachFanin( pObj, pFanin, k )
Vec_IntPush( vNode, pFanin->iTemp );
pObj->iTemp = iNode++;
}
Abc_NtkForEachPo( pNtkNew, pObj, i )
Vec_IntPushTwo( Vec_WecEntry(vRes, iNode++), ABC_OPER_BIT_BUF, Abc_ObjFanin0(pObj)->iTemp );
assert( Vec_WecSize(vRes) == iNode );
return vRes;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// END OF FILE /// /// END OF FILE ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -130,6 +130,7 @@ static int Abc_CommandMerge ( Abc_Frame_t * pAbc, int argc, cha ...@@ -130,6 +130,7 @@ static int Abc_CommandMerge ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandTestDec ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandTestDec ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTestNpn ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandTestNpn ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTestRPO ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandTestRPO ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTestRun ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandRewrite ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandRewrite ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandRefactor ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandRefactor ( Abc_Frame_t * pAbc, int argc, char ** argv );
...@@ -785,6 +786,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) ...@@ -785,6 +786,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Synthesis", "testdec", Abc_CommandTestDec, 0 ); Cmd_CommandAdd( pAbc, "Synthesis", "testdec", Abc_CommandTestDec, 0 );
Cmd_CommandAdd( pAbc, "Synthesis", "testnpn", Abc_CommandTestNpn, 0 ); Cmd_CommandAdd( pAbc, "Synthesis", "testnpn", Abc_CommandTestNpn, 0 );
Cmd_CommandAdd( pAbc, "LogiCS", "testrpo", Abc_CommandTestRPO, 0 ); Cmd_CommandAdd( pAbc, "LogiCS", "testrpo", Abc_CommandTestRPO, 0 );
Cmd_CommandAdd( pAbc, "Synthesis", "testrun", Abc_CommandTestRun, 0 );
Cmd_CommandAdd( pAbc, "Synthesis", "rewrite", Abc_CommandRewrite, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "rewrite", Abc_CommandRewrite, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "refactor", Abc_CommandRefactor, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "refactor", Abc_CommandRefactor, 1 );
...@@ -6524,6 +6526,53 @@ usage: ...@@ -6524,6 +6526,53 @@ usage:
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_CommandTestRun( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern void Acb_NtkTestRun( char * pFileNames[3], int fVerbose );
int c, fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
{
switch ( c )
{
case 'v':
fVerbose ^= 1;
break;
case 'h':
goto usage;
default:
goto usage;
}
}
// pArgvNew = argv + globalUtilOptind;
// nArgcNew = argc - globalUtilOptind;
if ( argc - globalUtilOptind != 3 )
{
Abc_Print( 1, "Expecting three file names on the command line.\n" );
goto usage;
}
Acb_NtkTestRun( argv + globalUtilOptind, fVerbose );
return 0;
usage:
Abc_Print( -2, "usage: testrun [-vh]\n" );
Abc_Print( -2, "\t performs testing by running internal procedures\n" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_CommandRewrite( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
/**CFile****************************************************************
FileName [acb.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Hierarchical word-level netlist.]
Synopsis []
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - July 21, 2015.]
Revision [$Id: acb.c,v 1.00 2014/11/29 00:00:00 alanmi Exp $]
***********************************************************************/
#include "acb.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
/**CFile****************************************************************
FileName [acbAbc.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Hierarchical word-level netlist.]
Synopsis [Bridge.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - July 21, 2015.]
Revision [$Id: acbAbc.c,v 1.00 2014/11/29 00:00:00 alanmi Exp $]
***********************************************************************/
#include "acb.h"
#include "base/abc/abc.h"
#include "aig/miniaig/ndr.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Acb_Ntk_t * Acb_NtkFromAbc( Abc_Ntk_t * p )
{
Acb_Man_t * pMan = Acb_ManAlloc( Abc_NtkSpec(p), 1, NULL, NULL, NULL, NULL );
int i, k, NameId = Abc_NamStrFindOrAdd( pMan->pStrs, Abc_NtkName(p), NULL );
Acb_Ntk_t * pNtk = Acb_NtkAlloc( pMan, NameId, Abc_NtkCiNum(p), Abc_NtkCoNum(p), Abc_NtkObjNum(p) );
Abc_Obj_t * pObj, * pFanin;
assert( Abc_NtkIsSopLogic(p) );
Abc_NtkForEachCi( p, pObj, i )
pObj->iTemp = Acb_ObjAlloc( pNtk, ABC_OPER_CI, 0, 0 );
Abc_NtkForEachNode( p, pObj, i )
pObj->iTemp = Acb_ObjAlloc( pNtk, ABC_OPER_LUT, Abc_ObjFaninNum(pObj), 0 );
Abc_NtkForEachCo( p, pObj, i )
pObj->iTemp = Acb_ObjAlloc( pNtk, ABC_OPER_CO, 1, 0 );
Abc_NtkForEachNode( p, pObj, i )
Abc_ObjForEachFanin( pObj, pFanin, k )
Acb_ObjAddFanin( pNtk, pObj->iTemp, pFanin->iTemp );
Abc_NtkForEachCo( p, pObj, i )
Acb_ObjAddFanin( pNtk, pObj->iTemp, Abc_ObjFanin(pObj, 0)->iTemp );
Acb_NtkCleanObjTruths( pNtk );
Abc_NtkForEachNode( p, pObj, i )
Acb_ObjSetTruth( pNtk, pObj->iTemp, Abc_SopToTruth((char *)pObj->pData, Abc_ObjFaninNum(pObj)) );
Acb_NtkSetRegNum( pNtk, Abc_NtkLatchNum(p) );
Acb_NtkAdd( pMan, pNtk );
return pNtk;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Acb_Ntk_t * Acb_NtkFromNdr( char * pFileName, void * pModule, Abc_Nam_t * pNames, Vec_Int_t * vWeights, int nNameIdMax )
{
Ndr_Data_t * p = (Ndr_Data_t *)pModule;
Acb_Man_t * pMan = Acb_ManAlloc( pFileName, 1, Abc_NamRef(pNames), NULL, NULL, NULL );
int k, NameId = Abc_NamStrFindOrAdd( pMan->pStrs, pMan->pName, NULL );
int Mod = 0, Obj, Type, nArray, * pArray, ObjId;
Acb_Ntk_t * pNtk = Acb_NtkAlloc( pMan, NameId, Ndr_DataCiNum(p, Mod), Ndr_DataCoNum(p, Mod), Ndr_DataObjNum(p, Mod) );
Vec_Int_t * vMap = Vec_IntStart( nNameIdMax );
Acb_NtkCleanObjWeights( pNtk );
Acb_NtkCleanObjNames( pNtk );
Ndr_ModForEachPi( p, Mod, Obj )
{
NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
ObjId = Acb_ObjAlloc( pNtk, ABC_OPER_CI, 0, 0 );
Vec_IntWriteEntry( vMap, NameId, ObjId );
Acb_ObjSetName( pNtk, ObjId, NameId );
}
Ndr_ModForEachPi( p, Mod, Obj )
{
NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
ObjId = Acb_ObjAlloc( pNtk, ABC_OPER_CI, 0, 0 );
Vec_IntWriteEntry( vMap, NameId, ObjId );
Acb_ObjSetName( pNtk, ObjId, NameId );
}
Ndr_ModForEachTarget( p, Mod, Obj )
{
NameId = Ndr_DataEntry( p, Obj );
ObjId = Acb_ObjAlloc( pNtk, ABC_OPER_CONST_F, 0, 0 );
Vec_IntWriteEntry( vMap, NameId, ObjId );
Acb_ObjSetName( pNtk, ObjId, NameId );
Vec_IntPush( &pNtk->vTargets, ObjId );
}
Ndr_ModForEachNode( p, Mod, Obj )
{
NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
nArray = Ndr_ObjReadArray( p, Obj, NDR_INPUT, &pArray );
Type = Ndr_ObjReadBody( p, Obj, NDR_OPERTYPE );
ObjId = Acb_ObjAlloc( pNtk, Type, nArray, 0 );
Vec_IntWriteEntry( vMap, NameId, ObjId );
Acb_ObjSetName( pNtk, ObjId, NameId );
}
Ndr_ModForEachNode( p, Mod, Obj )
{
NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
ObjId = Vec_IntEntry( vMap, NameId );
nArray = Ndr_ObjReadArray( p, Obj, NDR_INPUT, &pArray );
for ( k = 0; k < nArray; k++ )
Acb_ObjAddFanin( pNtk, ObjId, Vec_IntEntry(vMap, pArray[k]) );
Acb_ObjSetWeight( pNtk, ObjId, vWeights ? Vec_IntEntry(vWeights, NameId) : 0 );
}
Ndr_ModForEachPo( p, Mod, Obj )
{
nArray = Ndr_ObjReadArray( p, Obj, NDR_INPUT, &pArray );
assert( nArray == 1 );
ObjId = Acb_ObjAlloc( pNtk, ABC_OPER_CO, 1, 0 );
Acb_ObjAddFanin( pNtk, ObjId, Vec_IntEntry(vMap, pArray[0]) );
Acb_ObjSetName( pNtk, ObjId, pArray[0] );
}
Vec_IntFree( vMap );
Acb_NtkSetRegNum( pNtk, 0 );
Acb_NtkAdd( pMan, pNtk );
return pNtk;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
/**CFile****************************************************************
FileName [acbAig.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Hierarchical word-level netlist.]
Synopsis []
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - July 21, 2015.]
Revision [$Id: acbAig.c,v 1.00 2014/11/29 00:00:00 alanmi Exp $]
***********************************************************************/
#include "acb.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
/**CFile****************************************************************
FileName [abcFunc.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Network and node package.]
Synopsis [Experimental procedures.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: abcFunc.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "acb.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Acb_NtkTestRun( char * pFileNames[3], int fVerbose )
{
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
SRC += src/base/acb/acbAbc.c \
src/base/acb/abcAig.c \
src/base/acb/abcCom.c \
src/base/acb/acbFunc.c
...@@ -32,7 +32,7 @@ ABC_NAMESPACE_IMPL_START ...@@ -32,7 +32,7 @@ ABC_NAMESPACE_IMPL_START
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
static Mio_Library_t * Mio_LibraryReadOne( char * FileName, int fExtendedFormat, st__table * tExcludeGate, int fVerbose ); static Mio_Library_t * Mio_LibraryReadOne( char * FileName, int fExtendedFormat, st__table * tExcludeGate, int fVerbose );
static Mio_Library_t * Mio_LibraryReadBuffer( char * pBuffer, int fExtendedFormat, st__table * tExcludeGate, int fVerbose ); Mio_Library_t * Mio_LibraryReadBuffer( char * pBuffer, int fExtendedFormat, st__table * tExcludeGate, int fVerbose );
static int Mio_LibraryReadInternal( Mio_Library_t * pLib, char * pBuffer, int fExtendedFormat, st__table * tExcludeGate, int fVerbose ); static int Mio_LibraryReadInternal( Mio_Library_t * pLib, char * pBuffer, int fExtendedFormat, st__table * tExcludeGate, int fVerbose );
static Mio_Gate_t * Mio_LibraryReadGate( char ** ppToken, int fExtendedFormat ); static Mio_Gate_t * Mio_LibraryReadGate( char ** ppToken, int fExtendedFormat );
static Mio_Pin_t * Mio_LibraryReadPin( char ** ppToken, int fExtendedFormat ); static Mio_Pin_t * Mio_LibraryReadPin( char ** ppToken, int fExtendedFormat );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment