Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
systemc-clang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
caesr-pub
systemc-clang
Commits
45775cd8
Commit
45775cd8
authored
Jan 29, 2019
by
rmrf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formatting should be consistent
parent
97dfc63f
Changes
78
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
78 changed files
with
4530 additions
and
5239 deletions
+4530
-5239
src/Automata.cpp
src/Automata.cpp
+355
-528
src/Automata.h
src/Automata.h
+122
-123
src/EntryFunctionContainer.cpp
src/EntryFunctionContainer.cpp
+131
-158
src/EntryFunctionContainer.h
src/EntryFunctionContainer.h
+64
-61
src/EntryFunctionType.h
src/EntryFunctionType.h
+16
-23
src/EventContainer.cpp
src/EventContainer.cpp
+14
-25
src/EventContainer.h
src/EventContainer.h
+22
-21
src/EventDecl.cpp
src/EventDecl.cpp
+21
-31
src/EventDecl.h
src/EventDecl.h
+35
-35
src/FindArgument.cpp
src/FindArgument.cpp
+19
-25
src/FindArgument.h
src/FindArgument.h
+18
-17
src/FindConstructor.cpp
src/FindConstructor.cpp
+15
-16
src/FindConstructor.h
src/FindConstructor.h
+21
-23
src/FindEntryFunctions.cpp
src/FindEntryFunctions.cpp
+104
-113
src/FindEntryFunctions.h
src/FindEntryFunctions.h
+52
-55
src/FindEvents.cpp
src/FindEvents.cpp
+28
-30
src/FindEvents.h
src/FindEvents.h
+32
-32
src/FindGlobalEvents.cpp
src/FindGlobalEvents.cpp
+9
-15
src/FindGlobalEvents.h
src/FindGlobalEvents.h
+21
-22
src/FindModule.cpp
src/FindModule.cpp
+22
-29
src/FindModule.h
src/FindModule.h
+18
-19
src/FindNetlist.cpp
src/FindNetlist.cpp
+87
-95
src/FindNetlist.h
src/FindNetlist.h
+46
-46
src/FindNotify.cpp
src/FindNotify.cpp
+38
-41
src/FindNotify.h
src/FindNotify.h
+19
-19
src/FindPorts.cpp
src/FindPorts.cpp
+49
-49
src/FindPorts.h
src/FindPorts.h
+29
-31
src/FindSCMain.cpp
src/FindSCMain.cpp
+21
-23
src/FindSCMain.h
src/FindSCMain.h
+15
-15
src/FindSensitivity.cpp
src/FindSensitivity.cpp
+53
-53
src/FindSensitivity.h
src/FindSensitivity.h
+22
-24
src/FindSignals.cpp
src/FindSignals.cpp
+42
-45
src/FindSignals.h
src/FindSignals.h
+68
-73
src/FindSimTime.cpp
src/FindSimTime.cpp
+28
-31
src/FindSimTime.h
src/FindSimTime.h
+20
-23
src/FindTLMInterfaces.cpp
src/FindTLMInterfaces.cpp
+96
-103
src/FindTLMInterfaces.h
src/FindTLMInterfaces.h
+32
-33
src/FindTemplateTypes.h
src/FindTemplateTypes.h
+108
-108
src/FindWait.cpp
src/FindWait.cpp
+47
-52
src/FindWait.h
src/FindWait.h
+24
-26
src/InterfaceDecl.cpp
src/InterfaceDecl.cpp
+13
-24
src/InterfaceDecl.h
src/InterfaceDecl.h
+22
-22
src/Model.cpp
src/Model.cpp
+77
-75
src/Model.h
src/Model.h
+55
-54
src/ModuleDecl.cpp
src/ModuleDecl.cpp
+81
-106
src/ModuleDecl.h
src/ModuleDecl.h
+79
-80
src/NotifyCalls.cpp
src/NotifyCalls.cpp
+14
-19
src/NotifyCalls.h
src/NotifyCalls.h
+31
-31
src/NotifyContainer.cpp
src/NotifyContainer.cpp
+61
-88
src/NotifyContainer.h
src/NotifyContainer.h
+29
-29
src/PluginAction.h
src/PluginAction.h
+13
-17
src/PortDecl.cpp
src/PortDecl.cpp
+13
-24
src/PortDecl.h
src/PortDecl.h
+22
-22
src/ProcessDecl.cpp
src/ProcessDecl.cpp
+23
-42
src/ProcessDecl.h
src/ProcessDecl.h
+28
-28
src/SAPlugin.h
src/SAPlugin.h
+9
-14
src/SCModules.cpp
src/SCModules.cpp
+3
-4
src/SCModules.h
src/SCModules.h
+20
-21
src/SCuitable/FindGPUMacro.cpp
src/SCuitable/FindGPUMacro.cpp
+249
-300
src/SCuitable/FindGPUMacro.h
src/SCuitable/FindGPUMacro.h
+70
-74
src/SCuitable/GlobalSuspensionAutomata.cpp
src/SCuitable/GlobalSuspensionAutomata.cpp
+456
-454
src/SCuitable/GlobalSuspensionAutomata.h
src/SCuitable/GlobalSuspensionAutomata.h
+80
-78
src/Signal.cpp
src/Signal.cpp
+20
-54
src/Signal.h
src/Signal.h
+23
-23
src/Sockets.cpp
src/Sockets.cpp
+19
-44
src/Sockets.h
src/Sockets.h
+20
-20
src/SuspensionAutomata.cpp
src/SuspensionAutomata.cpp
+372
-501
src/SuspensionAutomata.h
src/SuspensionAutomata.h
+163
-160
src/SystemCClang.cpp
src/SystemCClang.cpp
+164
-163
src/SystemCClang.h
src/SystemCClang.h
+53
-56
src/TimeAnalysis.h
src/TimeAnalysis.h
+24
-28
src/Utility.cpp
src/Utility.cpp
+40
-43
src/Utility.h
src/Utility.h
+56
-59
src/WaitCalls.cpp
src/WaitCalls.cpp
+10
-29
src/WaitCalls.h
src/WaitCalls.h
+31
-33
src/WaitContainer.cpp
src/WaitContainer.cpp
+60
-89
src/WaitContainer.h
src/WaitContainer.h
+29
-29
src/enums.h
src/enums.h
+15
-11
No files found.
src/Automata.cpp
View file @
45775cd8
This diff is collapsed.
Click to expand it.
src/Automata.h
View file @
45775cd8
#ifndef _AUTOMATA_H_
#define _AUTOMATA_H_
#include <vector>
#include <deque>
#include <map>
#include "clang/AST/DeclCXX.h"
#include "llvm/Support/raw_ostream.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/CFGStmtMap.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ParentMap.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/Expr.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/CFGStmtMap.h"
#include "llvm/Support/raw_ostream.h"
#include <deque>
#include <map>
#include <stdio.h>
#include <vector>
namespace
scpar
{
using
namespace
clang
;
using
namespace
std
;
class
Node
{
public:
typedef
pair
<
int
,
Node
*
>
connectPairType
;
typedef
map
<
int
,
Node
*
>
connectMapType
;
using
namespace
clang
;
using
namespace
std
;
Node
(
);
Node
(
int
);
class
Node
{
public:
typedef
pair
<
int
,
Node
*>
connectPairType
;
typedef
map
<
int
,
Node
*>
connectMapType
;
void
addSuccessor
(
Node
*
);
void
addPredecessor
(
Node
*
);
Node
(
);
Node
(
int
);
vector
<
int
>
getSuccessors
(
int
);
vector
<
int
>
getPredecessors
(
int
);
int
getId
(
);
void
dump
(
raw_ostream
&
,
int
);
protected:
int
_id
;
connectMapType
_preds
;
connectMapType
_succs
;
};
class
Edge
{
public:
typedef
pair
<
unsigned
int
,
unsigned
int
>
timePairType
;
typedef
vector
<
timePairType
>
timeAdvanceVectorType
;
Edge
(
Node
*
,
Node
*
);
Edge
(
Node
*
,
Node
*
,
int
);
void
updateSuspensionTime
(
timePairType
);
int
getId
();
int
getToId
();
int
getFromId
();
timeAdvanceVectorType
getTimeAdvanceVector
();
void
dump
(
raw_ostream
&
,
int
);
protected:
int
_id
;
timeAdvanceVectorType
_timeAdvanceVector
;
Node
*
_from
;
Node
*
_to
;
};
class
Graph
{
public:
typedef
vector
<
int
>
nodeIDVector
;
typedef
vector
<
int
>
edgeIDVector
;
typedef
vector
<
Node
*
>
nodeVector
;
typedef
vector
<
Edge
*
>
edgeVector
;
typedef
map
<
int
,
Node
*
>
nodeMapType
;
typedef
pair
<
int
,
Node
*
>
nodePairType
;
typedef
map
<
int
,
Edge
*
>
edgeMapType
;
typedef
pair
<
int
,
Edge
*
>
edgePairType
;
typedef
pair
<
int
,
int
>
twoNodePairType
;
typedef
pair
<
twoNodePairType
,
Edge
*
>
adjPairType
;
typedef
map
<
twoNodePairType
,
Edge
*
>
adjMapType
;
typedef
pair
<
int
,
vector
<
Edge
*
>
>
adjEdgesPairType
;
typedef
map
<
int
,
vector
<
Edge
*
>
>
adjEdgesMapType
;
Graph
();
~
Graph
();
Node
*
addNode
();
Node
*
addNode
(
int
);
Edge
*
addEdge
(
Node
*
,
Node
*
);
Edge
*
addEdge
(
int
,
int
);
int
getEdgeID
(
Edge
*
);
int
getEdgeID
(
Node
*
,
Node
*
);
int
getEdgeID
(
int
,
int
);
int
getNodeID
(
Node
*
);
Edge
*
getEdge
(
Node
*
,
Node
*
);
Edge
*
getEdge
(
int
,
int
);
Node
*
getNode
(
int
);
vector
<
Edge
*
>
getEdgesFromSource
(
int
);
vector
<
Edge
*
>
getEdgesFromSource
(
Node
*
);
vector
<
Edge
*
>
getEdgesFromDest
(
int
);
vector
<
Edge
*
>
getEdgesFromDest
(
Node
*
);
adjMapType
returnAdjList
();
nodeIDVector
returnNodeIDs
();
edgeIDVector
returnEdgeIDs
();
nodeVector
returnNodes
();
edgeVector
returnEdges
();
edgeVector
returnEdgeVector
();
nodeVector
returnNodeVector
();
void
dump
(
raw_ostream
&
,
int
tabn
=
0
);
void
dumpSauto
(
raw_ostream
&
,
int
tabn
=
0
);
protected:
adjMapType
_adjList
;
nodeMapType
_nodeMap
;
edgeMapType
_edgeMap
;
adjEdgesMapType
_adjEdges
;
int
_nNodes
;
int
_nEdges
;
nodeIDVector
_nodeIDVector
;
edgeIDVector
_edgeIDVector
;
nodeVector
_nodeVector
;
edgeVector
_edgeVector
;
};
}
void
addSuccessor
(
Node
*
);
void
addPredecessor
(
Node
*
);
vector
<
int
>
getSuccessors
(
int
);
vector
<
int
>
getPredecessors
(
int
);
int
getId
();
void
dump
(
raw_ostream
&
,
int
);
protected:
int
_id
;
connectMapType
_preds
;
connectMapType
_succs
;
};
class
Edge
{
public:
typedef
pair
<
unsigned
int
,
unsigned
int
>
timePairType
;
typedef
vector
<
timePairType
>
timeAdvanceVectorType
;
Edge
(
Node
*
,
Node
*
);
Edge
(
Node
*
,
Node
*
,
int
);
void
updateSuspensionTime
(
timePairType
);
int
getId
();
int
getToId
();
int
getFromId
();
timeAdvanceVectorType
getTimeAdvanceVector
();
void
dump
(
raw_ostream
&
,
int
);
protected:
int
_id
;
timeAdvanceVectorType
_timeAdvanceVector
;
Node
*
_from
;
Node
*
_to
;
};
class
Graph
{
public:
typedef
vector
<
int
>
nodeIDVector
;
typedef
vector
<
int
>
edgeIDVector
;
typedef
vector
<
Node
*>
nodeVector
;
typedef
vector
<
Edge
*>
edgeVector
;
typedef
map
<
int
,
Node
*>
nodeMapType
;
typedef
pair
<
int
,
Node
*>
nodePairType
;
typedef
map
<
int
,
Edge
*>
edgeMapType
;
typedef
pair
<
int
,
Edge
*>
edgePairType
;
typedef
pair
<
int
,
int
>
twoNodePairType
;
typedef
pair
<
twoNodePairType
,
Edge
*>
adjPairType
;
typedef
map
<
twoNodePairType
,
Edge
*>
adjMapType
;
typedef
pair
<
int
,
vector
<
Edge
*>>
adjEdgesPairType
;
typedef
map
<
int
,
vector
<
Edge
*>>
adjEdgesMapType
;
Graph
();
~
Graph
();
Node
*
addNode
();
Node
*
addNode
(
int
);
Edge
*
addEdge
(
Node
*
,
Node
*
);
Edge
*
addEdge
(
int
,
int
);
int
getEdgeID
(
Edge
*
);
int
getEdgeID
(
Node
*
,
Node
*
);
int
getEdgeID
(
int
,
int
);
int
getNodeID
(
Node
*
);
Edge
*
getEdge
(
Node
*
,
Node
*
);
Edge
*
getEdge
(
int
,
int
);
Node
*
getNode
(
int
);
vector
<
Edge
*>
getEdgesFromSource
(
int
);
vector
<
Edge
*>
getEdgesFromSource
(
Node
*
);
vector
<
Edge
*>
getEdgesFromDest
(
int
);
vector
<
Edge
*>
getEdgesFromDest
(
Node
*
);
adjMapType
returnAdjList
();
nodeIDVector
returnNodeIDs
();
edgeIDVector
returnEdgeIDs
();
nodeVector
returnNodes
();
edgeVector
returnEdges
();
edgeVector
returnEdgeVector
();
nodeVector
returnNodeVector
();
void
dump
(
raw_ostream
&
,
int
tabn
=
0
);
void
dumpSauto
(
raw_ostream
&
,
int
tabn
=
0
);
protected:
adjMapType
_adjList
;
nodeMapType
_nodeMap
;
edgeMapType
_edgeMap
;
adjEdgesMapType
_adjEdges
;
int
_nNodes
;
int
_nEdges
;
nodeIDVector
_nodeIDVector
;
edgeIDVector
_edgeIDVector
;
nodeVector
_nodeVector
;
edgeVector
_edgeVector
;
};
}
// namespace scpar
#endif
src/EntryFunctionContainer.cpp
View file @
45775cd8
...
...
@@ -3,223 +3,196 @@
using
namespace
scpar
;
EntryFunctionContainer
::~
EntryFunctionContainer
()
{
// DO NOT free anything.
EntryFunctionContainer
::~
EntryFunctionContainer
()
{
// DO NOT free anything.
}
EntryFunctionContainer
::
EntryFunctionContainer
()
:
_entryName
(
"NONE"
),
_procType
(
PROCESS_TYPE
::
NONE
),
_entryMethodDecl
(
nullptr
)
{
EntryFunctionContainer
::
EntryFunctionContainer
()
:
_entryName
(
"NONE"
),
_procType
(
PROCESS_TYPE
::
NONE
),
_entryMethodDecl
(
nullptr
)
{}
}
EntryFunctionContainer
::
EntryFunctionContainer
(
string
n
,
PROCESS_TYPE
p
,
CXXMethodDecl
*
d
,
Stmt
*
s
)
:
_entryName
(
n
),
_procType
(
p
),
_entryMethodDecl
(
d
)
{
}
EntryFunctionContainer
::
EntryFunctionContainer
(
string
n
,
PROCESS_TYPE
p
,
CXXMethodDecl
*
d
,
Stmt
*
s
)
:
_entryName
(
n
),
_procType
(
p
),
_entryMethodDecl
(
d
)
{}
EntryFunctionContainer
::
EntryFunctionContainer
(
const
EntryFunctionContainer
&
from
)
{
_entryName
=
from
.
_entryName
;
_procType
=
from
.
_procType
;
_entryMethodDecl
=
from
.
_entryMethodDecl
;
EntryFunctionContainer
::
EntryFunctionContainer
(
const
EntryFunctionContainer
&
from
)
{
_entryName
=
from
.
_entryName
;
_procType
=
from
.
_procType
;
_entryMethodDecl
=
from
.
_entryMethodDecl
;
}
///////////////////////////////////////////////////////////////////////////////////////////////
string
EntryFunctionContainer
::
getName
()
{
return
_entryName
;
}
string
EntryFunctionContainer
::
getName
()
{
return
_entryName
;
}
FindSensitivity
::
senseMapType
EntryFunctionContainer
::
getSenseMap
()
{
return
_senseMap
;
return
_senseMap
;
}
CXXMethodDecl
*
EntryFunctionContainer
::
getEntryMethod
()
{
return
_entryMethodDecl
;
CXXMethodDecl
*
EntryFunctionContainer
::
getEntryMethod
()
{
return
_entryMethodDecl
;
}
EntryFunctionContainer
::
waitContainerListType
EntryFunctionContainer
::
getWaitCalls
()
{
return
_waitCalls
;
EntryFunctionContainer
::
waitContainerListType
EntryFunctionContainer
::
getWaitCalls
()
{
return
_waitCalls
;
}
EntryFunctionContainer
::
notifyContainerListType
EntryFunctionContainer
::
getNotifyCalls
()
{
return
_notifyCalls
;
EntryFunctionContainer
::
notifyContainerListType
EntryFunctionContainer
::
getNotifyCalls
()
{
return
_notifyCalls
;
}
PROCESS_TYPE
EntryFunctionContainer
::
getProcessType
()
{
return
_procType
;
}
PROCESS_TYPE
EntryFunctionContainer
::
getProcessType
()
{
return
_procType
;
}
SuspensionAutomata
::
susCFGVectorType
EntryFunctionContainer
::
getSusCFG
()
{
return
_susCFG
;
//
return _instanceSusCFGMap[numInstance];
//
return _instanceSusCFGMap[numInstance];
}
SuspensionAutomata
::
transitionVectorType
EntryFunctionContainer
::
getSusAuto
()
{
return
_susAuto
;
//
return _instanceSautoMap[numInstance];
return
_susAuto
;
//
return _instanceSautoMap[numInstance];
}
///////////////////////////////////////////////////////////////////////////////////////////////
void
EntryFunctionContainer
::
setName
(
string
n
)
{
_entryName
=
n
;
}
void
EntryFunctionContainer
::
setName
(
string
n
)
{
_entryName
=
n
;
}
void
EntryFunctionContainer
::
setProcessType
(
PROCESS_TYPE
p
)
{
_procType
=
p
;
}
void
EntryFunctionContainer
::
setProcessType
(
PROCESS_TYPE
p
)
{
_procType
=
p
;
}
void
EntryFunctionContainer
::
setEntryMethod
(
CXXMethodDecl
*
d
)
{
_entryMethodDecl
=
d
;
void
EntryFunctionContainer
::
setEntryMethod
(
CXXMethodDecl
*
d
)
{
_entryMethodDecl
=
d
;
}
void
EntryFunctionContainer
::
addSensitivityInfo
(
FindSensitivity
&
s
)
{
_senseMap
=
s
.
getSenseMap
();
_senseMap
=
s
.
getSenseMap
();
}
void
EntryFunctionContainer
::
addWaits
(
FindWait
&
f
)
{
FindWait
::
waitListType
wcalls
=
f
.
getWaitCalls
();
for
(
FindWait
::
waitListType
::
iterator
it
=
wcalls
.
begin
(),
eit
=
wcalls
.
end
();
it
!=
eit
;
it
++
)
{
// 'it' points to CXXMembercallExpr type.
WaitContainer
*
wc
{
new
WaitContainer
(
f
.
getEntryMethod
(),
(
*
it
)
->
getASTNode
()
)
};
_waitCalls
.
push_back
(
wc
);
}
//_processWaitEventMap = f.getProcessWaitEventMap();
void
EntryFunctionContainer
::
addWaits
(
FindWait
&
f
)
{
FindWait
::
waitListType
wcalls
=
f
.
getWaitCalls
();
for
(
FindWait
::
waitListType
::
iterator
it
=
wcalls
.
begin
(),
eit
=
wcalls
.
end
();
it
!=
eit
;
it
++
)
{
// 'it' points to CXXMembercallExpr type.
WaitContainer
*
wc
{
new
WaitContainer
(
f
.
getEntryMethod
(),
(
*
it
)
->
getASTNode
())};
_waitCalls
.
push_back
(
wc
);
}
//_processWaitEventMap = f.getProcessWaitEventMap();
}
void
EntryFunctionContainer
::
addSusCFGAuto
(
SuspensionAutomata
&
s
)
{
_susCFG
=
s
.
getSusCFG
();
_susAuto
=
s
.
getSauto
();
_susCFG
=
s
.
getSusCFG
();
_susAuto
=
s
.
getSauto
();
/*
if (_instanceSusCFGMap.find(numInstance) == _instanceSusCFGMap.end() && _instanceSautoMap.find(numInstance) == _instanceSautoMap.end()) {
_instanceSusCFGMap.insert(instanceSusCFGPairType(numInstance, s.getSusCFG()));
_instanceSautoMap.insert(instanceSautoPairType(numInstance, s.getSauto()));
}
*/
/*
if (_instanceSusCFGMap.find(numInstance) == _instanceSusCFGMap.end() &&
_instanceSautoMap.find(numInstance) == _instanceSautoMap.end()) {
_instanceSusCFGMap.insert(instanceSusCFGPairType(numInstance,
s.getSusCFG())); _instanceSautoMap.insert(instanceSautoPairType(numInstance,
s.getSauto()));
}
*/
}
void
EntryFunctionContainer
::
addNotifys
(
FindNotify
&
f
)
{
void
EntryFunctionContainer
::
addNotifys
(
FindNotify
&
f
)
{
FindNotify
::
NotifyCallListType
ncalls
=
f
.
getNotifyCallList
();
for
(
FindNotify
::
NotifyCallListType
::
iterator
it
=
ncalls
.
begin
(),
eit
=
ncalls
.
end
();
it
!=
eit
;
it
++
)
{
for
(
FindNotify
::
NotifyCallListType
::
iterator
it
=
ncalls
.
begin
(),
eit
=
ncalls
.
end
()
;
it
!=
eit
;
it
++
)
{
// 'it' points to CXXMembercallExpr type.
NotifyContainer
*
nc
=
new
NotifyContainer
(
f
.
getEntryMethod
(),
*
it
);
NotifyContainer
*
nc
=
new
NotifyContainer
(
f
.
getEntryMethod
(),
*
it
);
_notifyCalls
.
push_back
(
nc
);
}
//_processWaitEventMap = f.getProcessWaitEventMap();
//_processWaitEventMap = f.getProcessWaitEventMap();
}
///////////////////////////////////////////////////////////////////////////////////////////////
void
EntryFunctionContainer
::
dumpSusCFG
(
raw_ostream
&
os
)
{
void
EntryFunctionContainer
::
dumpSusCFG
(
raw_ostream
&
os
)
{
os
<<
"
\n
#############################################"
;
os
<<
"
\n
#############################################"
;
SuspensionAutomata
::
susCFGVectorType
susCFGVector
=
_susCFG
;
for
(
unsigned
int
i
=
0
;
i
<
susCFGVector
.
size
();
i
++
)
{
os
<<
"
\n
Block ID : "
<<
susCFGVector
.
at
(
i
)
->
getBlockID
();
os
<<
"
\n
Block ID : "
<<
susCFGVector
.
at
(
i
)
->
getBlockID
();
os
<<
"
\n
Is Wait Block : "
<<
susCFGVector
.
at
(
i
)
->
isWaitBlock
();
if
(
susCFGVector
.
at
(
i
)
->
getParentBlockID
())
{
os
<<
"
\n
Parent ID : "
<<
susCFGVector
.
at
(
i
)
->
getParentBlockID
();
SusCFG
*
parentBlock
=
susCFGVector
.
at
(
i
)
->
getParentSusCFGBlock
();
os
<<
"
\n
Parent ID : "
<<
susCFGVector
.
at
(
i
)
->
getParentBlockID
();
SusCFG
*
parentBlock
=
susCFGVector
.
at
(
i
)
->
getParentSusCFGBlock
();
os
<<
"
\n
Parent Block ID : "
<<
parentBlock
->
getBlockID
();
os
<<
"
\n
Parent Block ID : "
<<
parentBlock
->
getBlockID
();
os
<<
"
\n
Size of Children : "
<<
parentBlock
->
getChildBlockList
().
size
();
}
vector
<
SusCFG
*
>
predBlocks
=
susCFGVector
.
at
(
i
)
->
getPredBlocks
();
vector
<
SusCFG
*
>
succBlocks
=
susCFGVector
.
at
(
i
)
->
getSuccBlocks
();
vector
<
SusCFG
*>
predBlocks
=
susCFGVector
.
at
(
i
)
->
getPredBlocks
();
vector
<
SusCFG
*>
succBlocks
=
susCFGVector
.
at
(
i
)
->
getSuccBlocks
();
os
<<
"
\n
Predecessor Blocks : "
;
for
(
unsigned
int
j
=
0
;
j
<
predBlocks
.
size
();
j
++
)
{
if
(
predBlocks
.
at
(
j
))
{
os
<<
predBlocks
.
at
(
j
)
->
getBlockID
()
<<
" "
;
if
(
predBlocks
.
at
(
j
))
{
os
<<
predBlocks
.
at
(
j
)
->
getBlockID
()
<<
" "
;
}
}
os
<<
"
\n
Successor Blocks : "
;
for
(
unsigned
int
j
=
0
;
j
<
succBlocks
.
size
();
j
++
)
{
if
(
succBlocks
.
at
(
j
))
{
os
<<
succBlocks
.
at
(
j
)
->
getBlockID
()
<<
" "
;
if
(
succBlocks
.
at
(
j
))
{
os
<<
succBlocks
.
at
(
j
)
->
getBlockID
()
<<
" "
;
}
}
}
}
void
EntryFunctionContainer
::
dumpSauto
(
raw_ostream
&
os
)
{
vector
<
Transition
*
>
transitionVector
=
_susAuto
;
os
<<
"
\n
Size of transitionVector : "
<<
transitionVector
.
size
();
for
(
unsigned
int
i
=
0
;
i
<
transitionVector
.
size
();
i
++
)
{
Transition
*
t
=
transitionVector
.
at
(
i
);
t
->
dump
(
os
);
}
}
void
EntryFunctionContainer
::
dump
(
raw_ostream
&
os
,
int
tabn
)
{
os
<<
"
\n
"
;
for
(
int
i
=
0
;
i
<
tabn
;
i
++
)
{
os
<<
" "
;
}
os
<<
"EntryFunctionContainer '"
<<
getName
()
<<
"' processType '"
;
switch
(
getProcessType
())
{
case
PROCESS_TYPE
::
THREAD
:
os
<<
"SC_THREAD' "
;
break
;
case
PROCESS_TYPE
::
METHOD
:
os
<<
"SC_METHOD' "
;
break
;
case
PROCESS_TYPE
::
CTHREAD
:
os
<<
"SC_CTHREAD' "
;
break
;
default:
os
<<
"NONE' "
;
break
;
}
os
<<
" CXXMethodDecl '"
<<
getEntryMethod
()
<<
"
\n
"
;
int
newTabn
=
++
tabn
;
os
<<
" Wait Calls
\n
"
;
for
(
waitContainerListType
::
iterator
it
=
_waitCalls
.
begin
(),
eit
=
_waitCalls
.
end
();
it
!=
eit
;
it
++
)
{
(
*
it
)
->
dump
(
os
,
newTabn
);
}
os
<<
" Notify Calls
\n
"
;
for
(
notifyContainerListType
::
iterator
it
=
_notifyCalls
.
begin
(),
eit
=
_notifyCalls
.
end
();
it
!=
eit
;
it
++
)
{
(
*
it
)
->
dump
(
os
,
newTabn
);
}
os
<<
"
\n
Suspension CFG"
;
os
<<
"
\n
###############"
;
dumpSusCFG
(
os
);
os
<<
"
\n
###############"
;
os
<<
"
\n
Suspension Automaton"
;
os
<<
"
\n
@@@@@@@@@@@@@@@@"
;
dumpSauto
(
os
);
os
<<
"
\n
@@@@@@@@@@@@@@@@"
;
}
}
}
void
EntryFunctionContainer
::
dumpSauto
(
raw_ostream
&
os
)
{
vector
<
Transition
*>
transitionVector
=
_susAuto
;
os
<<
"
\n
Size of transitionVector : "
<<
transitionVector
.
size
();
for
(
unsigned
int
i
=
0
;
i
<
transitionVector
.
size
();
i
++
)
{
Transition
*
t
=
transitionVector
.
at
(
i
);
t
->
dump
(
os
);
}
}
void
EntryFunctionContainer
::
dump
(
raw_ostream
&
os
,
int
tabn
)
{
os
<<
"
\n
"
;
for
(
int
i
=
0
;
i
<
tabn
;
i
++
)
{
os
<<
" "
;
}
os
<<
"EntryFunctionContainer '"
<<
getName
()
<<
"' processType '"
;
switch
(
getProcessType
())
{
case
PROCESS_TYPE
::
THREAD
:
os
<<
"SC_THREAD' "
;
break
;
case
PROCESS_TYPE
::
METHOD
:
os
<<
"SC_METHOD' "
;
break
;
case
PROCESS_TYPE
::
CTHREAD
:
os
<<
"SC_CTHREAD' "
;
break
;
default:
os
<<
"NONE' "
;
break
;
}
os
<<
" CXXMethodDecl '"
<<
getEntryMethod
()
<<
"
\n
"
;
int
newTabn
=
++
tabn
;
os
<<
" Wait Calls
\n
"
;
for
(
waitContainerListType
::
iterator
it
=
_waitCalls
.
begin
(),
eit
=
_waitCalls
.
end
();
it
!=
eit
;
it
++
)
{
(
*
it
)
->
dump
(
os
,
newTabn
);
}
os
<<
" Notify Calls
\n
"
;
for
(
notifyContainerListType
::
iterator
it
=
_notifyCalls
.
begin
(),
eit
=
_notifyCalls
.
end
();
it
!=
eit
;
it
++
)
{
(
*
it
)
->
dump
(
os
,
newTabn
);
}
os
<<
"
\n
Suspension CFG"
;
os
<<
"
\n
###############"
;
dumpSusCFG
(
os
);
os
<<
"
\n
###############"
;
os
<<
"
\n
Suspension Automaton"
;