#include "abc.h"
Go to the source code of this file.
Functions | |
static void | Abc_NtkChangeCiOrder (Abc_Ntk_t *pNtk, Vec_Ptr_t *vSupp, int fReverse) |
void | Abc_NtkFindCiOrder (Abc_Ntk_t *pNtk, int fReverse, int fVerbose) |
void | Abc_NtkImplementCiOrder (Abc_Ntk_t *pNtk, char *pFileName, int fReverse, int fVerbose) |
CFile****************************************************************
FileName [abcOrder.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Network and node package.]
Synopsis [Exploring static BDD variable orders.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
] DECLARATIONS ///
Function*************************************************************
Synopsis [Changes the order of primary inputs.]
Description []
SideEffects []
SeeAlso []
Definition at line 105 of file abcOrder.c.
00106 { 00107 Abc_Obj_t * pObj; 00108 int i; 00109 assert( Vec_PtrSize(vSupp) == Abc_NtkCiNum(pNtk) ); 00110 // order CIs using the array 00111 if ( fReverse ) 00112 Vec_PtrForEachEntry( vSupp, pObj, i ) 00113 Vec_PtrWriteEntry( pNtk->vCis, Vec_PtrSize(vSupp)-1-i, pObj ); 00114 else 00115 Vec_PtrForEachEntry( vSupp, pObj, i ) 00116 Vec_PtrWriteEntry( pNtk->vCis, i, pObj ); 00117 // order PIs accordingly 00118 Vec_PtrClear( pNtk->vPis ); 00119 Abc_NtkForEachCi( pNtk, pObj, i ) 00120 if ( Abc_ObjIsPi(pObj) ) 00121 Vec_PtrPush( pNtk->vPis, pObj ); 00122 // Abc_NtkForEachCi( pNtk, pObj, i ) 00123 // printf( "%s ", Abc_ObjName(pObj) ); 00124 // printf( "\n" ); 00125 }
void Abc_NtkFindCiOrder | ( | Abc_Ntk_t * | pNtk, | |
int | fReverse, | |||
int | fVerbose | |||
) |
FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Changes the order of primary inputs.]
Description []
SideEffects []
SeeAlso []
Definition at line 44 of file abcOrder.c.
00045 { 00046 Vec_Ptr_t * vSupp; 00047 vSupp = Abc_NtkSupport( pNtk ); 00048 Abc_NtkChangeCiOrder( pNtk, vSupp, fReverse ); 00049 Vec_PtrFree( vSupp ); 00050 }
void Abc_NtkImplementCiOrder | ( | Abc_Ntk_t * | pNtk, | |
char * | pFileName, | |||
int | fReverse, | |||
int | fVerbose | |||
) |
Function*************************************************************
Synopsis [Implements the given variable order.]
Description []
SideEffects []
SeeAlso []
Definition at line 63 of file abcOrder.c.
00064 { 00065 char Buffer[1000]; 00066 FILE * pFile; 00067 Vec_Ptr_t * vSupp; 00068 Abc_Obj_t * pObj; 00069 pFile = fopen( pFileName, "r" ); 00070 vSupp = Vec_PtrAlloc( Abc_NtkCiNum(pNtk) ); 00071 while ( fscanf( pFile, "%s", Buffer ) == 1 ) 00072 { 00073 pObj = Abc_NtkFindCi( pNtk, Buffer ); 00074 if ( pObj == NULL || !Abc_ObjIsCi(pObj) ) 00075 { 00076 printf( "Name \"%s\" is not a PI name. Cannot use this order.\n", Buffer ); 00077 Vec_PtrFree( vSupp ); 00078 fclose( pFile ); 00079 return; 00080 } 00081 Vec_PtrPush( vSupp, pObj ); 00082 } 00083 fclose( pFile ); 00084 if ( Vec_PtrSize(vSupp) != Abc_NtkCiNum(pNtk) ) 00085 { 00086 printf( "The number of names in the order (%d) is not the same as the number of PIs (%d).\n", Vec_PtrSize(vSupp), Abc_NtkCiNum(pNtk) ); 00087 Vec_PtrFree( vSupp ); 00088 return; 00089 } 00090 Abc_NtkChangeCiOrder( pNtk, vSupp, fReverse ); 00091 Vec_PtrFree( vSupp ); 00092 }