summaryrefslogtreecommitdiffstats
path: root/src/misc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2022-07-04 16:02:44 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2022-07-04 16:02:44 +0200
commit163af36fee3bdc3fe0e8ce629cba333cb2cff199 (patch)
treec4004a295813151478fe8b36a41725457cc6ea17 /src/misc
parent18634305282c81b0f4a08de4ebca6ccc95b11748 (diff)
parentc23cd0a7c5f4264b3209f127885b8d5432f2fd5a (diff)
downloadabc-163af36fee3bdc3fe0e8ce629cba333cb2cff199.tar.gz
abc-163af36fee3bdc3fe0e8ce629cba333cb2cff199.tar.bz2
abc-163af36fee3bdc3fe0e8ce629cba333cb2cff199.zip
Merge remote-tracking branch 'upstream/master' into yosys-experimental
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/extra/extraUtilMisc.c2
-rw-r--r--src/misc/util/utilTruth.h18
-rw-r--r--src/misc/vec/vecInt.h2
-rw-r--r--src/misc/vec/vecWrd.h8
4 files changed, 29 insertions, 1 deletions
diff --git a/src/misc/extra/extraUtilMisc.c b/src/misc/extra/extraUtilMisc.c
index c38369cd..e081e9c6 100644
--- a/src/misc/extra/extraUtilMisc.c
+++ b/src/misc/extra/extraUtilMisc.c
@@ -1290,7 +1290,7 @@ void Extra_TruthExpand( int nVars, int nWords, unsigned * puTruth, unsigned uPha
{ 0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF,0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF },
{ 0x00000000,0x00000000,0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF }
};
- static char Cases[256] = {
+ static signed char Cases[256] = {
0, // 00000000
0, // 00000001
1, // 00000010
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h
index d9efa55f..bc8ac3f0 100644
--- a/src/misc/util/utilTruth.h
+++ b/src/misc/util/utilTruth.h
@@ -1471,6 +1471,24 @@ static inline void Abc_TtPrintBinary( word * pTruth, int nVars )
printf( "%d", Abc_InfoHasBit( (unsigned *)pThis, k ) );
printf( "\n" );
}
+static inline void Abc_TtPrintBinary1( FILE * pFile, word * pTruth, int nVars )
+{
+ word * pThis, * pLimit = pTruth + Abc_TtWordNum(nVars);
+ int k, Limit = Abc_MinInt( 64, (1 << nVars) );
+ assert( nVars >= 2 );
+ for ( pThis = pTruth; pThis < pLimit; pThis++ )
+ for ( k = 0; k < Limit; k++ )
+ fprintf( pFile, "%d", Abc_InfoHasBit( (unsigned *)pThis, k ) );
+}
+static inline void Abc_TtPrintBinary2( FILE * pFile, word * pTruth, int nVars )
+{
+ word * pThis;
+ int k, Limit = Abc_MinInt( 64, (1 << nVars) );
+ assert( nVars >= 2 );
+ for ( pThis = pTruth + Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- )
+ for ( k = Limit-1; k >= 0; k-- )
+ fprintf( pFile, "%d", Abc_InfoHasBit( (unsigned *)pThis, k ) );
+}
/**Function*************************************************************
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index c15369d2..e4ea6cfe 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -61,6 +61,8 @@ struct Vec_Int_t_
for ( i = Start; (i < Stop) && (((Entry) = Vec_IntEntry(vVec, i)), 1); i++ )
#define Vec_IntForEachEntryReverse( vVec, pEntry, i ) \
for ( i = Vec_IntSize(vVec) - 1; (i >= 0) && (((pEntry) = Vec_IntEntry(vVec, i)), 1); i-- )
+#define Vec_IntForEachEntryReverseStart( vVec, pEntry, i, Start ) \
+ for ( i = Start; (i >= 0) && (((pEntry) = Vec_IntEntry(vVec, i)), 1); i-- )
#define Vec_IntForEachEntryTwo( vVec1, vVec2, Entry1, Entry2, i ) \
for ( i = 0; (i < Vec_IntSize(vVec1)) && (((Entry1) = Vec_IntEntry(vVec1, i)), 1) && (((Entry2) = Vec_IntEntry(vVec2, i)), 1); i++ )
#define Vec_IntForEachEntryTwoStart( vVec1, vVec2, Entry1, Entry2, i, Start ) \
diff --git a/src/misc/vec/vecWrd.h b/src/misc/vec/vecWrd.h
index 8275702a..fdbb1866 100644
--- a/src/misc/vec/vecWrd.h
+++ b/src/misc/vec/vecWrd.h
@@ -195,6 +195,14 @@ static inline Vec_Wrd_t * Vec_WrdStartTruthTables( int nVars )
}
return p;
}
+static inline int Vec_WrdShiftOne( Vec_Wrd_t * p, int nWords )
+{
+ int i, nObjs = p->nSize/nWords;
+ assert( nObjs * nWords == p->nSize );
+ for ( i = 0; i < nObjs; i++ )
+ p->pArray[i*nWords] <<= 1;
+ return nObjs;
+}
/**Function*************************************************************