WATERS_UNSYNCHRONIZED

This commit is contained in:
Alwin Berger 2025-02-26 11:52:01 +01:00
parent b9f51f80fc
commit ce132131b3
2 changed files with 14 additions and 8 deletions

View File

@ -36,10 +36,10 @@
#define DO_TIME(X,Y) WASTE_USEC((X))
#ifdef INSERT_WC
#define DEBUG_VAL(X,D) (D)
#define DEBUG_VAL(X,D) (D+0*X)
#define WCET_CLAMP(X, LB, UB, LABEL) WASTE_USEC(UB)
#else
#define DEBUG_VAL(X,D) (X)
#define DEBUG_VAL(X,D) ((X)+(D)*0)
#define WCET_CLAMP(X, LB, UB, LABEL) WASTE_USEC(CLAMP(X,LB,UB))
#endif

View File

@ -34,13 +34,19 @@
#include "fuzzhelper.c"
#ifdef INSERT_WC
#define DEBUG_VAL(X,D) (D)
#define WCET_CLAMP(X, LB, UB, LABEL) WASTE_NSEC(UB)
#define DEBUG_VAL(X,D) (D+0*X)
#define WCET_CLAMP(X, LB, UB, LABEL) WASTE_NSEC((X)*0+UB)
#else
#define DEBUG_VAL(X,D) (X)
#define DEBUG_VAL(X,D) (X+0*D)
#define WCET_CLAMP(X, LB, UB, LABEL) WASTE_NSEC(CLAMP(X,LB,UB))
#endif
#ifdef WATERS_UNSYNCHRONIZED
#define NOTIFY_WAIT_TIME 0
#else
#define NOTIFY_WAIT_TIME portMAX_DELAY
#endif
static void prvTaskC21( void * pvParameters );
static void prvTaskC22( void * pvParameters );
static void prvTaskC32( void * pvParameters );
@ -419,7 +425,7 @@ static void prvTaskC12( void * pvParameters ) {
// Output: g(x) = x % 8 == y
// WC Input: x = 12000, y = 0
uint16_t x = INPUT_SHORT_NEXT;
int y = ulTaskNotifyTake(pdTRUE, portMAX_DELAY)-1;
int y = ulTaskNotifyTake(pdTRUE, NOTIFY_WAIT_TIME)-1;
xTaskNotify(xTaskC13, DEBUG_VAL((x % 8 == y) + 1, 2), eSetValueWithOverwrite);
volatile int torun = 0;
if (x % 8 == y) {
@ -451,7 +457,7 @@ static void prvTaskC13( void * pvParameters ) {
// WC Input: x = 65535 , y = 1 for "short" run
// globally, short runs consume more time in subsequent jobs
volatile uint32_t x = INPUT_SHORT_NEXT;
int y = ulTaskNotifyTake(pdTRUE, portMAX_DELAY)-1;
int y = ulTaskNotifyTake(pdTRUE, NOTIFY_WAIT_TIME)-1;
volatile int do_short_run = (y + ((x%100)<=5)) == 1; // XOR
xTaskNotify(xTaskC14, DEBUG_VAL(do_short_run+1, 2), eSetValueWithOverwrite);
int torun = 0;
@ -482,7 +488,7 @@ static void prvTaskC14( void * pvParameters ) {
// Exectime: f(x,y) = if y ? c1+2*x : c2-x
// longmax - shortmax: 76955
volatile uint32_t x = INPUT_SHORT_NEXT;
int y = ulTaskNotifyTake(pdTRUE, portMAX_DELAY)-1;
int y = ulTaskNotifyTake(pdTRUE, NOTIFY_WAIT_TIME)-1;
volatile int torun = 0;
if (y) {
torun = x*3;