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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START char * Llb_ManGetDummyName (char *pPrefix, int Num, int nDigits)
 DECLARATIONS ///. More...
 
void Llb_ManDumpReached (DdManager *ddG, DdNode *bReached, char *pModel, char *pFileName)
 

Function Documentation

void Llb_ManDumpReached ( DdManager ddG,
DdNode bReached,
char *  pModel,
char *  pFileName 
)

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

Synopsis [Writes reached state BDD into a BLIF file.]

Description []

SideEffects []

SeeAlso []

Definition at line 63 of file llb2Dump.c.

64 {
65  FILE * pFile;
66  Vec_Ptr_t * vNamesIn, * vNamesOut;
67  char * pName;
68  int i, nDigits;
69  // reorder the BDD
71 
72  // create input names
73  nDigits = Abc_Base10Log( Cudd_ReadSize(ddG) );
74  vNamesIn = Vec_PtrAlloc( Cudd_ReadSize(ddG) );
75  for ( i = 0; i < Cudd_ReadSize(ddG); i++ )
76  {
77  pName = Llb_ManGetDummyName( "ff", i, nDigits );
78  Vec_PtrPush( vNamesIn, Extra_UtilStrsav(pName) );
79  }
80  // create output names
81  vNamesOut = Vec_PtrAlloc( 1 );
82  Vec_PtrPush( vNamesOut, Extra_UtilStrsav("Reached") );
83 
84  // write the file
85  pFile = fopen( pFileName, "wb" );
86  Cudd_DumpBlif( ddG, 1, &bReached, (char **)Vec_PtrArray(vNamesIn), (char **)Vec_PtrArray(vNamesOut), pModel, pFile, 0 );
87  fclose( pFile );
88 
89  // cleanup
90  Vec_PtrForEachEntry( char *, vNamesIn, pName, i )
91  ABC_FREE( pName );
92  Vec_PtrForEachEntry( char *, vNamesOut, pName, i )
93  ABC_FREE( pName );
94  Vec_PtrFree( vNamesIn );
95  Vec_PtrFree( vNamesOut );
96 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_NAMESPACE_IMPL_START char * Llb_ManGetDummyName(char *pPrefix, int Num, int nDigits)
DECLARATIONS ///.
Definition: llb2Dump.c:45
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
int Cudd_ReadSize(DdManager *dd)
Definition: cuddAPI.c:1441
char * Extra_UtilStrsav(const char *s)
static int Abc_Base10Log(unsigned n)
Definition: abc_global.h:252
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
int Cudd_DumpBlif(DdManager *dd, int n, DdNode **f, char **inames, char **onames, char *mname, FILE *fp, int mv)
Definition: cuddExport.c:136
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Cudd_ReduceHeap(DdManager *table, Cudd_ReorderingType heuristic, int minsize)
Definition: cuddReorder.c:176
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void ** Vec_PtrArray(Vec_Ptr_t *p)
Definition: vecPtr.h:279
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
ABC_NAMESPACE_IMPL_START char* Llb_ManGetDummyName ( char *  pPrefix,
int  Num,
int  nDigits 
)

DECLARATIONS ///.

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

FileName [llb2Dump.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [BDD based reachability.]

Synopsis [Dumps the BDD of reached states into a file.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Returns a dummy name.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file llb2Dump.c.

46 {
47  static char Buffer[2000];
48  sprintf( Buffer, "%s%0*d", pPrefix, nDigits, Num );
49  return Buffer;
50 }
char * sprintf()