src/opt/rwr/rwrTemp.c File Reference

#include "rwr.h"
Include dependency graph for rwrTemp.c:

Go to the source code of this file.

Functions

int Rwr_TempCompare (int *pNum1, int *pNum2)
void Rwr_Temp ()

Variables

static int pTruths [13719]
static int pFreqs [13719]
static int pPerm [13719]

Function Documentation

void Rwr_Temp (  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 68 of file rwrTemp.c.

00069 {
00070     char Buffer[32];
00071     int nFuncs = 13719;
00072     int nEntries = 100;
00073     unsigned uTruth;
00074     int i, k;
00075     FILE * pFile;
00076 
00077     pFile = fopen( "nnclass_stats5.txt", "r" );
00078     for ( i = 0; i < 13719; i++ )
00079     {
00080         fscanf( pFile, "%s%d", Buffer, &pFreqs[i] );
00081         Extra_ReadHexadecimal( &uTruth, Buffer+2, 5 );
00082         pTruths[i] = uTruth;
00083     }
00084     fclose( pFile );
00085 
00086     for ( i = 0; i < 13719; i++ )
00087         pPerm[i] = i;
00088 
00089     qsort( (void *)pPerm, 13719, sizeof(int), 
00090             (int (*)(const void *, const void *)) Rwr_TempCompare );
00091 
00092 
00093     pFile = fopen( "5npn_100.blif", "w" );
00094     fprintf( pFile, "# Most frequent NPN classes of 5 vars.\n" );
00095     fprintf( pFile, ".model 5npn\n" );
00096     fprintf( pFile, ".inputs a b c d e\n" );
00097     fprintf( pFile, ".outputs" );
00098     for ( i = 0; i < nEntries; i++ )
00099         fprintf( pFile, " %02d", i );
00100     fprintf( pFile, "\n" );
00101 
00102     for ( i = 0; i < nEntries; i++ )
00103     {
00104         fprintf( pFile, ".names a b c d e %02d\n", i );
00105         uTruth = pTruths[pPerm[i]];
00106         for ( k = 0; k < 32; k++ )
00107             if ( uTruth & (1 << k) )
00108             {
00109                 Extra_PrintBinary( pFile, &k, 5 );
00110                 fprintf( pFile, " 1\n" );
00111             }
00112     }
00113     fprintf( pFile, ".end\n" );
00114     fclose( pFile );
00115 }

int Rwr_TempCompare ( int *  pNum1,
int *  pNum2 
)

FUNCTION DEFINITIONS ///Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file rwrTemp.c.

00047 {
00048     int Freq1 = pFreqs[*pNum1];
00049     int Freq2 = pFreqs[*pNum2];
00050     if ( Freq1 < Freq2 )
00051         return 1;
00052     if ( Freq1 > Freq2 )
00053         return -1;
00054     return 0; 
00055 }


Variable Documentation

int pFreqs[13719] [static]

Definition at line 28 of file rwrTemp.c.

int pPerm[13719] [static]

Definition at line 29 of file rwrTemp.c.

int pTruths[13719] [static]

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

] DECLARATIONS ///

Definition at line 27 of file rwrTemp.c.


Generated on Tue Jan 5 12:19:34 2010 for abc70930 by  doxygen 1.6.1