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
2353efa6
Commit
2353efa6
authored
8 years ago
by
Daniela Genius
Browse files
Options
Downloads
Patches
Plain Diff
minor updates, Code.java reads cpu from Makefile.forsoclib
parent
027d3a15
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java
+30
-26
30 additions, 26 deletions
src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java
with
30 additions
and
26 deletions
src/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java
+
30
−
26
View file @
2353efa6
...
...
@@ -238,16 +238,10 @@ public class TasksAndMainGenerator {
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
"_status.wptr = 0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
"_status.usage = 0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
"_status.lock = 0;"
+
CR2
);
//DG 10.0.2 width=1??
//mainFile.appendToMainCode(getChannelName(ar, i) + ".width = 1;" + CR);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".width = 4;"
+
CR
);
//DG 16.02.
AvatarSignal
sig
=
ar
.
getSignal1
(
0
);
//DG boucle?
int
nbParams
=
sig
.
getNbParams
();
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".depth = "
+(
nbParams
*
4
)+
";"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".gdepth = "
+
getChannelName
(
ar
,
i
)+
".depth;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".width = 1;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".depth = 1;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".gdepth = 1;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".buffer = "
+
getChannelName
(
ar
,
i
)+
"_data;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".status = &"
+
getChannelName
(
ar
,
i
)+
"_status;"
+
CR2
);
...
...
@@ -262,7 +256,16 @@ public class TasksAndMainGenerator {
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)+
".status->rptr=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)+
".status->usage=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".status->wptr =0;"
+
CR
);
//mainFile.appendToBeforeMainCode("uint32_t const "+ getChannelName(ar, i)+"_lock LOCK"+i+";" + CR);
//DG 26.01.2017 corrected gros bug i remplace
/* mainFile.appendToBeforeMainCode("uint32_t const "+ getChannelName(ar, i)+"_lock LOCK"+i+";" + CR);
mainFile.appendToBeforeMainCode("struct mwmr_status_s "+ getChannelName(ar, i) +"_status CHANNEL"+j+";" + CR);
mainFile.appendToBeforeMainCode("uint8_t "+getChannelName(ar, i) +"_data[32] CHANNEL"+i+";" + CR);
mainFile.appendToBeforeMainCode("struct mwmr_s "+getChannelName(ar, i) +" CHANNEL"+i+";" + CR2);*/
mainFile
.
appendToBeforeMainCode
(
"uint32_t const "
+
getChannelName
(
ar
,
i
)+
"_lock LOCK"
+
ar
.
getId
()+
";"
+
CR
);
mainFile
.
appendToBeforeMainCode
(
"struct mwmr_status_s "
+
getChannelName
(
ar
,
i
)
+
"_status CHANNEL"
+
ar
.
getId
()+
";"
+
CR
);
...
...
@@ -294,7 +297,7 @@ public class TasksAndMainGenerator {
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
"_status.usage = 0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
"_status.lock = 0;"
+
CR2
);
//DG 10.2. width=1??
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".width = 1;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".depth = "
+
ar
.
getSizeOfFIFO
()+
"1;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".gdepth = "
+
getChannelName
(
ar
,
i
)+
".depth;"
+
CR
);
//gdepth = depth for sync fifo
...
...
@@ -315,20 +318,25 @@ public class TasksAndMainGenerator {
/* force init because mutekh initializer does not work her */
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".status =&"
+
getChannelName
(
ar
,
i
)+
"_status;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".status->lock=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)+
".status->rptr=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)+
".status->usage=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)+
".status->wptr=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)
+
".status->lock=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)+
".status->rptr=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)+
".status->usage=0;"
+
CR
);
mainFile
.
appendToMainCode
(
getChannelName
(
ar
,
i
)+
".status->wptr=0;"
+
CR
);
int
seg_no
=
0
;
/* mainFile.appendToBeforeMainCode("uint32_t const "+ getChannelName(ar, i)+"_lock LOCK"+i+";" + CR);
mainFile.appendToBeforeMainCode("struct mwmr_status_s "+ getChannelName(ar, i) +"_status CHANNEL"+i+";" + CR);
mainFile.appendToBeforeMainCode("uint8_t "+getChannelName(ar, i) +"_data[32] CHANNEL"+i+";" + CR);
mainFile.appendToBeforeMainCode("struct mwmr_s "+getChannelName(ar, i) + " CHANNEL"+i+";" + CR2);*/
int
seg_no
=
0
;
mainFile
.
appendToBeforeMainCode
(
"uint32_t const "
+
getChannelName
(
ar
,
i
)+
"_lock LOCK"
+
ar
.
getId
()+
";"
+
CR
);
mainFile
.
appendToBeforeMainCode
(
"struct mwmr_status_s "
+
getChannelName
(
ar
,
i
)
+
"_status CHANNEL"
+
ar
.
getId
()+
";"
+
CR
);
mainFile
.
appendToBeforeMainCode
(
"uint8_t "
+
getChannelName
(
ar
,
i
)
+
"_data[32] CHANNEL"
+
ar
.
getId
()+
";"
+
CR
);
mainFile
.
appendToBeforeMainCode
(
"struct mwmr_s "
+
getChannelName
(
ar
,
i
)
+
" CHANNEL"
+
ar
.
getId
()+
";"
+
CR2
);
//j++;
}
}
}
...
...
@@ -342,23 +350,19 @@ public class TasksAndMainGenerator {
return
task
.
getCPUNo
();
}
}
return
-
1
;
return
0
;
}
public
void
makeTasks
()
{
for
(
AvatarBlock
block:
avspec
.
getListOfBlocks
())
{
if
(
FindCPUidFromTask
(
block
)!=-
1
)
makeTask
(
block
,
FindCPUidFromTask
(
block
));
else
{
System
.
out
.
println
(
"Warning: Unmapped Block "
+
block
.
getName
());
}
makeTask
(
block
,
FindCPUidFromTask
(
block
));
}
}
public
void
makeTask
(
AvatarBlock
block
,
int
cpuId
)
{
TaskFileSoclib
taskFile
=
new
TaskFileSoclib
(
block
.
getName
(),
cpuId
);
//taskFile.addToHeaderCode("#include \"main.h\"" + CR);
//taskFile.addToMainCode("#include \"" + block.getName() + ".h\"");
if
(
includeUserCode
)
{
String
tmp
=
block
.
getGlobalCode
();
if
(
tmp
!=
null
)
{
...
...
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