Commit fe3d3341 by Alan Mishchenko

Experiments with hashing.

parent dd51c299
...@@ -1083,6 +1083,10 @@ SOURCE=.\src\base\acb\acbPar.h ...@@ -1083,6 +1083,10 @@ SOURCE=.\src\base\acb\acbPar.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\base\acb\acbSets.c
# End Source File
# Begin Source File
SOURCE=.\src\base\acb\acbUtil.c SOURCE=.\src\base\acb\acbUtil.c
# End Source File # End Source File
# End Group # End Group
...@@ -4551,6 +4555,10 @@ SOURCE=.\src\aig\gia\giaCTas.c ...@@ -4551,6 +4555,10 @@ SOURCE=.\src\aig\gia\giaCTas.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\aig\gia\giaCut.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaDfs.c SOURCE=.\src\aig\gia\giaDfs.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -12385,6 +12385,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -12385,6 +12385,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// Cba_PrsReadBlifTest(); // Cba_PrsReadBlifTest();
} }
// Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) ); // Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) );
Acb_DataReadTest();
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" ); Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
/**CFile****************************************************************
FileName [acbSets.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Hierarchical word-level netlist.]
Synopsis [Reading data from file.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - July 21, 2015.]
Revision [$Id: acbSets.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 []
***********************************************************************/
void Acb_DataReadTest()
{
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
...@@ -455,7 +455,7 @@ void Acb_NtkSaveSupport( Acb_Ntk_t * p, int iObj ) ...@@ -455,7 +455,7 @@ void Acb_NtkSaveSupport( Acb_Ntk_t * p, int iObj )
} }
void Acb_NtkUpdateNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp ) void Acb_NtkUpdateNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp )
{ {
int Level = Acb_ObjLevelD(p, Pivot); //int Level = Acb_ObjLevelD(p, Pivot);
Acb_NtkSaveSupport( p, Pivot ); Acb_NtkSaveSupport( p, Pivot );
//Acb_NtkPrintNode( p, Pivot ); //Acb_NtkPrintNode( p, Pivot );
Acb_NtkResetNode( p, Pivot, uTruth, vSupp ); Acb_NtkResetNode( p, Pivot, uTruth, vSupp );
......
...@@ -3,4 +3,5 @@ SRC += src/base/acb/acbAbc.c \ ...@@ -3,4 +3,5 @@ SRC += src/base/acb/acbAbc.c \
src/base/acb/acbCom.c \ src/base/acb/acbCom.c \
src/base/acb/acbFunc.c \ src/base/acb/acbFunc.c \
src/base/acb/acbMfs.c \ src/base/acb/acbMfs.c \
src/base/acb/acbSets.c \
src/base/acb/acbUtil.c src/base/acb/acbUtil.c
...@@ -140,7 +140,24 @@ static inline int Hsh_IntManEntryNum( Hsh_IntMan_t * p ) ...@@ -140,7 +140,24 @@ static inline int Hsh_IntManEntryNum( Hsh_IntMan_t * p )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
static inline int Hsh_IntManHash( unsigned * pData, int nSize, int nTableSize ) // https://en.wikipedia.org/wiki/Jenkins_hash_function
static inline int Hsh_IntManHash( unsigned * pData, int nSize, int nTableSize )
{
int i = 0; unsigned hash = 0;
unsigned char * pDataC = (unsigned char *)pData;
nSize <<= 2;
while ( i != nSize )
{
hash += pDataC[i++];
hash += hash << 10;
hash ^= hash >> 6;
}
hash += hash << 3;
hash ^= hash >> 11;
hash += hash << 15;
return (int)(hash % nTableSize);
}
static inline int Hsh_IntManHash2( unsigned * pData, int nSize, int nTableSize )
{ {
static int s_Primes[7] = { 4177, 5147, 5647, 6343, 7103, 7873, 8147 }; static int s_Primes[7] = { 4177, 5147, 5647, 6343, 7103, 7873, 8147 };
unsigned char * pDataC = (unsigned char *)pData; unsigned char * pDataC = (unsigned char *)pData;
......
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