Commit e363727c by Alan Mishchenko

Several improvements to CBA data-structure.

parent 8cabdcb5
......@@ -48,8 +48,8 @@ typedef enum {
CBA_OBJ_BO, // 4: box output
CBA_OBJ_BOX, // 5: box
CBA_BOX_C0,
CBA_BOX_C1,
CBA_BOX_CF,
CBA_BOX_CT,
CBA_BOX_CX,
CBA_BOX_CZ,
CBA_BOX_BUF,
......@@ -71,7 +71,7 @@ typedef enum {
CBA_BOX_RXOR,
CBA_BOX_RXNOR,
CBA_BOX_N1MUX,
CBA_BOX_NMUX,
CBA_BOX_SEL,
CBA_BOX_PSEL,
CBA_BOX_ENC,
......@@ -159,7 +159,6 @@ struct Cba_Man_t_
int iRoot; // root network
int nNtks; // number of current networks
Cba_Ntk_t * pNtks; // networks
Vec_Int_t vInfo; // box info
// user data
Vec_Int_t vBuf2RootNtk;
Vec_Int_t vBuf2RootObj;
......@@ -173,6 +172,7 @@ struct Cba_Man_t_
static inline char * Cba_ManName( Cba_Man_t * p ) { return p->pName; }
static inline char * Cba_ManSpec( Cba_Man_t * p ) { return p->pSpec; }
static inline int Cba_ManNtkNum( Cba_Man_t * p ) { return p->nNtks; }
static inline int Cba_ManPrimNum( Cba_Man_t * p ) { return Abc_NamObjNumMax(p->pMods) - Cba_ManNtkNum(p); }
static inline int Cba_ManNtkIsOk( Cba_Man_t * p, int i ) { return i >= 0 && i < Cba_ManNtkNum(p); }
static inline Cba_Ntk_t * Cba_ManNtk( Cba_Man_t * p, int i ) { return Cba_ManNtkIsOk(p, i) ? p->pNtks + i : NULL; }
static inline int Cba_ManNtkFindId( Cba_Man_t * p, char * pName ) { return Abc_NamStrFind(p->pMods, pName) - 1; }
......@@ -180,7 +180,6 @@ static inline Cba_Ntk_t * Cba_ManNtkFind( Cba_Man_t * p, char * pName ) { r
static inline Cba_Ntk_t * Cba_ManRoot( Cba_Man_t * p ) { return Cba_ManNtk(p, p->iRoot); }
static inline char * Cba_ManStr( Cba_Man_t * p, int i ) { return Abc_NamStr(p->pStrs, i); }
static inline int Cba_ManStrId( Cba_Man_t * p, char * pStr ) { return Abc_NamStrFind(p->pStrs, pStr); }
static inline int Cba_ManInfoNum( Cba_Man_t * p ) { return Vec_IntSize(&p->vInfo) >> 2; }
static inline int Cba_NtkId( Cba_Ntk_t * p ) { int i = p - p->pDesign->pNtks; assert(Cba_ManNtkIsOk(p->pDesign, i)); return i; }
static inline Cba_Man_t * Cba_NtkMan( Cba_Ntk_t * p ) { return p->pDesign; }
......@@ -271,6 +270,47 @@ static inline Cba_Ntk_t * Cba_BoxBiNtk( Cba_Ntk_t * p, int i ) { r
static inline Cba_Ntk_t * Cba_BoxBoNtk( Cba_Ntk_t * p, int i ) { return Cba_ManNtk( p->pDesign, Cba_BoxBoNtkId(p, i) ); }
static inline char * Cba_BoxNtkName( Cba_Ntk_t * p, int i ) { return Abc_NamStr( p->pDesign->pMods, Cba_BoxNtkId(p, i) ); }
static inline int Cba_CharIsDigit( char c ) { return c >= '0' && c <= '9'; }
static inline int Cba_NtkNamePoNum( char * pName )
{
int Multi = 1, Counter = 0;
char * pTemp = pName + strlen(pName) - 1;
assert( Cba_CharIsDigit(*pTemp) );
for ( ; pName < pTemp && Cba_CharIsDigit(*pTemp); pTemp--, Multi *= 10 )
Counter += Multi * (*pTemp - '0');
return Counter;
}
static inline int Cba_NtkNamePiNum( char * pName )
{
char * pTemp; int CounterAll = 0, Counter = 0;
for ( pTemp = pName; *pTemp; pTemp++ )
{
if ( Cba_CharIsDigit(*pTemp) )
Counter = 10 * Counter + *pTemp - '0';
else
CounterAll += Counter, Counter = 0;
}
return CounterAll;
}
static inline int Cba_NtkNameRanges( char * pName, int * pRanges, char * pSymbs )
{
char Symb, * pTemp;
int nSigs = 0, Num = 0;
assert( !strncmp(pName, "ABC", 3) );
for ( pTemp = pName; *pTemp && !Cba_CharIsDigit(*pTemp); pTemp++ );
assert( Cba_CharIsDigit(*pTemp) );
Symb = *(pTemp - 1);
for ( ; *pTemp; pTemp++ )
{
if ( Cba_CharIsDigit(*pTemp) )
Num = 10 * Num + *pTemp - '0';
else
pSymbs[nSigs] = Symb, Symb = *pTemp, pRanges[nSigs++] = Num, Num = 0;
}
assert( Num > 0 );
pSymbs[nSigs] = Symb, pRanges[nSigs++] = Num;
return nSigs;
}
////////////////////////////////////////////////////////////////////////
/// MACRO DEFINITIONS ///
......@@ -590,7 +630,6 @@ static inline void Cba_ManFree( Cba_Man_t * p )
Vec_IntErase( &p->vBuf2LeafObj );
Vec_IntErase( &p->vBuf2RootNtk );
Vec_IntErase( &p->vBuf2RootObj );
Vec_IntErase( &p->vInfo );
Abc_NamDeref( p->pStrs );
Abc_NamDeref( p->pMods );
ABC_FREE( p->pName );
......@@ -649,6 +688,7 @@ static inline void Cba_ManPrintStats( Cba_Man_t * p, int nModules, int fVerbose
printf( "%-12s : ", Cba_ManName(p) );
printf( "pi =%5d ", Cba_NtkPiNum(pRoot) );
printf( "po =%5d ", Cba_NtkPoNum(pRoot) );
printf( "pri =%4d ", Cba_ManPrimNum(p) );
printf( "mod =%6d ", Cba_ManNtkNum(p) );
printf( "box =%7d ", Cba_ManNodeNum(p) );
printf( "obj =%7d ", Cba_ManObjNum(p) );
......@@ -679,8 +719,8 @@ static inline void Cba_ManPrintStats( Cba_Man_t * p, int nModules, int fVerbose
***********************************************************************/
static inline Cba_ObjType_t Ptr_SopToType( char * pSop )
{
if ( !strcmp(pSop, " 0\n") ) return CBA_BOX_C0;
if ( !strcmp(pSop, " 1\n") ) return CBA_BOX_C1;
if ( !strcmp(pSop, " 0\n") ) return CBA_BOX_CF;
if ( !strcmp(pSop, " 1\n") ) return CBA_BOX_CT;
if ( !strcmp(pSop, "1 1\n") ) return CBA_BOX_BUF;
if ( !strcmp(pSop, "0 1\n") ) return CBA_BOX_INV;
if ( !strcmp(pSop, "11 1\n") ) return CBA_BOX_AND;
......@@ -717,8 +757,8 @@ static inline char * Ptr_SopToTypeName( char * pSop )
}
static inline char * Ptr_TypeToName( Cba_ObjType_t Type )
{
if ( Type == CBA_BOX_C0 ) return "const0";
if ( Type == CBA_BOX_C1 ) return "const1";
if ( Type == CBA_BOX_CF ) return "const0";
if ( Type == CBA_BOX_CT ) return "const1";
if ( Type == CBA_BOX_BUF ) return "buf";
if ( Type == CBA_BOX_INV ) return "not";
if ( Type == CBA_BOX_AND ) return "and";
......@@ -735,8 +775,8 @@ static inline char * Ptr_TypeToName( Cba_ObjType_t Type )
}
static inline char * Ptr_TypeToSop( Cba_ObjType_t Type )
{
if ( Type == CBA_BOX_C0 ) return " 0\n";
if ( Type == CBA_BOX_C1 ) return " 1\n";
if ( Type == CBA_BOX_CF ) return " 0\n";
if ( Type == CBA_BOX_CT ) return " 1\n";
if ( Type == CBA_BOX_BUF ) return "1 1\n";
if ( Type == CBA_BOX_INV ) return "0 1\n";
if ( Type == CBA_BOX_AND ) return "11 1\n";
......
......@@ -151,9 +151,9 @@ int Cba_ManExtract_rec( Gia_Man_t * pNew, Cba_Ntk_t * p, int i, int fBuffers, Ve
Cba_ObjType_t Type = Cba_ObjType(p, iBox);
if ( nLits == 0 )
{
if ( Type == CBA_BOX_C0 )
if ( Type == CBA_BOX_CF )
iRes = 0;
else if ( Type == CBA_BOX_C1 )
else if ( Type == CBA_BOX_CT )
iRes = 1;
else assert( 0 );
}
......@@ -307,7 +307,7 @@ void Cba_NtkCreateAndConnectBuffer( Gia_Man_t * pGia, Gia_Obj_t * pObj, Cba_Ntk_
}
else
{
Cba_ObjAlloc( p, pGia && Gia_ObjFaninC0(pObj) ? CBA_BOX_C1 : CBA_BOX_C0, -1 );
Cba_ObjAlloc( p, pGia && Gia_ObjFaninC0(pObj) ? CBA_BOX_CT : CBA_BOX_CF, -1 );
}
iObj = Cba_ObjAlloc( p, CBA_OBJ_BO, -1 );
Cba_ObjSetName( p, iObj, Cba_ObjName(p, iTerm) );
......
......@@ -113,16 +113,15 @@ Cba_Man_t * Cba_ManReadCbaInt( Vec_Str_t * vOut )
Cba_Man_t * p;
Cba_Ntk_t * pNtk;
char Buffer[1000] = "#";
int i, NameId, Pos = 0, Num1, Num2, Num3;
int i, NameId, Pos = 0, nNtks, nPrims, Num1, Num2, Num3;
while ( Buffer[0] == '#' )
if ( !CbaManReadCbaLine(vOut, &Pos, Buffer, Buffer+1000) )
return NULL;
if ( !CbaManReadCbaNameAndNums(Buffer, &Num1, &Num2, &Num3) )
if ( !CbaManReadCbaNameAndNums(Buffer, &nNtks, &nPrims, &Num3) )
return NULL;
// start manager
assert( Num1 > 0 && Num2 >= 0 );
p = Cba_ManAlloc( Buffer, Num1 );
Vec_IntGrow( &p->vInfo, 4 * Num2 );
assert( nNtks > 0 && nPrims > 0 );
p = Cba_ManAlloc( Buffer, nNtks );
// start networks
Cba_ManForEachNtk( p, pNtk, i )
{
......@@ -143,8 +142,16 @@ Cba_Man_t * Cba_ManReadCbaInt( Vec_Str_t * vOut )
// read networks
Cba_ManForEachNtk( p, pNtk, i )
Cba_ManReadCbaNtk( vOut, &Pos, pNtk );
Cba_ManReadCbaVecInt( vOut, &Pos, &p->vInfo, 4 * Vec_IntSize(&p->vInfo) );
// read primitives
for ( i = 0; i < nPrims; i++ )
{
char * pName = Vec_StrEntryP( vOut, Pos );
Abc_NamStrFindOrAdd( p->pMods, pName, NULL );
Pos += strlen(pName) + 1;
}
assert( Pos == Vec_StrSize(vOut) );
assert( Cba_ManNtkNum(p) == nNtks );
assert( Cba_ManPrimNum(p) == nPrims );
return p;
}
Cba_Man_t * Cba_ManReadCba( char * pFileName )
......@@ -200,11 +207,11 @@ void Cba_ManWriteCbaNtk( Vec_Str_t * vOut, Cba_Ntk_t * pNtk )
void Cba_ManWriteCbaInt( Vec_Str_t * vOut, Cba_Man_t * p )
{
char Buffer[1000];
Cba_Ntk_t * pNtk; int i;
Cba_Ntk_t * pNtk; int i, nPrims = Cba_ManPrimNum(p);
sprintf( Buffer, "# Design \"%s\" written by ABC on %s\n", Cba_ManName(p), Extra_TimeStamp() );
Vec_StrPrintStr( vOut, Buffer );
// write short info
sprintf( Buffer, "%s %d %d \n", Cba_ManName(p), Cba_ManNtkNum(p), Cba_ManInfoNum(p) );
sprintf( Buffer, "%s %d %d \n", Cba_ManName(p), Cba_ManNtkNum(p), Cba_ManPrimNum(p) );
Vec_StrPrintStr( vOut, Buffer );
Cba_ManForEachNtk( p, pNtk, i )
{
......@@ -213,7 +220,12 @@ void Cba_ManWriteCbaInt( Vec_Str_t * vOut, Cba_Man_t * p )
}
Cba_ManForEachNtk( p, pNtk, i )
Cba_ManWriteCbaNtk( vOut, pNtk );
Vec_StrPushBuffer( vOut, (char *)Vec_IntArray(&p->vInfo), 16 * Cba_ManInfoNum(p) );
for ( i = 0; i < nPrims; i++ )
{
char * pName = Abc_NamStr( p->pMods, Cba_ManNtkNum(p) + i );
Vec_StrPrintStr( vOut, pName );
Vec_StrPush( vOut, '\0' );
}
}
void Cba_ManWriteCba( char * pFileName, Cba_Man_t * p )
{
......
......@@ -41,60 +41,91 @@ ABC_NAMESPACE_IMPL_START
SeeAlso []
***********************************************************************/
void Cba_ManAssignInternNamesNtk( Cba_Ntk_t * p )
int Cba_ManSetInternOne( Cba_Ntk_t * p, int iTerm, Vec_Int_t * vMap )
{
char Buffer[100];
int i, iObj, iTerm, NameId, fFound, nNameLess = 0;
int nDigits = Abc_Base10Log( Cba_NtkObjNum(p) );
// PI/PO should have NameId
if ( !Cba_ObjName(p, iTerm) )
return 1;
assert( Vec_IntEntry(vMap, Cba_ObjName(p, iTerm)) == 0 );
Vec_IntWriteEntry( vMap, Cba_ObjName(p, iTerm), iTerm+1 );
return 0;
}
int Cba_ManAssignInternOne( Cba_Ntk_t * p, int iTerm, Vec_Int_t * vMap )
{
char Buffer[16];
int i = 0, NameId, nDigits;
if ( Cba_ObjName(p, iTerm) )
return 0;
do
{
nDigits = Abc_Base10Log( Cba_NtkObjNum(p) );
if ( i == 0 )
sprintf( Buffer, "%s%0*d", "_n_", nDigits, iTerm );
else
sprintf( Buffer, "%s%0*d_%d", "_n_", nDigits, iTerm, ++i );
NameId = Abc_NamStrFindOrAdd( p->pDesign->pStrs, Buffer, NULL );
}
while ( Vec_IntEntry(vMap, NameId) );
Cba_ObjSetName( p, iTerm, NameId );
Vec_IntWriteEntry( vMap, NameId, iTerm+1 );
return 1;
}
void Cba_ManAssignInternNamesNtk( Cba_Ntk_t * p, Vec_Int_t * vMap )
{
int i, iObj, iTerm, nNameless = 0;
if ( !Cba_NtkHasNames(p) )
Cba_NtkStartNames(p);
// set all names
Cba_NtkForEachPi( p, iObj, i )
assert( Cba_ObjName(p, iObj) );
nNameless += Cba_ManSetInternOne( p, iObj, vMap );
Cba_NtkForEachPo( p, iObj, i )
assert( Cba_ObjName(p, iObj) );
// user BI/BO should have NameId
Cba_NtkForEachBoxUser( p, iObj )
nNameless += Cba_ManSetInternOne( p, iObj, vMap );
Cba_NtkForEachBox( p, iObj )
{
Cba_BoxForEachBi( p, iObj, iTerm, i )
assert( Cba_ObjName(p, iTerm) );
nNameless += Cba_ManSetInternOne( p, iTerm, vMap );
Cba_BoxForEachBo( p, iObj, iTerm, i )
assert( Cba_ObjName(p, iTerm) );
nNameless += Cba_ManSetInternOne( p, iTerm, vMap );
}
// check missing IDs
Cba_NtkForEachBoxPrim( p, iObj )
if ( nNameless )
{
int nNameless2 = 0;
// generate new names
Cba_NtkForEachPi( p, iObj, i )
nNameless2 += Cba_ManAssignInternOne( p, iObj, vMap );
Cba_NtkForEachPo( p, iObj, i )
nNameless2 += Cba_ManAssignInternOne( p, iObj, vMap );
Cba_NtkForEachBox( p, iObj )
{
Cba_BoxForEachBi( p, iObj, iTerm, i )
nNameLess += !Cba_ObjName(p, iTerm);
nNameless2 += Cba_ManAssignInternOne( p, iTerm, vMap );
Cba_BoxForEachBo( p, iObj, iTerm, i )
nNameLess += !Cba_ObjName(p, iTerm);
nNameless2 += Cba_ManAssignInternOne( p, iTerm, vMap );
}
if ( !nNameLess )
return;
// create names for prim BO
Cba_NtkForEachBoxPrim( p, iObj )
Cba_BoxForEachBo( p, iObj, iTerm, i )
{
if ( Cba_ObjName(p, iTerm) )
continue;
sprintf( Buffer, "%s%0*d", "_n_", nDigits, iTerm );
NameId = Abc_NamStrFindOrAdd( p->pDesign->pStrs, Buffer, &fFound );
//assert( !fFound );
Cba_ObjSetName( p, iTerm, NameId );
assert( nNameless == nNameless2 );
if ( nNameless )
printf( "Generated unique names for %d objects in network \"%s\".\n", nNameless, Cba_NtkName(p) );
}
// transfer names for prim BI
Cba_NtkForEachBoxPrim( p, iObj )
Cba_BoxForEachBi( p, iObj, iTerm, i )
// unmark all names
Cba_NtkForEachPi( p, iObj, i )
Vec_IntWriteEntry( vMap, Cba_ObjName(p, iObj), 0 );
Cba_NtkForEachPo( p, iObj, i )
Vec_IntWriteEntry( vMap, Cba_ObjName(p, iObj), 0 );
Cba_NtkForEachBox( p, iObj )
{
if ( Cba_ObjName(p, iTerm) )
continue;
assert( Cba_ObjName(p, Cba_ObjFanin(p, iTerm)) );
Cba_ObjSetName( p, iTerm, Cba_ObjName(p, Cba_ObjFanin(p, iTerm)) );
Cba_BoxForEachBi( p, iObj, iTerm, i )
Vec_IntWriteEntry( vMap, Cba_ObjName(p, iTerm), 0 );
Cba_BoxForEachBo( p, iObj, iTerm, i )
Vec_IntWriteEntry( vMap, Cba_ObjName(p, iTerm), 0 );
}
}
void Cba_ManAssignInternNames( Cba_Man_t * p )
{
Vec_Int_t * vMap = Vec_IntStart( Cba_ManObjNum(p) );
Cba_Ntk_t * pNtk; int i;
Cba_ManForEachNtk( p, pNtk, i )
Cba_ManAssignInternNamesNtk( pNtk );
Cba_ManAssignInternNamesNtk( pNtk, vMap );
Vec_IntFree( vMap );
}
......
......@@ -262,7 +262,7 @@ void Prs_ManBuildNtk( Cba_Ntk_t * pNew, Vec_Ptr_t * vDes, Prs_Ntk_t * pNtk, Vec_
iTerm = Cba_BoxBi( pNew, iObj, i/2 );
if ( Vec_IntEntry(vMap, NameId) == -1 )
{
iConst0 = Cba_BoxAlloc( pNew, CBA_BOX_C0, 0, 1, -1 );
iConst0 = Cba_BoxAlloc( pNew, CBA_BOX_CF, 0, 1, -1 );
Vec_IntWriteEntry( vMap, NameId, iConst0+1 );
if ( iNonDriven == -1 )
iNonDriven = NameId;
......@@ -284,7 +284,7 @@ void Prs_ManBuildNtk( Cba_Ntk_t * pNew, Vec_Ptr_t * vDes, Prs_Ntk_t * pNtk, Vec_
iTerm = Cba_BoxBi( pNew, iObj, Index );
if ( Vec_IntEntry(vMap, NameId) == -1 )
{
iConst0 = Cba_BoxAlloc( pNew, CBA_BOX_C0, 0, 1, -1 );
iConst0 = Cba_BoxAlloc( pNew, CBA_BOX_CF, 0, 1, -1 );
Vec_IntWriteEntry( vMap, NameId, iConst0+1 );
if ( iNonDriven == -1 )
iNonDriven = NameId;
......@@ -305,7 +305,7 @@ void Prs_ManBuildNtk( Cba_Ntk_t * pNew, Vec_Ptr_t * vDes, Prs_Ntk_t * pNtk, Vec_
iTerm = Cba_BoxBi( pNew, iObj, i/2 );
if ( Vec_IntEntry(vMap, NameId) == -1 )
{
iConst0 = Cba_BoxAlloc( pNew, CBA_BOX_C0, 0, 1, -1 );
iConst0 = Cba_BoxAlloc( pNew, CBA_BOX_CF, 0, 1, -1 );
Vec_IntWriteEntry( vMap, NameId, iConst0+1 );
if ( iNonDriven == -1 )
iNonDriven = NameId;
......@@ -319,7 +319,7 @@ void Prs_ManBuildNtk( Cba_Ntk_t * pNew, Vec_Ptr_t * vDes, Prs_Ntk_t * pNtk, Vec_
Prs_NtkForEachPo( pNtk, NameId, i )
if ( Vec_IntEntry(vMap, NameId) == -1 )
{
iConst0 = Cba_BoxAlloc( pNew, CBA_BOX_C0, 0, 1, -1 );
iConst0 = Cba_BoxAlloc( pNew, CBA_BOX_CF, 0, 1, -1 );
Vec_IntWriteEntry( vMap, NameId, iConst0+1 );
if ( iNonDriven == -1 )
iNonDriven = NameId;
......
......@@ -240,8 +240,8 @@ void Ptr_ManExperiment( Abc_Ntk_t * pNtk )
***********************************************************************/
static inline int Ptr_NameToType( char * pSop )
{
if ( !strcmp(pSop, "Const0T") ) return CBA_BOX_C0;
if ( !strcmp(pSop, "Const1T") ) return CBA_BOX_C1;
if ( !strcmp(pSop, "Const0T") ) return CBA_BOX_CF;
if ( !strcmp(pSop, "Const1T") ) return CBA_BOX_CT;
if ( !strcmp(pSop, "BufT") ) return CBA_BOX_BUF;
if ( !strcmp(pSop, "InvT") ) return CBA_BOX_INV;
if ( !strcmp(pSop, "AndT") ) return CBA_BOX_AND;
......
......@@ -183,7 +183,7 @@ const char * s_KnownModules[100] = {
static inline int Prs_ManIsKnownModule( Prs_Man_t * p, char * pName )
{
int i;
for ( i = CBA_BOX_C0; s_KnownModules[i]; i++ )
for ( i = CBA_BOX_CF; s_KnownModules[i]; i++ )
if ( !strncmp(pName, s_KnownModules[i], strlen(s_KnownModules[i])) )
return i;
return 0;
......
......@@ -275,6 +275,54 @@ void Cba_ManWriteVerilogBoxes( FILE * pFile, Cba_Ntk_t * p )
fprintf( pFile, "%s.%s(%s)", Cba_BoxBiNum(p, i) ? ", " : "", Mio_GateReadOutName(pGate), Cba_ObjNameStr(p, iTerm) );
fprintf( pFile, ");\n" );
}
else if ( Cba_BoxNtkId(p, i) )
{
int pRanges[8]; char pSymbs[8];
char * pName = Cba_BoxNtkName(p, i);
int nSigs = Cba_NtkNameRanges( pName, pRanges, pSymbs );
int s, k, iTerm, nInputs = 0;
fprintf( pFile, " %s ( ", pName );
for ( s = 0; s < nSigs-1; s++ )
{
fprintf( pFile, "%s.%c(", nInputs ? ", " : "", pSymbs[s] );
if ( pRanges[s] == 1 )
{
iTerm = Cba_BoxBi(p, i, nInputs++);
fprintf( pFile, "%s", Cba_ObjNameStr(p, iTerm) );
}
else
{
assert( pRanges[s] > 1 );
fprintf( pFile, "{" );
for ( k = 0; k < pRanges[s]; k++ )
{
iTerm = Cba_BoxBi(p, i, nInputs++);
fprintf( pFile, "%s%s", k ? ", " : "", Cba_ObjNameStr(p, iTerm) );
}
fprintf( pFile, "}" );
}
fprintf( pFile, ")" );
}
assert( nInputs == Cba_BoxBiNum(p, i) );
fprintf( pFile, "%s.%c(", nInputs ? ", " : "", pSymbs[nSigs-1] );
if ( pRanges[nSigs-1] == 1 )
{
iTerm = Cba_BoxBo(p, i, 0);
fprintf( pFile, "%s", Cba_ObjNameStr(p, iTerm) );
}
else
{
assert( pRanges[nSigs-1] > 1 );
fprintf( pFile, "{" );
for ( k = 0; k < pRanges[nSigs-1]; k++ )
{
iTerm = Cba_BoxBo(p, i, k);
fprintf( pFile, "%s%s", k ? ", " : "", Cba_ObjNameStr(p, iTerm) );
}
fprintf( pFile, "}" );
}
fprintf( pFile, ") );\n" );
}
else
{
Cba_ObjType_t Type = Cba_ObjType( p, i );
......
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