ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
sbd.c File Reference
#include "sbdInt.h"
#include "misc/vec/vecHsh.h"
Include dependency graph for sbd.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Sbd_CountConfigVars (Vec_Int_t *vSet, int nVars, int Degree)
 DECLARATIONS ///.
 
void Sbd_CountTopos ()
 

Function Documentation

◆ Sbd_CountConfigVars()

ABC_NAMESPACE_IMPL_START int Sbd_CountConfigVars ( Vec_Int_t * vSet,
int nVars,
int Degree )

DECLARATIONS ///.

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

FileName [sbd.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [SAT-based optimization using internal don't-cares.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file sbd.c.

47{
48 int i, k, Entry = 0, Entry2, Count = 0, Below;
49 int Prev = Vec_IntEntry( vSet, 0 );
50 Vec_IntForEachEntryStart( vSet, Entry, i, 1 )
51 {
52 assert( Degree*Prev >= Entry );
53 if ( Degree*Prev == Entry )
54 {
55 Prev = Entry;
56 continue;
57 }
58 Below = nVars;
59 Vec_IntForEachEntryStart( vSet, Entry2, k, i )
60 Below += Entry2;
61 Count += Below * (Degree*Prev - 1);
62 Prev = Entry;
63 }
64 Count += nVars * Degree*Prev;
65 return Vec_IntSum(vSet) < nVars - 1 ? 0 : Count;
66}
#define assert(ex)
Definition util_old.h:213
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
Here is the caller graph for this function:

◆ Sbd_CountTopos()

void Sbd_CountTopos ( )

Definition at line 67 of file sbd.c.

68{
69 int nInputs = 9;
70 int nNodes = 10;
71 int Degree = 3;
72 int fVerbose = 1;
73 Hsh_VecMan_t * p = Hsh_VecManStart( 10000 ); // hash table for arrays
74 Vec_Int_t * vSet = Vec_IntAlloc( 100 );
75 int i, k, e, Start, Stop;
76 printf( "Counting topologies for %d inputs and %d degree-%d nodes.\n", nInputs, nNodes, Degree );
77 Start = Hsh_VecManAdd( p, vSet );
78 for ( i = 1; i <= nNodes; i++ )
79 {
80 Stop = Hsh_VecSize( p );
81 for ( e = Start; e < Stop; e++ )
82 {
83 Vec_Int_t * vTemp = Hsh_VecReadEntry( p, e );
84 Vec_IntClear( vSet );
85 Vec_IntAppend( vSet, vTemp );
86 for ( k = 0; k < Vec_IntSize(vSet); k++ )
87 {
88 // skip if the number of entries on this level is equal to the number of fanins on the previous level
89 if ( k ? (Vec_IntEntry(vSet, k) == Degree*Vec_IntEntry(vSet, k-1)) : (Vec_IntEntry(vSet, 0) > 0) )
90 continue;
91 Vec_IntAddToEntry( vSet, k, 1 );
92 Hsh_VecManAdd( p, vSet );
93 Vec_IntAddToEntry( vSet, k, -1 );
94 }
95 Vec_IntPush( vSet, 1 );
96 Hsh_VecManAdd( p, vSet );
97 }
98 printf( "Nodes = %2d : This = %8d All = %8d\n", i, Hsh_VecSize(p) - Stop, Hsh_VecSize(p) );
99 if ( fVerbose )
100 {
101 for ( e = Stop; e < Hsh_VecSize(p); e++ )
102 {
103 Vec_Int_t * vTemp = Hsh_VecReadEntry( p, e );
104 printf( "Params = %3d. ", Sbd_CountConfigVars(vTemp, nInputs, Degree) );
105 Vec_IntPrint( vTemp );
106 }
107 printf( "\n" );
108 }
109 Start = Stop;
110 }
111 Vec_IntFree( vSet );
112 Hsh_VecManStop( p );
113}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
ABC_NAMESPACE_IMPL_START int Sbd_CountConfigVars(Vec_Int_t *vSet, int nVars, int Degree)
DECLARATIONS ///.
Definition sbd.c:46
struct Hsh_VecMan_t_ Hsh_VecMan_t
Definition vecHsh.h:85
Here is the call graph for this function: