Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
95207366
Commit
95207366
authored
Mar 30, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added several new APIs to GIA and for file management.
parent
9eb1be8e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
2 deletions
+49
-2
src/aig/gia/gia.h
+9
-0
src/aig/gia/giaHash.c
+4
-0
src/misc/extra/extra.h
+2
-0
src/misc/extra/extraUtilFile.c
+34
-2
No files found.
src/aig/gia/gia.h
View file @
95207366
...
...
@@ -472,12 +472,20 @@ static inline int Gia_ManAppendCo( Gia_Man_t * p, int iLit0 )
Gia_ObjAddFanout
(
p
,
Gia_ObjFanin0
(
pObj
),
pObj
);
return
Gia_ObjId
(
p
,
pObj
)
<<
1
;
}
static
inline
int
Gia_ManAppendOr
(
Gia_Man_t
*
p
,
int
iLit0
,
int
iLit1
)
{
return
Abc_LitNot
(
Gia_ManAppendAnd
(
p
,
Abc_LitNot
(
iLit0
),
Abc_LitNot
(
iLit1
)
));
}
static
inline
int
Gia_ManAppendMux
(
Gia_Man_t
*
p
,
int
iCtrl
,
int
iData1
,
int
iData0
)
{
int
iTemp0
=
Gia_ManAppendAnd
(
p
,
Abc_LitNot
(
iCtrl
),
iData0
);
int
iTemp1
=
Gia_ManAppendAnd
(
p
,
iCtrl
,
iData1
);
return
Abc_LitNotCond
(
Gia_ManAppendAnd
(
p
,
Abc_LitNot
(
iTemp0
),
Abc_LitNot
(
iTemp1
)
),
1
);
}
static
inline
int
Gia_ManAppendXor
(
Gia_Man_t
*
p
,
int
iLit0
,
int
iLit1
)
{
return
Gia_ManAppendMux
(
p
,
iLit0
,
Abc_LitNot
(
iLit1
),
iLit1
);
}
#define GIA_ZER 1
#define GIA_ONE 2
...
...
@@ -728,6 +736,7 @@ extern void Gia_ManHashAlloc( Gia_Man_t * p );
extern
void
Gia_ManHashStart
(
Gia_Man_t
*
p
);
extern
void
Gia_ManHashStop
(
Gia_Man_t
*
p
);
extern
int
Gia_ManHashAnd
(
Gia_Man_t
*
p
,
int
iLit0
,
int
iLit1
);
extern
int
Gia_ManHashOr
(
Gia_Man_t
*
p
,
int
iLit0
,
int
iLit1
);
extern
int
Gia_ManHashXor
(
Gia_Man_t
*
p
,
int
iLit0
,
int
iLit1
);
extern
int
Gia_ManHashMux
(
Gia_Man_t
*
p
,
int
iCtrl
,
int
iData1
,
int
iData0
);
extern
int
Gia_ManHashAndTry
(
Gia_Man_t
*
p
,
int
iLit0
,
int
iLit1
);
...
...
src/aig/gia/giaHash.c
View file @
95207366
...
...
@@ -511,6 +511,10 @@ int Gia_ManHashAnd( Gia_Man_t * p, int iLit0, int iLit1 )
}
}
}
int
Gia_ManHashOr
(
Gia_Man_t
*
p
,
int
iLit0
,
int
iLit1
)
{
return
Abc_LitNot
(
Gia_ManHashAnd
(
p
,
Abc_LitNot
(
iLit0
),
Abc_LitNot
(
iLit1
)
));
}
/**Function*************************************************************
...
...
src/misc/extra/extra.h
View file @
95207366
...
...
@@ -107,7 +107,9 @@ extern char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix );
extern
int
Extra_FileCheck
(
char
*
pFileName
);
extern
int
Extra_FileSize
(
char
*
pFileName
);
extern
char
*
Extra_FileRead
(
FILE
*
pFile
);
extern
char
*
Extra_FileRead2
(
FILE
*
pFile
,
FILE
*
pFile2
);
extern
char
*
Extra_FileReadContents
(
char
*
pFileName
);
extern
char
*
Extra_FileReadContents2
(
char
*
pFileName
,
char
*
pFileName2
);
extern
int
Extra_FileIsType
(
char
*
pFileName
,
char
*
pS1
,
char
*
pS2
,
char
*
pS3
);
extern
char
*
Extra_TimeStamp
();
extern
char
*
Extra_StringAppend
(
char
*
pStrGiven
,
char
*
pStrAdd
);
...
...
src/misc/extra/extraUtilFile.c
View file @
95207366
...
...
@@ -276,6 +276,28 @@ char * Extra_FileRead( FILE * pFile )
pBuffer
[
nFileSize
+
1
]
=
'\0'
;
return
pBuffer
;
}
char
*
Extra_FileRead2
(
FILE
*
pFile
,
FILE
*
pFile2
)
{
char
*
pBuffer
;
int
nSize
,
nSize2
;
int
RetValue
;
// get the file size, in bytes
fseek
(
pFile
,
0
,
SEEK_END
);
nSize
=
ftell
(
pFile
);
rewind
(
pFile
);
// get the file size, in bytes
fseek
(
pFile2
,
0
,
SEEK_END
);
nSize2
=
ftell
(
pFile2
);
rewind
(
pFile2
);
// load the contents of the file into memory
pBuffer
=
ABC_ALLOC
(
char
,
nSize
+
nSize2
+
3
);
RetValue
=
fread
(
pBuffer
,
nSize
,
1
,
pFile
);
RetValue
=
fread
(
pBuffer
+
nSize
,
nSize2
,
1
,
pFile2
);
// terminate the string with '\0'
pBuffer
[
nSize
+
nSize2
+
0
]
=
'\n'
;
pBuffer
[
nSize
+
nSize2
+
1
]
=
'\0'
;
return
pBuffer
;
}
/**Function*************************************************************
...
...
@@ -294,8 +316,18 @@ char * Extra_FileReadContents( char * pFileName )
char
*
pBuffer
;
pFile
=
fopen
(
pFileName
,
"rb"
);
pBuffer
=
pFile
?
Extra_FileRead
(
pFile
)
:
NULL
;
if
(
pFile
)
fclose
(
pFile
);
if
(
pFile
)
fclose
(
pFile
);
return
pBuffer
;
}
char
*
Extra_FileReadContents2
(
char
*
pFileName
,
char
*
pFileName2
)
{
FILE
*
pFile
,
*
pFile2
;
char
*
pBuffer
;
pFile
=
fopen
(
pFileName
,
"rb"
);
pFile2
=
fopen
(
pFileName2
,
"rb"
);
pBuffer
=
(
pFile
&&
pFile2
)
?
Extra_FileRead2
(
pFile
,
pFile2
)
:
NULL
;
if
(
pFile
)
fclose
(
pFile
);
if
(
pFile2
)
fclose
(
pFile2
);
return
pBuffer
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment