ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cmdLoad.c File Reference
#include "base/abc/abc.h"
#include "base/main/mainInt.h"
#include "cmd.h"
#include "cmdInt.h"
#include "misc/util/utilSignal.h"
Include dependency graph for cmdLoad.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int CmdCommandLoad (Abc_Frame_t *pAbc, int argc, char **argv)
 DECLARATIONS ///.
 
Vec_Ptr_tCmdCollectFileNames ()
 
void Load_Init (Abc_Frame_t *pAbc)
 
void Load_End (Abc_Frame_t *pAbc)
 

Function Documentation

◆ CmdCollectFileNames()

Vec_Ptr_t * CmdCollectFileNames ( )

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

Synopsis []

Description []

SideEffects []

SeeAlso [] Function*************************************************************

Synopsis [Collect file names ending with .exe]

Description []

SideEffects []

SeeAlso []

Definition at line 145 of file cmdLoad.c.

146{
147 return NULL;
148}
Here is the caller graph for this function:

◆ CmdCommandLoad()

ABC_NAMESPACE_IMPL_START int CmdCommandLoad ( Abc_Frame_t * pAbc,
int argc,
char ** argv )

DECLARATIONS ///.

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

FileName [cmdApi.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Command processing package.]

Synopsis [External procedures of the command package.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 48 of file cmdLoad.c.

49{
50 Vec_Str_t * vCommand;
51 FILE * pFile;
52 int i;
53 vCommand = Vec_StrAlloc( 100 );
54 Vec_StrAppend( vCommand, "abccmd_" );
55 Vec_StrAppend( vCommand, argv[0] );
56 Vec_StrAppend( vCommand, ".exe" );
57 Vec_StrPush( vCommand, 0 );
58 // check if there is the binary
59 if ( (pFile = fopen( Vec_StrArray(vCommand), "r" )) == NULL )
60 {
61 Abc_Print( -1, "Cannot run the binary \"%s\".\n\n", Vec_StrArray(vCommand) );
62 Vec_StrFree( vCommand );
63 return 1;
64 }
65 fclose( pFile );
66 Vec_StrPop( vCommand );
67 // add other arguments
68 for ( i = 1; i < argc; i++ )
69 {
70 Vec_StrAppend( vCommand, " " );
71 Vec_StrAppend( vCommand, argv[i] );
72 }
73 Vec_StrPush( vCommand, 0 );
74 // run the command line
75 if ( Util_SignalSystem( Vec_StrArray(vCommand) ) )
76 {
77 Abc_Print( -1, "The following command has returned non-zero exit status:\n" );
78 Abc_Print( -1, "\"%s\"\n", Vec_StrArray(vCommand) );
79 Vec_StrFree( vCommand );
80 return 1;
81 }
82 Vec_StrFree( vCommand );
83 return 0;
84}
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
ABC_NAMESPACE_IMPL_START int Util_SignalSystem(const char *cmd)
DECLARATIONS ///.
Definition utilSignal.c:44
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Load_End()

void Load_End ( Abc_Frame_t * pAbc)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 199 of file cmdLoad.c.

200{
201}
Here is the caller graph for this function:

◆ Load_Init()

void Load_Init ( Abc_Frame_t * pAbc)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 164 of file cmdLoad.c.

165{
166 Vec_Ptr_t * vFileNames;
167 char * pName, * pStop;
168 int i;
169 vFileNames = CmdCollectFileNames();
170 if ( vFileNames == NULL )
171 return;
172 Vec_PtrForEachEntry( char *, vFileNames, pName, i )
173 {
174 if ( strncmp( pName, "abccmd_", 7 ) )
175 continue;
176 // get the command name
177// pName[6] = '!';
178 pStop = strstr( pName + 7, "." );
179 if ( pStop )
180 *pStop = 0;
181 // add the command
182 Cmd_CommandAdd( pAbc, "ZZ", pName+7, CmdCommandLoad, 0 );
183// printf( "Loaded command \"%s\"\n", pName+7 );
184 }
185 Vec_PtrFreeFree( vFileNames );
186}
Vec_Ptr_t * CmdCollectFileNames()
Definition cmdLoad.c:145
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
Definition cmdApi.c:63
int CmdCommandLoad(Abc_Frame_t *pAbc, int argc, char **argv)
DECLARATIONS ///.
Definition cmdLoad.c:48
int strncmp()
char * strstr()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function: