Skip to content
Snippets Groups Projects
Commit d705d033 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Correctly attach periods to tasks & fix shmem data size calculation

parent 310ce62e
No related branches found
No related tags found
No related merge requests found
SharedMemAccessLatencyDecoder.java 0ea12b74cddb81fea88bef89bf2f07eef3986985 YELLOW
SharedMemAccessLatencyEncoding.java cea67a167f2c613ed357f181732886eeb97cc2a6 YELLOW
SharedMemAccessLatencyEncoding.java 4fa90cc9a24292fa22d09c51c0f99e31d792dc26 YELLOW
......@@ -32,10 +32,13 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IMemAccessTask.AER_MEM_
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ISignalAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.taskgraph.TaskGraph;
import org.fortiss.af3.exploration.alg.feature.scheduling.TimeSlot;
import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.TaskGraphEncoding;
import org.fortiss.af3.exploration.alg.feature.taskmapping.variable.TaskExUMappingEncoding;
import org.fortiss.af3.schedule.model.ResourceAllocation;
/**
* Transforms the internal {@link TimeSlot} representation into {@link ResourceAllocation}s of AF3.
*
* @author diewald
*/
......@@ -87,11 +90,16 @@ public class SharedMemAccessLatencyEncoding extends PhenotypeBase {
* Hereby, the communication from the sender {@link IExecutionUnitAdapter} suffers from
* interference from the given set of {@link IExecutionUnitAdapter}s.
*/
private BigDecimal getLatencyWithInterference(ITaskAdapter task, TaskGraph tg,
private BigDecimal getLatencyWithInterference(IMemAccessTask task, TaskGraph tg,
IExecutionUnitAdapter readerUnit,
Collection<IExecutionUnitAdapter> interferingExecUnits) {
Collection<ISignalAdapter> incomingSignals = tg.getSourceSignals(task);
long dataSize = getDataSizeOf(incomingSignals);
Collection<ISignalAdapter> signals;
if(task.getAERType() == AER_MEM_TYPE.ACQUISITION) {
signals = tg.getSourceSignals(task);
} else {
signals = tg.getSinkSignals(task);
}
long dataSize = getDataSizeOf(signals);
// We do not consider the transmission time as of now
// Double baseTransmissionTime = commResources.stream()
......
MessageToRouteTransformation.java 8346432c100cc9b54a67557243d15508f4c74d40 YELLOW
ResourceAllocationTransformation.java b1fab315792b66eb6bc1e1930f591b6f984f8553 RED
ResourceAllocationTransformation.java ca1ba54719ea8aeaafbd1f2fd6f6c1519d49e575 YELLOW
......@@ -83,11 +83,13 @@ public class ResourceAllocationTransformation
// TODO(AD): This casting is actually not needed. It seems that the compiler is going mad
// here due to the raw StricTTSchedule parameter.
for(TimeSlot timeSlot : (Collection<TimeSlot>)(Collection<?>)schedule.getTimeSlots()) {
double period = 0.0;
// Element creation & association.
IModelElement schedElement = null;
if(timeSlot.getDeployedRequester() instanceof TaskMappingEntry) {
ITaskAdapter schedTask = timeSlot.getDeployedRequester().getSource();
schedElement = schedTask.getObject(IModelElement.class);
period = schedTask.getPeriod();
} else {
// TODO(AD): The deployed requester is actually a Segment. Here, the
// TDMABusScheduler must be updated to operate on segments and the segment must be a
......@@ -108,9 +110,8 @@ public class ResourceAllocationTransformation
resAlloc.setSchedulableEntity(schedEntity);
// Timing information.
// TODO(AD): Here, we need to set the periods of the tasks.
PeriodicTimeTrigger trigger = createPeriodicTimeTrigger(
valueOf(timeSlot.getIteration()), valueOf(timeSlot.getStartTime()));
PeriodicTimeTrigger trigger =
createPeriodicTimeTrigger(valueOf(period), valueOf(timeSlot.getStartTime()));
resAlloc.setTrigger(trigger);
resAlloc.setDuration(valueOf(timeSlot.getDuration()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment