Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
caesr-pub
systemc-clang
Commits
0202174c
Commit
0202174c
authored
Feb 15, 2019
by
rmrf
Browse files
PortDecl json dump
parent
851f1c1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/PortDecl.cpp
View file @
0202174c
...
...
@@ -29,10 +29,8 @@ string PortDecl::getName() const { return port_name_; }
FindTemplateTypes
*
PortDecl
::
getTemplateType
()
{
return
template_type_
;
}
void
PortDecl
::
dump
(
llvm
::
raw_ostream
&
os
,
int
tabn
)
{
// os << "PortDecl " << this << " '" << port_name_ << "' FindTemplateTypes "
// << template_type_;
os
<<
"Port name: "
<<
port_name_
<<
" "
;
template_type_
->
printTemplateArguments
(
os
);
//os << "Port name: " << port_name_ << " ";
//template_type_->printTemplateArguments(os);
dump_json
();
}
...
...
@@ -40,8 +38,17 @@ void PortDecl::dump(llvm::raw_ostream &os, int tabn) {
json
PortDecl
::
dump_json
()
{
json
port_j
;
port_j
[
"module_name"
]
=
getName
();
//port_j["template_type"]
port_j
[
"port_name"
]
=
getName
();
// Template arguments
auto
template_args
{
template_type_
->
getTemplateArgumentsType
()
};
port_j
[
"port_type"
]
=
template_args
[
0
].
getTypeName
();
template_args
.
erase
(
begin
(
template_args
)
);
for
(
auto
ait
=
begin
(
template_args
);
ait
!=
end
(
template_args
);
++
ait
)
{
port_j
[
"port_arguments"
].
push_back
(
ait
->
getTypeName
()
);
}
std
::
cout
<<
port_j
.
dump
(
4
);
return
port_j
;
}
src/PortDecl.h
View file @
0202174c
...
...
@@ -34,9 +34,11 @@ public:
void
dump
(
raw_ostream
&
,
int
tabn
=
0
);
json
dump_json
();
private:
// Name of the port
string
port_name_
;
// This holds the types for the port
FindTemplateTypes
*
template_type_
;
};
}
// namespace scpar
...
...
src/ProcessDecl.h
View file @
0202174c
...
...
@@ -13,7 +13,7 @@ namespace scpar {
using
namespace
std
;
using
namespace
clang
;
using
json
=
nlohmann
::
json
;
using
json
=
nlohmann
::
json
;
class
ProcessDecl
{
public:
...
...
@@ -36,10 +36,13 @@ public:
protected:
// Process information
string
process_type_
;
// Name of the entry function
string
entry_name_
;
// Each process can have 1 entry function.
CXXMethodDecl
*
entry_method_decl_
;
// This is a container that holds information about the
// entry function.
EntryFunctionContainer
*
entry_function_ptr_
;
};
// End class ProcessDecl
...
...
src/SystemCClang.cpp
View file @
0202174c
...
...
@@ -171,9 +171,9 @@ _systemcModel->addNetlist(findNetlist);
llvm
::
errs
());
if
(
suspensionAutomata
.
initialize
())
{
suspensionAutomata
.
genSusCFG
();
suspensionAutomata
.
dumpSusCFG
();
//
suspensionAutomata.dumpSusCFG();
suspensionAutomata
.
genSauto
();
suspensionAutomata
.
dumpSauto
();
//
suspensionAutomata.dumpSauto();
entryFunctionContainer
.
at
(
j
)
->
addSusCFGAuto
(
suspensionAutomata
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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