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
Commits
5471ce9a
Commit
5471ce9a
authored
8 years ago
by
Dominique Blouin
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused stuff + proper use of static constants
parent
315b5445
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tmltranslator/tomappingsystemc2/TML2MappingSystemC.java
+20
-19
20 additions, 19 deletions
src/tmltranslator/tomappingsystemc2/TML2MappingSystemC.java
with
20 additions
and
19 deletions
src/tmltranslator/tomappingsystemc2/TML2MappingSystemC.java
+
20
−
19
View file @
5471ce9a
...
...
@@ -56,12 +56,12 @@ import tepe.*;
public
class
TML2MappingSystemC
{
private
final
static
String
CR
=
"\n"
;
private
final
static
String
CR2
=
"\n\n"
;
//
private final static String CR2 = "\n\n";
private
final
static
String
SCCR
=
";\n"
;
private
final
static
String
EFCR
=
"}\n"
;
private
final
static
String
EFCR2
=
"}\n\n"
;
private
final
static
String
EF
=
"}"
;
private
final
static
int
MAX_EVENT
=
1024
;
//
private final static String EFCR = "}\n";
//
private final static String EFCR2 = "}\n\n";
//
private final static String EF = "}";
//
private final static int MAX_EVENT = 1024;
private
TMLModeling
tmlmodeling
;
private
TMLMapping
tmlmapping
;
...
...
@@ -202,12 +202,12 @@ public class TML2MappingSystemC {
}
if
(
node
instanceof
HwA
)
{
HwA
hwaNode
=
(
HwA
)
node
;
declaration
+=
"RRScheduler* "
+
hwaNode
.
getName
()
+
"_scheduler = new RRScheduler(\""
+
hwaNode
.
getName
()
+
"_RRSched\", 0, "
+
(
tmlmapping
.
getTMLArchitecture
().
getMasterClockFrequency
()
*
hwaNode
.
DEFAULT_SLICE_TIME
)
+
", "
+
(
int
)
Math
.
ceil
((
float
)(
hwaNode
.
clockRatio
*
Math
.
max
(
hwaNode
.
execiTime
,
hwaNode
.
execcTime
)
*
(
hwaNode
.
DEFAULT_BRANCHING_PREDICTION_PENALTY
*
hwaNode
.
DEFAULT_PIPELINE_SIZE
+
100
-
hwaNode
.
DEFAULT_BRANCHING_PREDICTION_PENALTY
))/
100
)
+
" ) "
+
SCCR
;
declaration
+=
"RRScheduler* "
+
hwaNode
.
getName
()
+
"_scheduler = new RRScheduler(\""
+
hwaNode
.
getName
()
+
"_RRSched\", 0, "
+
(
tmlmapping
.
getTMLArchitecture
().
getMasterClockFrequency
()
*
HwA
.
DEFAULT_SLICE_TIME
)
+
", "
+
(
int
)
Math
.
ceil
((
float
)(
hwaNode
.
clockRatio
*
Math
.
max
(
hwaNode
.
execiTime
,
hwaNode
.
execcTime
)
*
(
HwA
.
DEFAULT_BRANCHING_PREDICTION_PENALTY
*
HwA
.
DEFAULT_PIPELINE_SIZE
+
100
-
HwA
.
DEFAULT_BRANCHING_PREDICTION_PENALTY
))/
100
)
+
" ) "
+
SCCR
;
for
(
int
cores
=
0
;
cores
<
1
;
cores
++){
//if (tmlmapping.isAUsedHwNode(node)) {
declaration
+=
"CPU* "
+
hwaNode
.
getName
()
+
cores
+
" = new SingleCoreCPU("
+
hwaNode
.
getID
()
+
", \""
+
hwaNode
.
getName
()
+
"_"
+
cores
+
"\", "
+
hwaNode
.
getName
()
+
"_scheduler"
+
", "
;
declaration
+=
hwaNode
.
clockRatio
+
", "
+
hwaNode
.
execiTime
+
", "
+
hwaNode
.
execcTime
+
", "
+
hwaNode
.
DEFAULT_PIPELINE_SIZE
+
", "
+
hwaNode
.
DEFAULT_TASK_SWITCHING_TIME
+
", "
+
hwaNode
.
DEFAULT_BRANCHING_PREDICTION_PENALTY
+
", "
+
hwaNode
.
DEFAULT_GO_IDLE_TIME
+
", "
+
hwaNode
.
DEFAULT_MAX_CONSECUTIVE_IDLE_CYCLES
+
", "
+
hwaNode
.
byteDataSize
+
")"
+
SCCR
;
declaration
+=
hwaNode
.
clockRatio
+
", "
+
hwaNode
.
execiTime
+
", "
+
hwaNode
.
execcTime
+
", "
+
HwA
.
DEFAULT_PIPELINE_SIZE
+
", "
+
HwA
.
DEFAULT_TASK_SWITCHING_TIME
+
", "
+
HwA
.
DEFAULT_BRANCHING_PREDICTION_PENALTY
+
", "
+
HwA
.
DEFAULT_GO_IDLE_TIME
+
", "
+
HwA
.
DEFAULT_MAX_CONSECUTIVE_IDLE_CYCLES
+
", "
+
hwaNode
.
byteDataSize
+
")"
+
SCCR
;
if
(
cores
!=
0
)
declaration
+=
node
.
getName
()
+
cores
+
"->setScheduler("
+
hwaNode
.
getName
()
+
"_scheduler,false)"
+
SCCR
;
declaration
+=
"addCPU("
+
node
.
getName
()
+
cores
+
")"
+
SCCR
;
}
...
...
@@ -408,7 +408,7 @@ public class TML2MappingSystemC {
//Declaration of Tasks
ListIterator
iterator
=
tmlmapping
.
getNodes
().
listIterator
();
ListIterator
<
HwExecutionNode
>
iterator
=
tmlmapping
.
getNodes
().
listIterator
();
declaration
+=
"//Declaration of tasks"
+
CR
;
HwExecutionNode
node
;
//for(TMLTask task: tmlmodeling.getTasks()) {
...
...
@@ -418,8 +418,8 @@ public class TML2MappingSystemC {
int
[]
aStatistics
=
new
int
[
8
];
Set
<
Integer
>
mappedChannels
=
new
HashSet
<
Integer
>();
for
(
TMLTask
task:
tmlmapping
.
getMappedTasks
()){
node
=
(
HwExecutionNode
)
iterator
.
next
();
int
noOfCores
;
node
=
iterator
.
next
();
//
int noOfCores;
declaration
+=
task
.
getName
()
+
"* task__"
+
task
.
getName
()
+
" = new "
+
task
.
getName
()
+
"("
+
task
.
getID
()
+
","
+
task
.
getPriority
()
+
",\""
+
task
.
getName
()
+
"\", array("
;
if
(
node
instanceof
HwCPU
){
...
...
@@ -468,7 +468,8 @@ public class TML2MappingSystemC {
declaration
+=
"addTask(task__"
+
task
.
getName
()
+
")"
+
SCCR
;
}
//int[] aStatistics = new int[8];
declaration
+=
"\n}\n\n"
;
declaration
+=
"}\n\n"
;
//Declaration of TEPEs
declaration
+=
"void generateTEPEs(){"
+
CR
;
...
...
@@ -701,14 +702,14 @@ public class TML2MappingSystemC {
return
false
;
}
private
String
getIdentifierNameByID
(
int
id
){
for
(
MappedSystemCTask
task:
tasks
){
String
tmp
=
task
.
getIdentifierNameByID
(
id
);
if
(
tmp
!=
null
)
return
tmp
;
}
return
null
;
}
//
private String getIdentifierNameByID(int id){
//
//
for(MappedSystemCTask task: tasks){
//
String tmp = task.getIdentifierNameByID(id);
//
if (tmp!=null) return tmp;
//
}
//
return null;
//
}
/*private void generateEBRDDs(){
for(EBRDD ebrdd: ebrdds){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment