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
2b58a83a
Commit
2b58a83a
authored
May 03, 2020
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding dumping of genlib library in Verilog.
parent
559f8f5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
30 deletions
+30
-30
src/map/mio/exp.h
+0
-30
src/map/mio/mioUtils.c
+30
-0
No files found.
src/map/mio/exp.h
View file @
2b58a83a
...
...
@@ -121,36 +121,6 @@ static inline void Exp_Print( int nVars, Vec_Int_t * p )
Exp_PrintLit
(
nVars
,
Vec_IntEntryLast
(
p
)
);
Abc_Print
(
1
,
"
\n
"
);
}
static
inline
void
Exp_PrintNodeVerilog
(
FILE
*
pFile
,
int
nVars
,
Vec_Int_t
*
p
,
Vec_Ptr_t
*
vNames
,
int
Node
,
int
fCompl
)
{
static
void
Exp_PrintLitVerilog
(
FILE
*
pFile
,
int
nVars
,
Vec_Int_t
*
p
,
Vec_Ptr_t
*
vNames
,
int
Lit
);
if
(
Vec_IntEntry
(
p
,
2
*
Node
+
1
)
>=
2
*
nVars
)
fprintf
(
pFile
,
"("
);
Exp_PrintLitVerilog
(
pFile
,
nVars
,
p
,
vNames
,
Vec_IntEntry
(
p
,
2
*
Node
+
1
)
^
fCompl
);
if
(
Vec_IntEntry
(
p
,
2
*
Node
+
1
)
>=
2
*
nVars
)
fprintf
(
pFile
,
")"
);
fprintf
(
pFile
,
" %c "
,
fCompl
?
'|'
:
'&'
);
if
(
Vec_IntEntry
(
p
,
2
*
Node
+
0
)
>=
2
*
nVars
)
fprintf
(
pFile
,
"("
);
Exp_PrintLitVerilog
(
pFile
,
nVars
,
p
,
vNames
,
Vec_IntEntry
(
p
,
2
*
Node
+
0
)
^
fCompl
);
if
(
Vec_IntEntry
(
p
,
2
*
Node
+
0
)
>=
2
*
nVars
)
fprintf
(
pFile
,
")"
);
}
static
inline
void
Exp_PrintLitVerilog
(
FILE
*
pFile
,
int
nVars
,
Vec_Int_t
*
p
,
Vec_Ptr_t
*
vNames
,
int
Lit
)
{
if
(
Lit
==
EXP_CONST0
)
fprintf
(
pFile
,
"1
\'
b0"
);
else
if
(
Lit
==
EXP_CONST1
)
fprintf
(
pFile
,
"1
\'
b1"
);
else
if
(
Lit
<
2
*
nVars
)
fprintf
(
pFile
,
"%s%s"
,
(
Lit
&
1
)
?
"~"
:
""
,
(
char
*
)
Vec_PtrEntry
(
vNames
,
Lit
/
2
)
);
else
Exp_PrintNodeVerilog
(
pFile
,
nVars
,
p
,
vNames
,
Lit
/
2
-
nVars
,
Lit
&
1
);
}
static
inline
void
Exp_PrintVerilog
(
FILE
*
pFile
,
int
nVars
,
Vec_Int_t
*
p
,
Vec_Ptr_t
*
vNames
)
{
Exp_PrintLitVerilog
(
pFile
,
nVars
,
p
,
vNames
,
Vec_IntEntryLast
(
p
)
);
}
static
inline
Vec_Int_t
*
Exp_Reverse
(
Vec_Int_t
*
p
)
{
Vec_IntReverseOrder
(
p
);
...
...
src/map/mio/mioUtils.c
View file @
2b58a83a
...
...
@@ -297,6 +297,36 @@ void Mio_WriteLibrary( FILE * pFile, Mio_Library_t * pLib, int fPrintSops, int f
SeeAlso []
***********************************************************************/
void
Exp_PrintNodeVerilog
(
FILE
*
pFile
,
int
nVars
,
Vec_Int_t
*
p
,
Vec_Ptr_t
*
vNames
,
int
Node
,
int
fCompl
)
{
extern
void
Exp_PrintLitVerilog
(
FILE
*
pFile
,
int
nVars
,
Vec_Int_t
*
p
,
Vec_Ptr_t
*
vNames
,
int
Lit
);
if
(
Vec_IntEntry
(
p
,
2
*
Node
+
1
)
>=
2
*
nVars
)
fprintf
(
pFile
,
"("
);
Exp_PrintLitVerilog
(
pFile
,
nVars
,
p
,
vNames
,
Vec_IntEntry
(
p
,
2
*
Node
+
1
)
^
fCompl
);
if
(
Vec_IntEntry
(
p
,
2
*
Node
+
1
)
>=
2
*
nVars
)
fprintf
(
pFile
,
")"
);
fprintf
(
pFile
,
" %c "
,
fCompl
?
'|'
:
'&'
);
if
(
Vec_IntEntry
(
p
,
2
*
Node
+
0
)
>=
2
*
nVars
)
fprintf
(
pFile
,
"("
);
Exp_PrintLitVerilog
(
pFile
,
nVars
,
p
,
vNames
,
Vec_IntEntry
(
p
,
2
*
Node
+
0
)
^
fCompl
);
if
(
Vec_IntEntry
(
p
,
2
*
Node
+
0
)
>=
2
*
nVars
)
fprintf
(
pFile
,
")"
);
}
void
Exp_PrintLitVerilog
(
FILE
*
pFile
,
int
nVars
,
Vec_Int_t
*
p
,
Vec_Ptr_t
*
vNames
,
int
Lit
)
{
if
(
Lit
==
EXP_CONST0
)
fprintf
(
pFile
,
"1
\'
b0"
);
else
if
(
Lit
==
EXP_CONST1
)
fprintf
(
pFile
,
"1
\'
b1"
);
else
if
(
Lit
<
2
*
nVars
)
fprintf
(
pFile
,
"%s%s"
,
(
Lit
&
1
)
?
"~"
:
""
,
(
char
*
)
Vec_PtrEntry
(
vNames
,
Lit
/
2
)
);
else
Exp_PrintNodeVerilog
(
pFile
,
nVars
,
p
,
vNames
,
Lit
/
2
-
nVars
,
Lit
&
1
);
}
void
Exp_PrintVerilog
(
FILE
*
pFile
,
int
nVars
,
Vec_Int_t
*
p
,
Vec_Ptr_t
*
vNames
)
{
Exp_PrintLitVerilog
(
pFile
,
nVars
,
p
,
vNames
,
Vec_IntEntryLast
(
p
)
);
}
void
Mio_WriteGateVerilog
(
FILE
*
pFile
,
Mio_Gate_t
*
pGate
,
Vec_Ptr_t
*
vNames
)
{
char
*
pName
;
int
i
;
...
...
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