Commit e3d5e1e5 authored by Simon Barner's avatar Simon Barner
Browse files

RED

Issue-Ref: 4068
Issue-Url: https://af3-developer.fortiss.org/issues/4068

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 735a0862
AnnotationGenerationUtils.java f99734f382bdddf1195994e615b133f7b7b4a34e YELLOW
AnnotationGenerationUtils.java 7bea1d5b363bc5649e6e3c5057a00f87d3224e6f RED
CompArchGeneratonUtil.java 0f1e3c048884fa4df6a35b6a110c46da58f59857 GREEN
DseUtils.java 7a93f643bcc25adc9df3c53a1c8e74f89eda4608 GREEN
FileWriterUtil.java 4a95559f571d41fa44e6236fc055ab5baac7c384 GREEN
......
......@@ -70,8 +70,12 @@ public class AnnotationGenerationUtils {
* based on a copy of the given architectures The returned set is larger than the initial one.
* The added annotation values are generated randomly.
*/
// TODO (SB): IMO the method should act according to its name actually expand the provided
// fileProjects. I.e., there is no need for a return value. However, the fileProjects parameter
// should be documented accordingly.
public static Collection<FileProject> expandArchitecturesByAnnotations(
Collection<FileProject> fileProjects) throws Exception {
// Add the expansion code for other
fileProjects = definePlatformArchitectureAnnotations(fileProjects);
fileProjects = expandTaskArchitecturesByAnnotations(fileProjects);
......@@ -85,11 +89,15 @@ public class AnnotationGenerationUtils {
/** Amount of available RAM per ECU. */
// RAM is currently not used in constraints --> no need to generate them.
// TODO (SB): No dead code: Either remove, or provide a ticket (preferred solution)
// private final static Integer[] RAM_AMOUNT = {10, 100, 1000};
/** Amount of available Flash memory per ECU. */
private final static Integer[] FLASH_AMOUNT = {10, 100, 1000};
// TODO (SB): IMO the method should just expand the provided fileProjects. -> rename to
// expand... I.e., there is no need for a return value. However, the fileProjects parameter
// should be documented accordingly.
/** Sets the annotation values for the {@link PlatformArchitecture}s. */
private static Collection<FileProject>
definePlatformArchitectureAnnotations(Collection<FileProject> fileProjects) {
......@@ -101,6 +109,9 @@ public class AnnotationGenerationUtils {
/** Sets the values of {@link RamSize} annotations. */
private static Collection<FileProject> defineRAM(Collection<FileProject> fileProjects) {
// TODO (SB): Do not comment out here, but rather at the caller site (with a TODO
// referencing the issue). See defineFlash() for further comments
// RAM is currently not used in constraints --> no need to generate them.
return fileProjects;
// Collection<FileProject> expandedProjects = new ArrayList<>();
......@@ -118,6 +129,10 @@ public class AnnotationGenerationUtils {
// return expandedProjects;
}
// TODO (SB): IMO the method should just expand the provided fileProjects. -> rename to
// expand... (handle consistently in this class)?
// I.e., there is no need for a return value. However, the fileProjects parameter
// should be documented accordingly.
/** Sets the values of {@link FlashSize} annotations. */
private static Collection<FileProject> defineFlash(Collection<FileProject> fileProjects) {
Collection<FileProject> expandedProjects = new ArrayList<>();
......@@ -135,6 +150,10 @@ public class AnnotationGenerationUtils {
return expandedProjects;
}
// TODO (SB): IMO the method should just expand the provided fileProjects. -> rename to
// expand... (handle consistently in this class)?
// I.e., there is no need for a return value. However, the fileProjects parameter
// should be documented accordingly.
/** Sets the values of {@link SafetyIntegrityLevel} annotations. */
private static Collection<FileProject> defineSIL(Collection<FileProject> fileProjects) {
Random rand = new Random(System.currentTimeMillis());
......@@ -166,6 +185,7 @@ public class AnnotationGenerationUtils {
* TaskArchitecture Annotations.
**********************************************************************************************/
// TODO (SB): Document that fileProjects parameter is updated
/** Adds annotations to the {@link TaskArchitecture}s of the given {@link FileProject}s */
private static Collection<FileProject> expandTaskArchitecturesByAnnotations(
Collection<FileProject> fileProjects) throws Exception {
......@@ -193,9 +213,8 @@ public class AnnotationGenerationUtils {
return expandedFileProjects;
}
/**
* Defines the flash memory requirements of tasks based on an upper limit and random assignment.
*/
// TODO (SB): Rename to expand and/or document that taskArch parameter is updated
/** Defines flash memory requirements of tasks based on an upper limit and random assignment. */
private static void defineTaskMemoryRequirements(TaskArchitecture taskArch,
long availableMemory, double memoryUsageRatio, int numExecUnits) throws Exception {
List<Task> tasks = taskArch.getTasks();
......@@ -209,6 +228,7 @@ public class AnnotationGenerationUtils {
}
}
// TODO (SB): Rename to expand and/or document that taskArch parameter is updated
/** Defines the WCETs of tasks. */
private static void defineWCETs(TaskArchitecture taskArch) {
Random rand = new Random(currentTimeMillis());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment