abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rwrTemp.c File Reference
#include "rwr.h"

Go to the source code of this file.

Functions

int Rwr_TempCompare (int *pNum1, int *pNum2)
 FUNCTION DEFINITIONS ///. More...
 
void Rwr_Temp ()
 

Variables

static ABC_NAMESPACE_IMPL_START int pTruths [13719]
 DECLARATIONS ///. More...
 
static int pFreqs [13719]
 
static int pPerm [13719]
 

Function Documentation

void Rwr_Temp ( )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 71 of file rwrTemp.c.

72 {
73  char Buffer[32];
74  int nFuncs = 13719;
75  int nEntries = 100;
76  unsigned uTruth;
77  int i, k;
78  FILE * pFile;
79 
80  pFile = fopen( "nnclass_stats5.txt", "r" );
81  for ( i = 0; i < 13719; i++ )
82  {
83  int RetValue = fscanf( pFile, "%s%d", Buffer, &pFreqs[i] );
84  Extra_ReadHexadecimal( &uTruth, Buffer+2, 5 );
85  pTruths[i] = uTruth;
86  }
87  fclose( pFile );
88 
89  for ( i = 0; i < 13719; i++ )
90  pPerm[i] = i;
91 
92  qsort( (void *)pPerm, 13719, sizeof(int),
93  (int (*)(const void *, const void *)) Rwr_TempCompare );
94 
95 
96  pFile = fopen( "5npn_100.blif", "w" );
97  fprintf( pFile, "# Most frequent NPN classes of 5 vars.\n" );
98  fprintf( pFile, ".model 5npn\n" );
99  fprintf( pFile, ".inputs a b c d e\n" );
100  fprintf( pFile, ".outputs" );
101  for ( i = 0; i < nEntries; i++ )
102  fprintf( pFile, " %02d", i );
103  fprintf( pFile, "\n" );
104 
105  for ( i = 0; i < nEntries; i++ )
106  {
107  fprintf( pFile, ".names a b c d e %02d\n", i );
108  uTruth = pTruths[pPerm[i]];
109  for ( k = 0; k < 32; k++ )
110  if ( uTruth & (1 << k) )
111  {
112  Extra_PrintBinary( pFile, (unsigned *)&k, 5 );
113  fprintf( pFile, " 1\n" );
114  }
115  }
116  fprintf( pFile, ".end\n" );
117  fclose( pFile );
118 }
static ABC_NAMESPACE_IMPL_START int pTruths[13719]
DECLARATIONS ///.
Definition: rwrTemp.c:30
static int pFreqs[13719]
Definition: rwrTemp.c:31
int Extra_ReadHexadecimal(unsigned Sign[], char *pString, int nVars)
int Rwr_TempCompare(int *pNum1, int *pNum2)
FUNCTION DEFINITIONS ///.
Definition: rwrTemp.c:49
static int pPerm[13719]
Definition: rwrTemp.c:32
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
int Rwr_TempCompare ( int *  pNum1,
int *  pNum2 
)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file rwrTemp.c.

50 {
51  int Freq1 = pFreqs[*pNum1];
52  int Freq2 = pFreqs[*pNum2];
53  if ( Freq1 < Freq2 )
54  return 1;
55  if ( Freq1 > Freq2 )
56  return -1;
57  return 0;
58 }
static int pFreqs[13719]
Definition: rwrTemp.c:31

Variable Documentation

int pFreqs[13719]
static

Definition at line 31 of file rwrTemp.c.

int pPerm[13719]
static

Definition at line 32 of file rwrTemp.c.

ABC_NAMESPACE_IMPL_START int pTruths[13719]
static

DECLARATIONS ///.

CFile****************************************************************

FileName [rwrCut.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [DAG-aware AIG rewriting package.]

Synopsis [Cut computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
rwrCut.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Definition at line 30 of file rwrTemp.c.