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
1aecc337
Commit
1aecc337
authored
Feb 08, 2023
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New command to compute the range of output values.
parent
aa4cada2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
125 additions
and
0 deletions
+125
-0
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaSimBase.c
+33
-0
src/base/abc/abc.h
+1
-0
src/base/abc/abcNtk.c
+35
-0
src/base/abci/abc.c
+55
-0
No files found.
src/aig/gia/gia.h
View file @
1aecc337
...
...
@@ -1610,6 +1610,7 @@ extern Vec_Wrd_t * Gia_ManArray2SimOne( Vec_Int_t * vRes );
extern
Vec_Ptr_t
*
Gia_ManArray2Sim
(
Vec_Wec_t
*
vRes
);
extern
void
Gia_ManPtrWrdDumpBin
(
char
*
pFileName
,
Vec_Ptr_t
*
p
,
int
fVerbose
);
extern
Vec_Ptr_t
*
Gia_ManPtrWrdReadBin
(
char
*
pFileName
,
int
fVerbose
);
extern
Vec_Str_t
*
Gia_ManComputeRange
(
Gia_Man_t
*
p
);
/*=== giaSpeedup.c ============================================================*/
extern
float
Gia_ManDelayTraceLut
(
Gia_Man_t
*
p
);
extern
float
Gia_ManDelayTraceLutPrint
(
Gia_Man_t
*
p
,
int
fVerbose
);
...
...
src/aig/gia/giaSimBase.c
View file @
1aecc337
...
...
@@ -3656,6 +3656,39 @@ Gia_Man_t * Gia_ManChangeTest3( Gia_Man_t * p )
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Str_t
*
Gia_ManComputeRange
(
Gia_Man_t
*
p
)
{
Vec_Wrd_t
*
vSimsPi
=
Vec_WrdStartTruthTables
(
Gia_ManCiNum
(
p
)
);
Vec_Wrd_t
*
vSims
=
Gia_ManSimPatSimOut
(
p
,
vSimsPi
,
1
);
int
n
,
nWords
=
Vec_WrdSize
(
vSimsPi
)
/
Gia_ManCiNum
(
p
);
int
i
,
nLimit
=
Gia_ManCiNum
(
p
)
<
6
?
1
<<
Gia_ManCiNum
(
p
)
:
64
*
nWords
;
Vec_Str_t
*
vOut
=
Vec_StrAlloc
(
nLimit
*
(
Gia_ManCoNum
(
p
)
+
3
)
);
assert
(
Vec_WrdSize
(
vSims
)
==
nWords
*
Gia_ManCoNum
(
p
)
);
for
(
n
=
0
;
n
<
nLimit
;
n
++
)
{
for
(
i
=
0
;
i
<
Gia_ManCoNum
(
p
);
i
++
)
Vec_StrPush
(
vOut
,
(
char
)(
'0'
+
Abc_TtGetBit
(
Vec_WrdEntryP
(
vSims
,
i
*
nWords
),
n
))
);
Vec_StrPush
(
vOut
,
' '
);
Vec_StrPush
(
vOut
,
'1'
);
Vec_StrPush
(
vOut
,
'\n'
);
}
Vec_StrPush
(
vOut
,
'\0'
);
Vec_WrdFree
(
vSims
);
Vec_WrdFree
(
vSimsPi
);
return
vOut
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/base/abc/abc.h
View file @
1aecc337
...
...
@@ -783,6 +783,7 @@ extern ABC_DLL void Abc_NtkAppendToCone( Abc_Ntk_t * pNtkNew, Abc_
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkCreateMffc
(
Abc_Ntk_t
*
pNtk
,
Abc_Obj_t
*
pNode
,
char
*
pNodeName
);
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkCreateTarget
(
Abc_Ntk_t
*
pNtk
,
Vec_Ptr_t
*
vRoots
,
Vec_Int_t
*
vValues
);
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkCreateFromNode
(
Abc_Ntk_t
*
pNtk
,
Abc_Obj_t
*
pNode
);
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkCreateFromRange
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkCreateWithNode
(
char
*
pSop
);
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkCreateWithNodes
(
Vec_Ptr_t
*
vSops
);
extern
ABC_DLL
void
Abc_NtkDelete
(
Abc_Ntk_t
*
pNtk
);
...
...
src/base/abc/abcNtk.c
View file @
1aecc337
...
...
@@ -1231,6 +1231,41 @@ Abc_Ntk_t * Abc_NtkCreateFromNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
/**Function*************************************************************
Synopsis [Creates the network composed of one node.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Abc_NtkCreateFromRange
(
Abc_Ntk_t
*
pNtk
)
{
Abc_Ntk_t
*
pNtkNew
;
Abc_Obj_t
*
pObj
,
*
pNodeNew
,
*
pNodePo
;
Gia_Man_t
*
p
=
Abc_NtkClpGia
(
pNtk
);
int
i
;
Vec_Str_t
*
vStr
=
Gia_ManComputeRange
(
p
);
Gia_ManStop
(
p
);
pNtkNew
=
Abc_NtkAlloc
(
ABC_NTK_LOGIC
,
ABC_FUNC_SOP
,
1
);
pNtkNew
->
pName
=
Extra_UtilStrsav
(
"range"
);
Abc_NtkForEachCo
(
pNtk
,
pObj
,
i
)
Abc_ObjAssignName
(
Abc_NtkCreatePi
(
pNtkNew
),
Abc_ObjName
(
pObj
),
NULL
);
pNodeNew
=
Abc_NtkCreateObj
(
pNtkNew
,
ABC_OBJ_NODE
);
pNodeNew
->
pData
=
Abc_SopRegister
(
(
Mem_Flex_t
*
)
pNtkNew
->
pManFunc
,
Vec_StrArray
(
vStr
)
);
Vec_StrFree
(
vStr
);
Abc_NtkForEachCi
(
pNtkNew
,
pObj
,
i
)
Abc_ObjAddFanin
(
pNodeNew
,
pObj
);
pNodePo
=
Abc_NtkCreatePo
(
pNtkNew
);
Abc_ObjAddFanin
(
pNodePo
,
pNodeNew
);
Abc_ObjAssignName
(
pNodePo
,
"range"
,
NULL
);
if
(
!
Abc_NtkCheck
(
pNtkNew
)
)
fprintf
(
stdout
,
"Abc_NtkCreateFromNode(): Network check has failed.
\n
"
);
return
pNtkNew
;
}
/**Function*************************************************************
Synopsis [Creates the network composed of one node with the given SOP.]
Description []
...
...
src/base/abci/abc.c
View file @
1aecc337
...
...
@@ -193,6 +193,7 @@ static int Abc_CommandExtSeqDcs ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandReach
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandCone
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandNode
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandRange
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandCof
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandTopmost
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandBottommost
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -949,6 +950,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"reach"
,
Abc_CommandReach
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"cone"
,
Abc_CommandCone
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"node"
,
Abc_CommandNode
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"range"
,
Abc_CommandRange
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"cof"
,
Abc_CommandCof
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"topmost"
,
Abc_CommandTopmost
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"bottommost"
,
Abc_CommandBottommost
,
1
);
...
...
@@ -11923,6 +11925,59 @@ usage:
SeeAlso []
***********************************************************************/
int
Abc_CommandRange
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Abc_Ntk_t
*
pNtk
,
*
pNtkRes
;
int
c
;
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"h"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
pNtk
==
NULL
)
{
Abc_Print
(
-
1
,
"Empty network.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkIsStrash
(
pNtk
)
)
{
Abc_Print
(
-
1
,
"Currently can only be applied to an AIG.
\n
"
);
return
1
;
}
pNtkRes
=
Abc_NtkCreateFromRange
(
pNtk
);
if
(
pNtkRes
==
NULL
)
{
Abc_Print
(
-
1
,
"Deriving the network has failed.
\n
"
);
return
1
;
}
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: range [-h]
\n
"
);
Abc_Print
(
-
2
,
"
\t
computes the range of output values as one node
\n
"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandCof
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Abc_Ntk_t
*
pNtk
;
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