mirror of https://github.com/YosysHQ/abc.git
Supporting LUT in NDR and WLC.
This commit is contained in:
parent
0739bd7f03
commit
362b2d9d08
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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":"" );
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Reference in New Issue