Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Merge requests
!226
New lip6
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
New lip6
new-lip6
into
master
Overview
0
Commits
5
Pipelines
0
Changes
33
Merged
Daniela Genius
requested to merge
new-lip6
into
master
5 years ago
Overview
0
Commits
5
Pipelines
0
Changes
33
Expand
manual merge completed
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
d9983222
5 commits,
5 years ago
33 files
+
3086
−
443
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
33
Search (e.g. *.vue) (Ctrl+P)
src/main/java/syscamstranslator/toSysCAMS/ClusterCode.java
+
23
−
9
Options
@@ -73,6 +73,8 @@ public class ClusterCode {
if
(
cluster
!=
null
)
{
LinkedList
<
SysCAMSTBlockTDF
>
tdf
=
cluster
.
getBlockTDF
();
LinkedList
<
SysCAMSTBlockDE
>
de
=
cluster
.
getBlockDE
();
LinkedList
<
SysCAMSTClock
>
clock
=
cluster
.
getClock
();
corpsCluster
=
"// Simulation entry point."
+
CR
+
"int sc_main(int argc, char *argv[]) {"
+
CR2
+
"\tusing namespace sc_core;"
+
CR
+
"\tusing namespace sca_util;"
+
CR2
;
@@ -83,54 +85,63 @@ public class ClusterCode {
if
((
c
.
get_p1
().
getComponent
()
instanceof
SysCAMSTPortTDF
&&
c
.
get_p2
().
getComponent
()
instanceof
SysCAMSTPortTDF
)
||
(
c
.
get_p1
().
getComponent
()
instanceof
SysCAMSTPortTDF
&&
c
.
get_p2
().
getComponent
()
instanceof
SysCAMSTPortTDF
))
{
if
(
c
.
getName
().
equals
(
""
))
{
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortTDF
)
c
.
get_p1
().
getComponent
()).
getTDFType
()
+
"> "
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortTDF
)
c
.
get_p1
().
getComponent
()).
getTDFType
()
+
"
> "
+
"sig_"
+
nb_con
+
";"
+
CR
;
names
.
add
(
"sig_"
+
nb_con
);
nb_con
++;
}
else
{
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortTDF
)
c
.
get_p1
().
getComponent
()).
getTDFType
()
+
"> "
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortTDF
)
c
.
get_p1
().
getComponent
()).
getTDFType
()
+
"
> "
+
c
.
getName
()
+
";"
+
CR
;
names
.
add
(
c
.
getName
());
}
}
else
if
((
c
.
get_p1
().
getComponent
()
instanceof
SysCAMSTPortConverter
&&
c
.
get_p2
().
getComponent
()
instanceof
SysCAMSTPortDE
))
{
if
(
c
.
getName
().
equals
(
""
))
{
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortConverter
)
c
.
get_p1
().
getComponent
()).
getConvType
()
+
"> "
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortConverter
)
c
.
get_p1
().
getComponent
()).
getConvType
()
+
"
> "
+
"sig_"
+
nb_con
+
";"
+
CR
;
names
.
add
(
"sig_"
+
nb_con
);
nb_con
++;
}
else
{
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortConverter
)
c
.
get_p1
().
getComponent
()).
getConvType
()
+
"> "
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortConverter
)
c
.
get_p1
().
getComponent
()).
getConvType
()
+
"
> "
+
c
.
getName
()
+
";"
+
CR
;
names
.
add
(
c
.
getName
());
}
}
else
if
((
c
.
get_p2
().
getComponent
()
instanceof
SysCAMSTPortConverter
&&
c
.
get_p1
().
getComponent
()
instanceof
SysCAMSTPortDE
))
{
if
(
c
.
getName
().
equals
(
""
))
{
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortConverter
)
c
.
get_p2
().
getComponent
()).
getConvType
()
+
"> "
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortConverter
)
c
.
get_p2
().
getComponent
()).
getConvType
()
+
"
> "
+
"sig_"
+
nb_con
+
";"
+
CR
;
names
.
add
(
"sig_"
+
nb_con
);
nb_con
++;
}
else
{
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortConverter
)
c
.
get_p2
().
getComponent
()).
getConvType
()
+
"> "
corpsCluster
=
corpsCluster
+
"\tsca_tdf::sca_signal<"
+
((
SysCAMSTPortConverter
)
c
.
get_p2
().
getComponent
()).
getConvType
()
+
"
> "
+
c
.
getName
()
+
";"
+
CR
;
names
.
add
(
c
.
getName
());
}
}
else
if
((
c
.
get_p1
().
getComponent
()
instanceof
SysCAMSTPortDE
&&
c
.
get_p2
().
getComponent
()
instanceof
SysCAMSTPortDE
)
||
(
c
.
get_p2
().
getComponent
()
instanceof
SysCAMSTPortDE
&&
c
.
get_p1
().
getComponent
()
instanceof
SysCAMSTPortDE
))
{
if
(
c
.
getName
().
equals
(
""
))
{
corpsCluster
=
corpsCluster
+
"\tsc_core::sc_signal<"
+
((
SysCAMSTPortDE
)
c
.
get_p1
().
getComponent
()).
getDEType
()
+
"> "
corpsCluster
=
corpsCluster
+
"\tsc_core::sc_signal<"
+
((
SysCAMSTPortDE
)
c
.
get_p1
().
getComponent
()).
getDEType
()
+
"
> "
+
"sig_"
+
nb_con
+
";"
+
CR
;
names
.
add
(
"sig_"
+
nb_con
);
nb_con
++;
}
else
{
corpsCluster
=
corpsCluster
+
"\tsc_core::sc_signal<"
+
((
SysCAMSTPortDE
)
c
.
get_p1
().
getComponent
()).
getDEType
()
+
"> "
corpsCluster
=
corpsCluster
+
"\tsc_core::sc_signal<"
+
((
SysCAMSTPortDE
)
c
.
get_p1
().
getComponent
()).
getDEType
()
+
"
> "
+
c
.
getName
()
+
";"
+
CR
;
names
.
add
(
c
.
getName
());
}
}
}
corpsCluster
=
corpsCluster
+
CR
+
"\t// Instantiate headers files as well as bind their ports to the signal."
+
CR
;
corpsCluster
=
corpsCluster
+
CR
+
"\t// Instantiate clocks."
+
CR
;
for
(
SysCAMSTClock
t
:
clock
)
{
corpsCluster
=
corpsCluster
+
"\t sc_clock "
+
t
.
getName
()
+
" (\""
+
t
.
getName
()
+
"\","
+
t
.
getFrequency
()+
","
+
t
.
getUnit
()+
","
+
t
.
getDutyCycle
()+
","
+
t
.
getStartTime
()+
","
+
t
.
getUnit
()+
","
+
t
.
getPosFirst
()+
");"
+
CR
;
}
corpsCluster
=
corpsCluster
+
CR
+
"\t// Instantiate headers files as well as bind their ports to the signal."
+
CR
;
for
(
SysCAMSTBlockTDF
t
:
tdf
)
{
corpsCluster
=
corpsCluster
+
"\t"
+
t
.
getName
()
+
" "
+
t
.
getName
()
+
"_"
+
nb_block
+
"(\""
+
t
.
getName
()
+
"_"
+
nb_block
+
"\");"
+
CR
;
@@ -202,6 +213,9 @@ public class ClusterCode {
nb_block
++;
}
corpsCluster
=
corpsCluster
+
"\t// Configure signal tracing."
+
CR
+
"\tsca_trace_file* tfp = sca_create_tabular_trace_file(\""
+
cluster
.
getClusterName
()
+
"_tb\");"
+
CR
;
Loading