mirror of https://github.com/YosysHQ/abc.git
Experiments with hashing.
This commit is contained in:
parent
dd51c29934
commit
fe3d334151
|
|
@ -1083,6 +1083,10 @@ SOURCE=.\src\base\acb\acbPar.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\acb\acbSets.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\acb\acbUtil.c
|
||||
# End Source File
|
||||
# End Group
|
||||
|
|
@ -4551,6 +4555,10 @@ SOURCE=.\src\aig\gia\giaCTas.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\aig\gia\giaCut.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\aig\gia\giaDfs.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
|||
|
|
@ -12385,6 +12385,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
// Cba_PrsReadBlifTest();
|
||||
}
|
||||
// Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) );
|
||||
Acb_DataReadTest();
|
||||
return 0;
|
||||
usage:
|
||||
Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
/**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 )
|
|||
}
|
||||
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_NtkPrintNode( p, Pivot );
|
||||
Acb_NtkResetNode( p, Pivot, uTruth, vSupp );
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@ SRC += src/base/acb/acbAbc.c \
|
|||
src/base/acb/acbCom.c \
|
||||
src/base/acb/acbFunc.c \
|
||||
src/base/acb/acbMfs.c \
|
||||
src/base/acb/acbSets.c \
|
||||
src/base/acb/acbUtil.c
|
||||
|
|
|
|||
|
|
@ -140,7 +140,24 @@ static inline int Hsh_IntManEntryNum( Hsh_IntMan_t * p )
|
|||
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 };
|
||||
unsigned char * pDataC = (unsigned char *)pData;
|
||||
|
|
|
|||
Loading…
Reference in New Issue