Commit 198b583d authored by Simon Barner's avatar Simon Barner
Browse files

Merge branch '3826' into 'master'

[3826] ArithmeticException thrown when scaling a core's frequency

See merge request af3/af3!241
parents 9c3737ec d4c990a7
......@@ -10,4 +10,4 @@ b646b9201432074bec0a1b0c408255b982474b32 GREEN 0ac11438943e72798330e76caff50782d1970cb4 GREEN ed6b5d4e28a2f445d71890b5e5718717b8457796 GREEN 34ea0a9a476bb2527cf0114871073ce25c0df09c GREEN e15f883abb1c47dd189916c947869cffe20d9472 GREEN 3da57235afcc261ac9f2f81485b1267d47ec4403 GREEN
......@@ -20,6 +20,7 @@ import static org.fortiss.tooling.base.utils.AnnotationUtils.getAnnotation;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.convertList;
import java.math.BigDecimal;
import java.math.RoundingMode;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.platform.model.ExecutionUnit;
......@@ -66,8 +67,10 @@ public class TaskWcetTableStaticImpl {
if(!freq.getFrequenciesHz().contains(frequency)) {
return null;
// Scale WCET to provided frequency (relative to base frequency)
return (wcet.multiply(valueOf(baseFrequency))).divide(valueOf(frequency));
// Scale WCET to provided frequency (relative to base frequency).
// Note: Rounding mode needs to be set in order to avoid a potential ArithmeticException
return (wcet.multiply(valueOf(baseFrequency))).divide(valueOf(frequency),
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