summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2019-04-05 21:08:46 -1000
committerAlan Mishchenko <alanmi@berkeley.edu>2019-04-05 21:08:46 -1000
commit362b2d9d08f4dbc8dfc751b68ddf7bd3f9c4ed54 (patch)
tree1b530ec6aaf1242abc6f94022106a547c91381ff /src
parent0739bd7f03eacdb11034d166e5b799f2e59796fc (diff)
downloadabc-362b2d9d08f4dbc8dfc751b68ddf7bd3f9c4ed54.tar.gz
abc-362b2d9d08f4dbc8dfc751b68ddf7bd3f9c4ed54.tar.bz2
abc-362b2d9d08f4dbc8dfc751b68ddf7bd3f9c4ed54.zip
Supporting LUT in NDR and WLC.
Diffstat (limited to 'src')
-rw-r--r--src/aig/miniaig/abcOper.h1
-rw-r--r--src/base/wlc/wlc.h1
-rw-r--r--src/base/wlc/wlcBlast.c2
-rw-r--r--src/base/wlc/wlcNdr.c4
-rw-r--r--src/base/wlc/wlcWriteVer.c9
-rw-r--r--src/base/wln/wlnRetime.c9
-rw-r--r--src/base/wln/wlnWriteVer.c9
7 files changed, 30 insertions, 5 deletions
diff --git a/src/aig/miniaig/abcOper.h b/src/aig/miniaig/abcOper.h
index d5537aab..2fd7ab24 100644
--- a/src/aig/miniaig/abcOper.h
+++ b/src/aig/miniaig/abcOper.h
@@ -226,6 +226,7 @@ static inline const char * Abc_OperName( int Type )
if ( Type == ABC_OPER_CONST ) return "const";
if ( Type == ABC_OPER_TABLE ) return "table";
+ if ( Type == ABC_OPER_LUT ) return "lut";
if ( Type == ABC_OPER_LAST ) return NULL;
assert( 0 );
return NULL;
diff --git a/src/base/wlc/wlc.h b/src/base/wlc/wlc.h
index abea47a4..d39738a8 100644
--- a/src/base/wlc/wlc.h
+++ b/src/base/wlc/wlc.h
@@ -101,6 +101,7 @@ typedef enum {
WLC_OBJ_ARI_ADDSUB, // 56: adder-subtractor
WLC_OBJ_SEL, // 57: positionally encoded selector
WLC_OBJ_DEC, // 58: decoder
+ WLC_OBJ_LUT, // 59: lookup table
WLC_OBJ_NUMBER // 59: unused
} Wlc_ObjType_t;
// when adding new types, remember to update table Wlc_Names in "wlcNtk.c"
diff --git a/src/base/wlc/wlcBlast.c b/src/base/wlc/wlcBlast.c
index dce2d00f..0e4ed9e1 100644
--- a/src/base/wlc/wlcBlast.c
+++ b/src/base/wlc/wlcBlast.c
@@ -2055,7 +2055,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
}
else
{
- pNew = Gia_ManDupZeroUndc( pTemp = pNew, p->pInits, pPar->fSaveFfNames ? 1+Gia_ManRegNum(pNew) : 0, pPar->fGiaSimple, 0 );
+ pNew = Gia_ManDupZeroUndc( pTemp = pNew, p->pInits, pPar->fSaveFfNames ? 1+Gia_ManRegNum(pNew) : 0, pPar->fGiaSimple, pPar->fVerbose );
Gia_ManDupRemapLiterals( vBits, pTemp );
Gia_ManStop( pTemp );
}
diff --git a/src/base/wlc/wlcNdr.c b/src/base/wlc/wlcNdr.c
index e5e64329..c70e4a6d 100644
--- a/src/base/wlc/wlcNdr.c
+++ b/src/base/wlc/wlcNdr.c
@@ -100,7 +100,7 @@ int Ndr_TypeNdr2Wlc( int Type )
if ( Type == ABC_OPER_DFFRSE ) return WLC_OBJ_FF; // 05: flop
if ( Type == ABC_OPER_RAMR ) return WLC_OBJ_READ; // 54: read port
if ( Type == ABC_OPER_RAMW ) return WLC_OBJ_WRITE; // 55: write port
- if ( Type == ABC_OPER_LUT ) return WLC_OBJ_TABLE; // 55: LUT
+ if ( Type == ABC_OPER_LUT ) return WLC_OBJ_LUT; // 59: LUT
return -1;
}
int Ndr_TypeWlc2Ndr( int Type )
@@ -160,7 +160,7 @@ int Ndr_TypeWlc2Ndr( int Type )
if ( Type == WLC_OBJ_FF ) return ABC_OPER_DFFRSE; // 05: flop
if ( Type == WLC_OBJ_READ ) return ABC_OPER_RAMR; // 54: read port
if ( Type == WLC_OBJ_WRITE ) return ABC_OPER_RAMW; // 55: write port
- if ( Type == WLC_OBJ_TABLE ) return ABC_OPER_LUT; // 55: LUT
+ if ( Type == WLC_OBJ_LUT ) return ABC_OPER_LUT; // 59: LUT
return -1;
}
diff --git a/src/base/wlc/wlcWriteVer.c b/src/base/wlc/wlcWriteVer.c
index 90d49ade..13bc3b26 100644
--- a/src/base/wlc/wlcWriteVer.c
+++ b/src/base/wlc/wlcWriteVer.c
@@ -203,6 +203,15 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
fprintf( pFile, " s%d_Index(%s, ", i, Wlc_ObjName(p, Wlc_ObjFaninId0(pObj)) );
fprintf( pFile, "%s)", Wlc_ObjName(p, i) );
}
+ else if ( pObj->Type == WLC_OBJ_LUT )
+ {
+ // wire [3:0] s4972; LUT lut4972_Index(s4971, s4972);
+ fprintf( pFile, "%s ; LUT", Wlc_ObjName(p, i) );
+ fprintf( pFile, " lut%d (%s, ", i, Wlc_ObjName(p, Wlc_ObjFaninId0(pObj)) );
+ for ( k = 1; k < Wlc_ObjFaninNum(pObj); k++ )
+ fprintf( pFile, "%s, ", Wlc_ObjName(p, Wlc_ObjFaninId(pObj, k)) );
+ fprintf( pFile, "%s)", Wlc_ObjName(p, i) );
+ }
else if ( pObj->Type == WLC_OBJ_CONST )
{
fprintf( pFile, "%-16s = %d\'%sh", Wlc_ObjName(p, i), Wlc_ObjRange(pObj), Wlc_ObjIsSigned(pObj) ? "s":"" );
diff --git a/src/base/wln/wlnRetime.c b/src/base/wln/wlnRetime.c
index 7045527c..ff8e0839 100644
--- a/src/base/wln/wlnRetime.c
+++ b/src/base/wln/wlnRetime.c
@@ -503,12 +503,17 @@ void Wln_NtkRetimeCreateDelayInfo( Wln_Ntk_t * pNtk )
printf( "The design has no delay information.\n" );
Wln_NtkCleanInstId(pNtk);
Wln_NtkForEachObj( pNtk, iObj )
- if ( Wln_ObjIsFf(pNtk, iObj) )
+ {
+ if ( Wln_ObjIsFf(pNtk, iObj) || Wln_ObjType(pNtk, iObj) == ABC_OPER_SLICE || Wln_ObjType(pNtk, iObj) == ABC_OPER_CONCAT )
Wln_ObjSetInstId( pNtk, iObj, 1 );
else if ( !Wln_ObjIsCio(pNtk, iObj) && Wln_ObjFaninNum(pNtk, iObj) > 0 )
Wln_ObjSetInstId( pNtk, iObj, 10 );
+ }
Wln_NtkForEachCo( pNtk, iObj, i )
- Wln_ObjSetInstId( pNtk, Wln_ObjFanin0(pNtk, iObj), 1 );
+ {
+ if ( Wln_ObjType(pNtk, Wln_ObjFanin0(pNtk, iObj)) != ABC_OPER_LUT )
+ Wln_ObjSetInstId( pNtk, Wln_ObjFanin0(pNtk, iObj), 1 );
+ }
printf( "Assuming user-specified delays for internal nodes.\n" );
}
}
diff --git a/src/base/wln/wlnWriteVer.c b/src/base/wln/wlnWriteVer.c
index e0849bf4..e2af56bb 100644
--- a/src/base/wln/wlnWriteVer.c
+++ b/src/base/wln/wlnWriteVer.c
@@ -184,6 +184,15 @@ void Wln_WriteVerInt( FILE * pFile, Wln_Ntk_t * p )
fprintf( pFile, " s%d_Index(%s, ", iObj, Wln_ObjName(p, Wln_ObjFanin0(p, iObj)) );
fprintf( pFile, "%s)", Wln_ObjName(p, iObj) );
}
+ else if ( Wln_ObjType(p, iObj) == ABC_OPER_LUT )
+ {
+ // wire [3:0] s4972; LUT lut4972_Index(s4971, s4972);
+ fprintf( pFile, "%s ; LUT", Wln_ObjName(p, iObj) );
+ fprintf( pFile, " lut%d (%s, ", iObj, Wln_ObjName(p, Wln_ObjFanin0(p, iObj)) );
+ for ( k = 1; k < Wln_ObjFaninNum(p, iObj); k++ )
+ fprintf( pFile, "%s, ", Wln_ObjName(p, Wln_ObjFanin(p, iObj, k)) );
+ fprintf( pFile, "%s)", Wln_ObjName(p, iObj) );
+ }
else if ( Wln_ObjIsConst(p, iObj) )
fprintf( pFile, "%-16s = %s", Wln_ObjName(p, iObj), Wln_ObjConstString(p, iObj) );
else if ( Wln_ObjType(p, iObj) == ABC_OPER_SHIFT_ROTR || Wln_ObjType(p, iObj) == ABC_OPER_SHIFT_ROTL )