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
0699c43a
Commit
0699c43a
authored
Jan 27, 2019
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with memory abstraction.
parent
fafd8c22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
130 additions
and
6 deletions
+130
-6
abclib.dsp
+4
-0
src/base/wlc/wlc.h
+6
-0
src/base/wlc/wlcBlast.c
+2
-2
src/base/wlc/wlcCom.c
+63
-2
src/base/wlc/wlcMem.c
+0
-0
src/base/wlc/wlcNtk.c
+1
-1
src/base/wlc/wlcShow.c
+1
-1
src/base/wln/module.make
+1
-0
src/base/wln/wlnMem.c
+52
-0
No files found.
abclib.dsp
View file @
0699c43a
...
...
@@ -1119,6 +1119,10 @@ SOURCE=.\src\base\wln\wln.h
# End Source File
# Begin Source File
SOURCE=.\src\base\wln\wlnMem.c
# End Source File
# Begin Source File
SOURCE=.\src\base\wln\wlnNdr.c
# End Source File
# Begin Source File
...
...
src/base/wlc/wlc.h
View file @
0699c43a
...
...
@@ -120,6 +120,7 @@ struct Wlc_Obj_t_ // 24 bytes
unsigned
Type
:
6
;
// node type
unsigned
Signed
:
1
;
// signed
unsigned
Mark
:
1
;
// user mark
unsigned
Mark2
:
1
;
// user mark
unsigned
fIsPo
:
1
;
// this is PO
unsigned
fIsFi
:
1
;
// this is FI
unsigned
fXConst
:
1
;
// this is X-valued constant
...
...
@@ -283,6 +284,10 @@ static inline int Wlc_ObjIsPi( Wlc_Obj_t * p )
static
inline
int
Wlc_ObjIsPo
(
Wlc_Obj_t
*
p
)
{
return
p
->
fIsPo
;
}
static
inline
int
Wlc_ObjIsCi
(
Wlc_Obj_t
*
p
)
{
return
p
->
Type
==
WLC_OBJ_PI
||
p
->
Type
==
WLC_OBJ_FO
;
}
static
inline
int
Wlc_ObjIsCo
(
Wlc_Obj_t
*
p
)
{
return
p
->
fIsPo
||
p
->
fIsFi
;
}
static
inline
int
Wlc_ObjIsRead
(
Wlc_Obj_t
*
p
)
{
return
p
->
Type
==
WLC_OBJ_READ
;
}
static
inline
int
Wlc_ObjIsWrite
(
Wlc_Obj_t
*
p
)
{
return
p
->
Type
==
WLC_OBJ_WRITE
;
}
static
inline
int
Wlc_ObjIsMux
(
Wlc_Obj_t
*
p
)
{
return
p
->
Type
==
WLC_OBJ_MUX
;
}
static
inline
int
Wlc_ObjIsBuf
(
Wlc_Obj_t
*
p
)
{
return
p
->
Type
==
WLC_OBJ_BUF
;
}
static
inline
int
Wlc_ObjIsFf
(
Wlc_Ntk_t
*
p
,
int
i
)
{
return
Wlc_NtkObj
(
p
,
i
)
->
Type
==
WLC_OBJ_FF
;
}
static
inline
int
Wlc_ObjId
(
Wlc_Ntk_t
*
p
,
Wlc_Obj_t
*
pObj
)
{
return
pObj
-
p
->
pObjs
;
}
...
...
@@ -383,6 +388,7 @@ extern Vec_Int_t * Wlc_NtkCollectMemory( Wlc_Ntk_t * p, int fClean );
extern
void
Wlc_NtkPrintMemory
(
Wlc_Ntk_t
*
p
);
extern
Wlc_Ntk_t
*
Wlc_NtkMemAbstractTest
(
Wlc_Ntk_t
*
p
);
extern
int
Wlc_NtkMemAbstract
(
Wlc_Ntk_t
*
p
,
int
nIterMax
,
int
fDumpAbs
,
int
fPdrVerbose
,
int
fVerbose
);
extern
Wlc_Ntk_t
*
Wlc_NtkAbstractMem
(
Wlc_Ntk_t
*
p
,
int
nFrames
,
int
fVerbose
);
/*=== wlcNdr.c ========================================================*/
extern
Wlc_Ntk_t
*
Wlc_ReadNdr
(
char
*
pFileName
);
extern
void
Wlc_WriteNdr
(
Wlc_Ntk_t
*
pNtk
,
char
*
pFileName
);
...
...
src/base/wlc/wlcBlast.c
View file @
0699c43a
...
...
@@ -1267,8 +1267,8 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
// blast in the topological order
Wlc_NtkForEachObj
(
p
,
pObj
,
i
)
{
//
char * pName1 = Wlc_ObjName(p, i);
//
char * pName2 = Wlc_ObjFaninNum(pObj) ? Wlc_ObjName(p, Wlc_ObjFaninId0(pObj)) : NULL;
//
char * pName1 = Wlc_ObjName(p, i);
//
char * pName2 = Wlc_ObjFaninNum(pObj) ? Wlc_ObjName(p, Wlc_ObjFaninId0(pObj)) : NULL;
nAndPrev
=
Gia_ManAndNum
(
pNew
);
nRange
=
Wlc_ObjRange
(
pObj
);
...
...
src/base/wlc/wlcCom.c
View file @
0699c43a
...
...
@@ -38,6 +38,7 @@ static int Abc_CommandAbs ( Abc_Frame_t * pAbc, int argc, char ** argv )
static
int
Abc_CommandPdrAbs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbs2
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandMemAbs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandMemAbs2
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandBlast
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandBlastMem
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandGraft
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -84,6 +85,7 @@ void Wlc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Word level"
,
"%pdra"
,
Abc_CommandPdrAbs
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Word level"
,
"%abs2"
,
Abc_CommandAbs2
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Word level"
,
"%memabs"
,
Abc_CommandMemAbs
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Word level"
,
"%memabs2"
,
Abc_CommandMemAbs2
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Word level"
,
"%blast"
,
Abc_CommandBlast
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Word level"
,
"%blastmem"
,
Abc_CommandBlastMem
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Word level"
,
"%graft"
,
Abc_CommandGraft
,
0
);
...
...
@@ -942,7 +944,7 @@ int Abc_CommandMemAbs( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if
(
pNtk
==
NULL
)
{
Abc_Print
(
1
,
"Abc_Command
Cone
(): There is no current design.
\n
"
);
Abc_Print
(
1
,
"Abc_Command
MemAbs
(): There is no current design.
\n
"
);
return
0
;
}
Wlc_NtkMemAbstract
(
pNtk
,
nIterMax
,
fDumpAbs
,
fPdrVerbose
,
fVerbose
);
...
...
@@ -969,6 +971,63 @@ usage:
SeeAlso []
******************************************************************************/
int
Abc_CommandMemAbs2
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Wlc_Ntk_t
*
pNtk
=
Wlc_AbcGetNtk
(
pAbc
);
int
c
,
nFrames
=
0
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Fvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'F'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-I
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nFrames
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nFrames
<=
0
)
goto
usage
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
pNtk
==
NULL
)
{
Abc_Print
(
1
,
"Abc_CommandMemAbs2(): There is no current design.
\n
"
);
return
0
;
}
pNtk
=
Wlc_NtkAbstractMem
(
pNtk
,
nFrames
,
fVerbose
);
Wlc_AbcUpdateNtk
(
pAbc
,
pNtk
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: %%memabs2 [-F num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
memory abstraction for word-level networks
\n
"
);
Abc_Print
(
-
2
,
"
\t
-F num : the number of timeframes [default = %d]
\n
"
,
nFrames
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function********************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
******************************************************************************/
int
Abc_CommandBlast
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Wlc_NtkPrintInputInfo
(
Wlc_Ntk_t
*
pNtk
);
...
...
@@ -1810,8 +1869,9 @@ usage:
******************************************************************************/
int
Abc_CommandTest
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Wlc_NtkExploreMem
(
Wlc_Ntk_t
*
p
,
int
nFrames
);
extern
void
Wlc_NtkSimulateTest
(
Wlc_Ntk_t
*
p
);
//
Wlc_Ntk_t * pNtk = Wlc_AbcGetNtk(pAbc);
Wlc_Ntk_t
*
pNtk
=
Wlc_AbcGetNtk
(
pAbc
);
int
c
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"vh"
)
)
!=
EOF
)
...
...
@@ -1845,6 +1905,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
//pNtk = Wlc_NtkMemAbstractTest( pNtk );
//Wlc_AbcUpdateNtk( pAbc, pNtk );
//Wln_NtkFromWlcTest( pNtk );
Wlc_NtkExploreMem
(
pNtk
,
0
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: %%test [-vh]
\n
"
);
...
...
src/base/wlc/wlcMem.c
View file @
0699c43a
This diff is collapsed.
Click to expand it.
src/base/wlc/wlcNtk.c
View file @
0699c43a
...
...
@@ -832,7 +832,7 @@ void Wlc_NtkTransferNames( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p )
assert
(
pNew
->
pManName
==
NULL
&&
p
->
pManName
!=
NULL
);
Wlc_NtkCleanNameId
(
pNew
);
for
(
i
=
0
;
i
<
p
->
nObjsAlloc
;
i
++
)
if
(
Wlc_ObjCopy
(
p
,
i
)
&&
i
<
Vec_IntSize
(
&
p
->
vNameIds
)
&&
Wlc_ObjNameId
(
p
,
i
)
)
if
(
Wlc_ObjCopy
(
p
,
i
)
>
0
&&
i
<
Vec_IntSize
(
&
p
->
vNameIds
)
&&
Wlc_ObjNameId
(
p
,
i
)
)
Wlc_ObjSetNameId
(
pNew
,
Wlc_ObjCopy
(
p
,
i
),
Wlc_ObjNameId
(
p
,
i
)
);
pNew
->
pManName
=
p
->
pManName
;
p
->
pManName
=
NULL
;
...
...
src/base/wlc/wlcShow.c
View file @
0699c43a
...
...
@@ -261,7 +261,7 @@ void Wlc_NtkDumpDot( Wlc_Ntk_t * p, char * pFileName, Vec_Int_t * vBold )
else
{
fprintf
(
pFile
,
" Node%d [label =
\"
%d:%s %d
\"
"
,
Wlc_ObjId
(
p
,
pNode
),
Wlc_ObjId
(
p
,
pNode
),
Wlc_ObjName
(
p
,
Wlc_ObjId
(
p
,
pNode
)),
Wlc_ObjRange
(
pNode
)
);
fprintf
(
pFile
,
", shape = %s"
,
(
Vec_IntSize
(
&
p
->
vFfs2
)
>
0
||
i
<
Wlc_NtkPiNum
(
p
))
?
"triangle"
:
"box"
);
fprintf
(
pFile
,
", shape = %s"
,
(
Vec_IntSize
(
&
p
->
vFfs2
)
>
0
||
Wlc_ObjCiId
(
pNode
)
<
Wlc_NtkPiNum
(
p
))
?
"triangle"
:
"box"
);
fprintf
(
pFile
,
", color = coral, fillcolor = coral"
);
}
fprintf
(
pFile
,
"];
\n
"
);
...
...
src/base/wln/module.make
View file @
0699c43a
SRC
+=
src/base/wln/wln.c
\
src/base/wln/wlnMem.c
\
src/base/wln/wlnNdr.c
\
src/base/wln/wlnNtk.c
\
src/base/wln/wlnObj.c
\
...
...
src/base/wln/wlnMem.c
0 → 100644
View file @
0699c43a
/**CFile****************************************************************
FileName [wlnMem.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Word-level network.]
Synopsis [Memory abstraction.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - September 23, 2018.]
Revision [$Id: wlnMem.c,v 1.00 2018/09/23 00:00:00 alanmi Exp $]
***********************************************************************/
#include "wln.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
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