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
eacfad76
Commit
eacfad76
authored
May 05, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing the queue to work in the same the array of costs is realloced.
parent
7d330158
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
16 deletions
+17
-16
abcexe.dsp
+1
-0
src/base/abci/abcFx.c
+1
-9
src/map/scl/sclMan.h
+2
-2
src/misc/vec/vecFlt.h
+4
-0
src/misc/vec/vecInt.h
+4
-0
src/misc/vec/vecQue.h
+5
-5
No files found.
abcexe.dsp
View file @
eacfad76
...
...
@@ -51,6 +51,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib lib\abcr.lib lib\x86\pthreadVC2.lib /nologo /subsystem:console /incremental:yes /debug /machine:I386 /out:"_TEST/abc.exe"
# SUBTRACT LINK32 /profile
!ELSEIF "$(CFG)" == "abcexe - Win32 Debug"
...
...
src/base/abci/abcFx.c
View file @
eacfad76
...
...
@@ -636,10 +636,7 @@ int Fx_ManCubeSingleCubeDivisors( Fx_Man_t * p, Vec_Int_t * vPivot, int fRemove,
{
if
(
Vec_FltSize
(
p
->
vWeights
)
==
iDiv
)
{
float
*
pArray
=
Vec_FltArray
(
p
->
vWeights
);
Vec_FltPush
(
p
->
vWeights
,
-
2
);
if
(
p
->
vPrio
&&
pArray
!=
Vec_FltArray
(
p
->
vWeights
)
)
Vec_QueSetCosts
(
p
->
vPrio
,
Vec_FltArray
(
p
->
vWeights
)
);
p
->
nDivsS
++
;
}
assert
(
iDiv
<
Vec_FltSize
(
p
->
vWeights
)
);
...
...
@@ -692,12 +689,7 @@ void Fx_ManCubeDoubleCubeDivisors( Fx_Man_t * p, int iFirst, Vec_Int_t * vPivot,
if
(
!
fRemove
)
{
if
(
iDiv
==
Vec_FltSize
(
p
->
vWeights
)
)
{
float
*
pArray
=
Vec_FltArray
(
p
->
vWeights
);
Vec_FltPush
(
p
->
vWeights
,
-
Vec_IntSize
(
p
->
vFree
));
if
(
p
->
vPrio
&&
pArray
!=
Vec_FltArray
(
p
->
vWeights
)
)
Vec_QueSetCosts
(
p
->
vPrio
,
Vec_FltArray
(
p
->
vWeights
)
);
}
assert
(
iDiv
<
Vec_FltSize
(
p
->
vWeights
)
);
Vec_FltAddToEntry
(
p
->
vWeights
,
iDiv
,
Base
+
Vec_IntSize
(
p
->
vFree
)
-
1
);
p
->
nPairsD
++
;
...
...
@@ -735,7 +727,7 @@ void Fx_ManCreateDivisors( Fx_Man_t * p )
Fx_ManCubeDoubleCubeDivisors
(
p
,
i
+
1
,
vCube
,
0
,
0
);
// add - no update
// create queue with all divisors
p
->
vPrio
=
Vec_QueAlloc
(
Vec_FltSize
(
p
->
vWeights
)
);
Vec_QueSetCosts
(
p
->
vPrio
,
Vec_FltArray
(
p
->
vWeights
)
);
Vec_QueSetCosts
(
p
->
vPrio
,
Vec_FltArray
P
(
p
->
vWeights
)
);
Vec_FltForEachEntry
(
p
->
vWeights
,
Weight
,
i
)
if
(
Weight
>
0
.
0
)
Vec_QuePush
(
p
->
vPrio
,
i
);
...
...
src/map/scl/sclMan.h
View file @
eacfad76
...
...
@@ -152,7 +152,7 @@ static inline SC_Man * Abc_SclManAlloc( SC_Lib * pLib, Abc_Ntk_t * pNtk )
p
->
pSlack
=
ABC_FALLOC
(
float
,
p
->
nObjs
);
p
->
vTimesOut
=
Vec_FltStart
(
Abc_NtkCoNum
(
pNtk
)
);
p
->
vQue
=
Vec_QueAlloc
(
Abc_NtkCoNum
(
pNtk
)
);
Vec_QueSetCosts
(
p
->
vQue
,
Vec_FltArray
(
p
->
vTimesOut
)
);
Vec_QueSetCosts
(
p
->
vQue
,
Vec_FltArray
P
(
p
->
vTimesOut
)
);
for
(
i
=
0
;
i
<
Abc_NtkCoNum
(
pNtk
);
i
++
)
Vec_QuePush
(
p
->
vQue
,
i
);
p
->
vUpdates
=
Vec_IntAlloc
(
1000
);
...
...
@@ -160,7 +160,7 @@ static inline SC_Man * Abc_SclManAlloc( SC_Lib * pLib, Abc_Ntk_t * pNtk )
p
->
vNode2Gain
=
Vec_FltStart
(
p
->
nObjs
);
p
->
vNode2Gate
=
Vec_IntStart
(
p
->
nObjs
);
p
->
vNodeByGain
=
Vec_QueAlloc
(
p
->
nObjs
);
Vec_QueSetCosts
(
p
->
vNodeByGain
,
Vec_FltArray
(
p
->
vNode2Gain
)
);
Vec_QueSetCosts
(
p
->
vNodeByGain
,
Vec_FltArray
P
(
p
->
vNode2Gain
)
);
p
->
vNodeIter
=
Vec_IntStartFull
(
p
->
nObjs
);
return
p
;
}
...
...
src/misc/vec/vecFlt.h
View file @
eacfad76
...
...
@@ -267,6 +267,10 @@ static inline float * Vec_FltArray( Vec_Flt_t * p )
{
return
p
->
pArray
;
}
static
inline
float
**
Vec_FltArrayP
(
Vec_Flt_t
*
p
)
{
return
&
p
->
pArray
;
}
/**Function*************************************************************
...
...
src/misc/vec/vecInt.h
View file @
eacfad76
...
...
@@ -321,6 +321,10 @@ static inline int * Vec_IntArray( Vec_Int_t * p )
{
return
p
->
pArray
;
}
static
inline
int
**
Vec_IntArrayP
(
Vec_Int_t
*
p
)
{
return
&
p
->
pArray
;
}
/**Function*************************************************************
...
...
src/misc/vec/vecQue.h
View file @
eacfad76
...
...
@@ -44,10 +44,10 @@ struct Vec_Que_t_
int
nSize
;
int
*
pHeap
;
int
*
pOrder
;
float
*
pCostsFlt
;
// owned by the caller
float
*
*
pCostsFlt
;
// owned by the caller
};
static
inline
float
Vec_QueCost
(
Vec_Que_t
*
p
,
int
v
)
{
return
p
->
pCostsFlt
?
p
->
pCostsFlt
[
v
]
:
v
;
}
static
inline
float
Vec_QueCost
(
Vec_Que_t
*
p
,
int
v
)
{
return
*
p
->
pCostsFlt
?
(
*
p
->
pCostsFlt
)
[
v
]
:
v
;
}
////////////////////////////////////////////////////////////////////////
/// MACRO DEFINITIONS ///
...
...
@@ -92,9 +92,9 @@ static inline void Vec_QueFreeP( Vec_Que_t ** p )
Vec_QueFree
(
*
p
);
*
p
=
NULL
;
}
static
inline
void
Vec_QueSetCosts
(
Vec_Que_t
*
p
,
float
*
pCosts
)
static
inline
void
Vec_QueSetCosts
(
Vec_Que_t
*
p
,
float
*
*
pCosts
)
{
//
assert( p->pCostsFlt == NULL );
assert
(
p
->
pCostsFlt
==
NULL
);
p
->
pCostsFlt
=
pCosts
;
}
static
inline
void
Vec_QueGrow
(
Vec_Que_t
*
p
,
int
nCapMin
)
...
...
@@ -333,7 +333,7 @@ static inline void Vec_QueTest( Vec_Flt_t * vCosts )
// start the queue
p
=
Vec_QueAlloc
(
Vec_FltSize
(
vCosts
)
);
Vec_QueSetCosts
(
p
,
Vec_FltArray
(
vCosts
)
);
Vec_QueSetCosts
(
p
,
Vec_FltArray
P
(
vCosts
)
);
for
(
i
=
0
;
i
<
Vec_FltSize
(
vCosts
);
i
++
)
Vec_QuePush
(
p
,
i
);
// Vec_QuePrint( p );
...
...
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