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
8feac565
Commit
8feac565
authored
Nov 24, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with hierarchy representation.
parent
3368b2dd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
1 deletions
+91
-1
src/base/abc/abcHieGia.c
+91
-1
No files found.
src/base/abc/abcHieGia.c
View file @
8feac565
...
...
@@ -381,6 +381,17 @@ char * Ptr_TypeToName( Ptr_ObjType_t Type )
assert
(
0
);
return
"???"
;
}
char
*
Ptr_TypeToSop
(
Ptr_ObjType_t
Type
)
{
if
(
Type
==
PTR_OBJ_BUF
)
return
"1 1
\n
"
;
if
(
Type
==
PTR_OBJ_INV
)
return
"0 1
\n
"
;
if
(
Type
==
PTR_OBJ_AND
)
return
"11 1
\n
"
;
if
(
Type
==
PTR_OBJ_OR
)
return
"00 0
\n
"
;
if
(
Type
==
PTR_OBJ_XOR
)
return
"01 1
\n
10 1
\n
"
;
if
(
Type
==
PTR_OBJ_XNOR
)
return
"00 1
\n
11 1
\n
"
;
assert
(
0
);
return
"???"
;
}
Ptr_ObjType_t
Ptr_SopToType
(
char
*
pSop
)
{
if
(
!
strcmp
(
pSop
,
"1 1
\n
"
)
)
return
PTR_OBJ_BUF
;
...
...
@@ -551,6 +562,85 @@ Vec_Ptr_t * Ptr_ManDumpDes( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
void
Ptr_ManDumpNodeToBlif
(
FILE
*
pFile
,
Vec_Ptr_t
*
vNode
)
{
char
*
pName
;
int
i
;
fprintf
(
pFile
,
".names"
);
Vec_PtrForEachEntryStart
(
char
*
,
vNode
,
pName
,
i
,
2
)
fprintf
(
pFile
,
" %s"
,
pName
);
fprintf
(
pFile
,
" %s
\n
"
,
(
char
*
)
Vec_PtrEntry
(
vNode
,
0
)
);
fprintf
(
pFile
,
"%s"
,
Ptr_TypeToSop
(
(
Ptr_ObjType_t
)
Abc_Ptr2Int
(
Vec_PtrEntry
(
vNode
,
1
))
)
);
}
void
Ptr_ManDumpNodesToBlif
(
FILE
*
pFile
,
Vec_Ptr_t
*
vNodes
)
{
Vec_Ptr_t
*
vNode
;
int
i
;
Vec_PtrForEachEntry
(
Vec_Ptr_t
*
,
vNodes
,
vNode
,
i
)
Ptr_ManDumpNodeToBlif
(
pFile
,
vNode
);
}
void
Ptr_ManDumpBoxToBlif
(
FILE
*
pFile
,
Vec_Ptr_t
*
vBox
)
{
char
*
pName
;
int
i
;
fprintf
(
pFile
,
"%s"
,
(
char
*
)
Vec_PtrEntry
(
vBox
,
0
)
);
Vec_PtrForEachEntryStart
(
char
*
,
vBox
,
pName
,
i
,
2
)
fprintf
(
pFile
,
" %s=%s"
,
pName
,
(
char
*
)
Vec_PtrEntry
(
vBox
,
i
+
1
)
),
i
++
;
fprintf
(
pFile
,
"
\n
"
);
}
void
Ptr_ManDumpBoxesToBlif
(
FILE
*
pFile
,
Vec_Ptr_t
*
vBoxes
)
{
Vec_Ptr_t
*
vBox
;
int
i
;
Vec_PtrForEachEntry
(
Vec_Ptr_t
*
,
vBoxes
,
vBox
,
i
)
Ptr_ManDumpBoxToBlif
(
pFile
,
vBox
);
}
void
Ptr_ManDumpSignalsToBlif
(
FILE
*
pFile
,
Vec_Ptr_t
*
vSigs
,
int
fSkipLastComma
)
{
char
*
pSig
;
int
i
;
Vec_PtrForEachEntry
(
char
*
,
vSigs
,
pSig
,
i
)
fprintf
(
pFile
,
" %s"
,
pSig
);
}
void
Ptr_ManDumpModuleToBlif
(
FILE
*
pFile
,
Vec_Ptr_t
*
vNtk
)
{
fprintf
(
pFile
,
".model %s
\n
"
,
(
char
*
)
Vec_PtrEntry
(
vNtk
,
0
)
);
fprintf
(
pFile
,
".inputs"
);
Ptr_ManDumpSignalsToBlif
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
1
),
0
);
fprintf
(
pFile
,
"
\n
"
);
fprintf
(
pFile
,
".outputs"
);
Ptr_ManDumpSignalsToBlif
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
2
),
1
);
fprintf
(
pFile
,
"
\n\n
"
);
Ptr_ManDumpNodesToBlif
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
3
)
);
fprintf
(
pFile
,
"
\n
"
);
Ptr_ManDumpBoxesToBlif
(
pFile
,
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vNtk
,
4
)
);
fprintf
(
pFile
,
"
\n
"
);
fprintf
(
pFile
,
".end
\n\n
"
);
}
void
Ptr_ManDumpToBlif
(
char
*
pFileName
,
Vec_Ptr_t
*
vDes
)
{
FILE
*
pFile
;
Vec_Ptr_t
*
vNtk
;
int
i
;
pFile
=
fopen
(
pFileName
,
"wb"
);
if
(
pFile
==
NULL
)
{
printf
(
"Cannot open output file
\"
%s
\"
.
\n
"
,
pFileName
);
return
;
}
fprintf
(
pFile
,
"// Design
\"
%s
\"
written by ABC on %s
\n\n
"
,
(
char
*
)
Vec_PtrEntry
(
vDes
,
0
),
Extra_TimeStamp
()
);
Vec_PtrForEachEntryStart
(
Vec_Ptr_t
*
,
vDes
,
vNtk
,
i
,
1
)
Ptr_ManDumpModuleToBlif
(
pFile
,
vNtk
);
fclose
(
pFile
);
}
/**Function*************************************************************
Synopsis [Dumping Ptr into a Verilog file.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Ptr_ManDumpNodeToFile
(
FILE
*
pFile
,
Vec_Ptr_t
*
vNode
)
{
char
*
pName
;
int
i
;
...
...
@@ -572,7 +662,7 @@ void Ptr_ManDumpBoxToFile( FILE * pFile, Vec_Ptr_t * vBox )
char
*
pName
;
int
i
;
fprintf
(
pFile
,
"%s %s ("
,
(
char
*
)
Vec_PtrEntry
(
vBox
,
0
),
(
char
*
)
Vec_PtrEntry
(
vBox
,
1
)
);
Vec_PtrForEachEntryStart
(
char
*
,
vBox
,
pName
,
i
,
2
)
fprintf
(
pFile
,
" .%s(%s)%s"
,
pName
,
(
char
*
)
Vec_PtrEntry
(
vBox
,
++
i
),
i
>=
Vec_PtrSize
(
vBox
)
-
2
?
""
:
","
)
;
fprintf
(
pFile
,
" .%s(%s)%s"
,
pName
,
(
char
*
)
Vec_PtrEntry
(
vBox
,
i
+
1
),
i
>=
Vec_PtrSize
(
vBox
)
-
2
?
""
:
","
),
i
++
;
fprintf
(
pFile
,
" );
\n
"
);
}
void
Ptr_ManDumpBoxesToFile
(
FILE
*
pFile
,
Vec_Ptr_t
*
vBoxes
)
...
...
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