Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mbe-tools
TTool
Commits
b164a60f
Commit
b164a60f
authored
Mar 14, 2019
by
apvrille
Browse files
Update on MUX management
parent
bc8b2e36
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/tmltranslator/tonetwork/TaskMUXAppDispatch.java
View file @
b164a60f
...
...
@@ -41,6 +41,7 @@ package tmltranslator.tonetwork;
import
tmltranslator.*
;
import
java.util.List
;
import
java.util.Vector
;
...
...
@@ -52,16 +53,14 @@ import java.util.Vector;
* @version 1.0 11/03/2019
*/
public
class
TaskMUXAppDispatch
extends
TMLTask
{
protected
int
nbOfApps
;
public
TaskMUXAppDispatch
(
String
name
,
Object
referenceToClass
,
Object
referenceToActivityDiagram
)
{
super
(
name
,
referenceToClass
,
referenceToActivityDiagram
);
}
// Output Channels are given in the order of VCs
public
void
generate
(
int
nbOfApps
,
Vector
<
TMLEvent
>
inputEvents
,
TMLEvent
outputEvent
)
{
public
void
generate
(
List
<
TMLEvent
>
inputEvents
,
TMLEvent
outputEvent
)
{
this
.
nbOfApps
=
nbOfApps
;
// Attributes
TMLAttribute
pktlen
=
new
TMLAttribute
(
"pktlen"
,
"pktlen"
,
new
TMLType
(
TMLType
.
NATURAL
),
"0"
);
...
...
@@ -95,7 +94,7 @@ public class TaskMUXAppDispatch extends TMLTask {
// Branch for each app
for
(
int
i
=
0
;
i
<
nbOfApps
;
i
++)
{
for
(
int
i
=
0
;
i
<
inputEvents
.
size
()
;
i
++)
{
TMLWaitEvent
waitEvt
=
new
TMLWaitEvent
(
"PacketEvent"
+
i
,
referenceObject
);
waitEvt
.
setEvent
(
inputEvents
.
get
(
i
));
waitEvt
.
addParam
(
"pktlen"
);
...
...
src/main/java/tmltranslator/tonetwork/TranslatedRouter.java
View file @
b164a60f
...
...
@@ -39,9 +39,11 @@
package
tmltranslator.tonetwork
;
import
myutil.TraceManager
;
import
tmltranslator.*
;
import
ui.TGComponent
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Vector
;
...
...
@@ -96,6 +98,78 @@ public class TranslatedRouter<E> {
String
nameOfExecNode
=
noc
.
getHwExecutionNode
(
xPos
,
yPos
);
HwExecutionNode
execNode
=
tmlmap
.
getTMLArchitecture
().
getHwExecutionNodeByName
(
nameOfExecNode
);
if
(
nameOfExecNode
==
null
)
{
nameOfExecNode
=
"fakeCPU_"
+
xPos
+
"_"
+
yPos
;
}
if
(
execNode
==
null
)
{
TraceManager
.
addDev
(
"Could NOT find an exec node for ("
+
xPos
+
","
+
yPos
+
")"
);
}
else
{
TraceManager
.
addDev
(
"Found an exec node for ("
+
xPos
+
","
+
yPos
+
"): "
+
execNode
.
getName
());
}
// Then, we need to find the channels starting from/arriving to a task mapped on this execNode
Vector
<
TMLChannel
>
inputChannels
=
new
Vector
<>();
Vector
<
TMLChannel
>
outputChannels
=
new
Vector
<>();
if
(
execNode
!=
null
)
{
for
(
TMLChannel
ch:
channelsViaNoc
)
{
TMLTask
origin
=
ch
.
getOriginTask
();
TMLTask
destination
=
ch
.
getDestinationTask
();
if
(
origin
!=
null
)
{
// find on which CPU is mapped this task
HwNode
cpuOfOrigin
=
tmlmap
.
getHwNodeOf
(
origin
);
if
(
cpuOfOrigin
==
execNode
)
{
TraceManager
.
addDev
(
"Found an output channel:"
+
ch
.
getName
());
outputChannels
.
add
(
ch
);
}
}
if
(
destination
!=
null
)
{
// find on which CPU is mapped this task
HwNode
cpuOfDestination
=
tmlmap
.
getHwNodeOf
(
destination
);
if
(
cpuOfDestination
==
execNode
)
{
TraceManager
.
addDev
(
"Found an input channel:"
+
ch
.
getName
());
inputChannels
.
add
(
ch
);
}
}
}
}
// Now that we know all channels, we can generate the MUX tasks
// We need one event par outputChannel
HashMap
<
TMLChannel
,
TMLEvent
>
mapOfOutputChannels
=
new
HashMap
<>();
Vector
<
TMLEvent
>
inputEventsOfMUX
=
new
Vector
<>();
for
(
TMLChannel
chan:
outputChannels
)
{
TMLEvent
outputEventOfMux
=
new
TMLEvent
(
"EventMUXof"
+
chan
.
getName
(),
null
,
8
,
true
);
mapOfOutputChannels
.
put
(
chan
,
outputEventOfMux
);
inputEventsOfMUX
.
add
(
outputEventOfMux
);
tmlm
.
addEvent
(
outputEventOfMux
);
}
// We also need an output event for MUX / NI_IN
TMLEvent
eventForMUX_and_NI_IN
=
new
TMLEvent
(
"EventBetweenMUXandNI_IN_for_"
+
nameOfExecNode
,
null
,
8
,
true
);
tmlm
.
addEvent
(
eventForMUX_and_NI_IN
);
// We can create the MUX task
TaskMUXAppDispatch
muxTask
=
new
TaskMUXAppDispatch
(
"MUXof"
+
nameOfExecNode
,
null
,
null
);
tmlm
.
addTask
(
muxTask
);
muxTask
.
generate
(
inputEventsOfMUX
,
eventForMUX_and_NI_IN
);
// Finally, we need to modify the src apps with the new event, and modifying the channel as well to write in the local memory
// All done for MUX
// VC DISPATCHERS
// One dispatcher per port
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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