update demos
This commit is contained in:
parent
42889f6dc2
commit
25d1e590fc
@ -178,8 +178,11 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(INTERRUPT_ACTIVATION), 1)
|
ifeq ($(FUZZ_BYTES), 1)
|
||||||
CFLAGS += -D INTERRUPT_ACTIVATION=1
|
CFLAGS += -D FUZZ_BYTES=1
|
||||||
|
endif
|
||||||
|
ifeq ($(FUZZ_INT_ACTIVATION), 1)
|
||||||
|
CFLAGS += -D FUZZ_INT_ACTIVATION=1
|
||||||
endif
|
endif
|
||||||
ifeq ($(PARTITION_INPUT), 1)
|
ifeq ($(PARTITION_INPUT), 1)
|
||||||
CFLAGS += -D PARTITION_INPUT=1
|
CFLAGS += -D PARTITION_INPUT=1
|
||||||
|
@ -46,8 +46,13 @@ static unsigned char next(int tasknum) {
|
|||||||
// #define SHORT_CALC 50
|
// #define SHORT_CALC 50
|
||||||
// #define LONG_CALC 200
|
// #define LONG_CALC 200
|
||||||
|
|
||||||
|
#ifdef FUZZ_BYTES
|
||||||
#define SHORT_CALC (25+next(task_id)%25)
|
#define SHORT_CALC (25+next(task_id)%25)
|
||||||
#define LONG_CALC (150+next(task_id)%100)
|
#define LONG_CALC (150+next(task_id)%100)
|
||||||
|
#else
|
||||||
|
#define SHORT_CALC (50)
|
||||||
|
#define LONG_CALC (250)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HYPER_PERIOD 9
|
#define HYPER_PERIOD 9
|
||||||
#define SIMULATE_PERIODS 4
|
#define SIMULATE_PERIODS 4
|
||||||
@ -272,9 +277,17 @@ static void prv_MavlinkSendTask(void *pvParameters) {
|
|||||||
|
|
||||||
static void prv_CopterControlTask(void *pvParameters) {
|
static void prv_CopterControlTask(void *pvParameters) {
|
||||||
const int task_id = 9;
|
const int task_id = 9;
|
||||||
|
#ifndef FUZZ_INT_ACTIVATION
|
||||||
|
TickType_t xLastWakeTime = initial_release_time;
|
||||||
|
const TickType_t xFrequency = 5 / portTICK_PERIOD_MS;
|
||||||
|
#endif
|
||||||
trigger_job_done();
|
trigger_job_done();
|
||||||
do {
|
do {
|
||||||
|
#ifdef FUZZ_INT_ACTIVATION
|
||||||
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
|
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
|
||||||
|
#else
|
||||||
|
xTaskDelayUntil( &xLastWakeTime, xFrequency );
|
||||||
|
#endif
|
||||||
WASTE_USEC(LONG_CALC);
|
WASTE_USEC(LONG_CALC);
|
||||||
vTaskSuspendAll();
|
vTaskSuspendAll();
|
||||||
WASTE_USEC(SHORT_CALC);
|
WASTE_USEC(SHORT_CALC);
|
||||||
|
@ -57,7 +57,12 @@ SemaphoreHandle_t l_sem;
|
|||||||
#define DO_TIME(X, Y) WASTE_USEC((X))
|
#define DO_TIME(X, Y) WASTE_USEC((X))
|
||||||
// #define DO_TIME(X, Y) PRINT_USEC((X), Y)
|
// #define DO_TIME(X, Y) PRINT_USEC((X), Y)
|
||||||
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME((CLAMP(X,LB,UB)),LABEL)
|
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME((CLAMP(X,LB,UB)),LABEL)
|
||||||
// #define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME(UB,LABEL)
|
|
||||||
|
#ifndef FUZZ_BYTES
|
||||||
|
// Produce the worst case, ignore input
|
||||||
|
#undef WCET_CLAMP
|
||||||
|
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME(UB,LABEL)
|
||||||
|
#endif
|
||||||
|
|
||||||
__attribute__((noinline)) static void trigger_Qemu_break( void )
|
__attribute__((noinline)) static void trigger_Qemu_break( void )
|
||||||
{
|
{
|
||||||
@ -97,7 +102,7 @@ void h_task(void *params) {
|
|||||||
TickType_t xLastWakeTime = initial_release_time;
|
TickType_t xLastWakeTime = initial_release_time;
|
||||||
const TickType_t xFrequency = 1 / portTICK_PERIOD_MS;
|
const TickType_t xFrequency = 1 / portTICK_PERIOD_MS;
|
||||||
while (1) {
|
while (1) {
|
||||||
#ifdef INTERRUPT_ACTIVATION
|
#ifdef FUZZ_INT_ACTIVATION
|
||||||
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
|
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
|
||||||
#else
|
#else
|
||||||
xTaskDelayUntil( &xLastWakeTime, xFrequency );
|
xTaskDelayUntil( &xLastWakeTime, xFrequency );
|
||||||
|
@ -355,7 +355,7 @@ static void prvC3T1( void * pvParameters ) {
|
|||||||
xTaskNotify(xC3T2, DEBUG_VAL(x & 0x1, 0), eSetValueWithOverwrite);
|
xTaskNotify(xC3T2, DEBUG_VAL(x & 0x1, 0), eSetValueWithOverwrite);
|
||||||
// 3 different activation strategies -------------
|
// 3 different activation strategies -------------
|
||||||
// activate sporadically from interrupts
|
// activate sporadically from interrupts
|
||||||
#ifdef INTERRUPT_ACTIVATION
|
#ifdef FUZZ_INT_ACTIVATION
|
||||||
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
|
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
|
||||||
#else
|
#else
|
||||||
// activate with worst possible frequency (700us, but tick resolution is too low)
|
// activate with worst possible frequency (700us, but tick resolution is too low)
|
||||||
|
@ -66,9 +66,14 @@ __attribute__((noinline)) static void trigger_job_done( void )
|
|||||||
|
|
||||||
#define DO_TIME(X, Y) WASTE_USEC((X))
|
#define DO_TIME(X, Y) WASTE_USEC((X))
|
||||||
|
|
||||||
|
#ifndef FUZZ_BYTES
|
||||||
|
// Produce the worst case, ignore input
|
||||||
|
#define DEBUG_WCET(A) {A}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_WCET
|
#ifdef DEBUG_WCET
|
||||||
#define DEBUG_VAL(X,D) (D)
|
#define DEBUG_VAL(X,D) (D)
|
||||||
#define WCET_CLAMP(X, LB, UB, LABEL) WASTE_NSEC(CLAMP(X,LB,UB),LABEL)
|
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME(UB,LABEL)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_VAL(X,D) (X)
|
#define DEBUG_VAL(X,D) (X)
|
||||||
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME(CLAMP(X,LB,UB),LABEL)
|
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME(CLAMP(X,LB,UB),LABEL)
|
||||||
@ -308,8 +313,8 @@ static void prvTask5( void * pvParameters ) {
|
|||||||
int y = ulTaskNotifyTake(pdTRUE, portMAX_DELAY); // sporadic
|
int y = ulTaskNotifyTake(pdTRUE, portMAX_DELAY); // sporadic
|
||||||
int succ = xSemaphoreTake(xMutex, 0); // try to take the mutex
|
int succ = xSemaphoreTake(xMutex, 0); // try to take the mutex
|
||||||
if (succ == pdTRUE) {
|
if (succ == pdTRUE) {
|
||||||
// volatile uint16_t x = fuzz_short_next();
|
volatile uint16_t x = fuzz_short_next();
|
||||||
uint16_t x = 2000;
|
// uint16_t x = 2000;
|
||||||
int torun = 0;
|
int torun = 0;
|
||||||
torun = CLAMP(x, 0, 2000);
|
torun = CLAMP(x, 0, 2000);
|
||||||
DO_TIME(torun, TASK_5_MESSAGE)
|
DO_TIME(torun, TASK_5_MESSAGE)
|
||||||
|
@ -65,9 +65,14 @@ __attribute__((noinline)) static void trigger_job_done( void )
|
|||||||
|
|
||||||
#define DO_TIME(X, Y) WASTE_NSEC((X))
|
#define DO_TIME(X, Y) WASTE_NSEC((X))
|
||||||
|
|
||||||
|
#ifndef FUZZ_BYTES
|
||||||
|
// Produce the worst case, ignore input
|
||||||
|
#define DEBUG_WCET(A) {A}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_WCET
|
#ifdef DEBUG_WCET
|
||||||
#define DEBUG_VAL(X,D) (D)
|
#define DEBUG_VAL(X,D) (D)
|
||||||
#define WCET_CLAMP(X, LB, UB, LABEL) WASTE_NSEC(CLAMP(X,LB,UB),LABEL)
|
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME(UB,LABEL)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_VAL(X,D) (X)
|
#define DEBUG_VAL(X,D) (X)
|
||||||
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME(CLAMP(X,LB,UB),LABEL)
|
#define WCET_CLAMP(X, LB, UB, LABEL) DO_TIME(CLAMP(X,LB,UB),LABEL)
|
||||||
@ -82,6 +87,9 @@ volatile int INPUT_POINTERS[NUM_TASKS] = {};
|
|||||||
volatile uint32_t FUZZ_LENGTH = MAX_INPUT_BYTES;// ignored
|
volatile uint32_t FUZZ_LENGTH = MAX_INPUT_BYTES;// ignored
|
||||||
// Read the Byte of Input, if the Input is exausted trigger the breakpoint instead
|
// Read the Byte of Input, if the Input is exausted trigger the breakpoint instead
|
||||||
static unsigned char fuzz_char_next(int tasknum) {
|
static unsigned char fuzz_char_next(int tasknum) {
|
||||||
|
#ifndef FUZZ_BYTES
|
||||||
|
return 255;
|
||||||
|
#endif
|
||||||
#ifdef PARTITION_INPUT
|
#ifdef PARTITION_INPUT
|
||||||
if (INPUT_POINTERS[tasknum] == 0) {
|
if (INPUT_POINTERS[tasknum] == 0) {
|
||||||
INPUT_POINTERS[tasknum] = tasknum * (MAX_INPUT_BYTES / NUM_TASKS);
|
INPUT_POINTERS[tasknum] = tasknum * (MAX_INPUT_BYTES / NUM_TASKS);
|
||||||
@ -398,7 +406,7 @@ static void prvTask397( void * pvParameters ) {
|
|||||||
// 3 different activation strategies -------------
|
// 3 different activation strategies -------------
|
||||||
// activate sporadically from interrupts
|
// activate sporadically from interrupts
|
||||||
trigger_job_done();
|
trigger_job_done();
|
||||||
#ifdef INTERRUPT_ACTIVATION
|
#ifdef FUZZ_INT_ACTIVATION
|
||||||
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
|
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
|
||||||
#else
|
#else
|
||||||
// activate with worst possible frequency (700us, but tick resolution is too low)
|
// activate with worst possible frequency (700us, but tick resolution is too low)
|
||||||
|
@ -75,7 +75,7 @@ __attribute__((noinline)) static void trigger_job_done( void )
|
|||||||
#define DEBUG_WCET(A)
|
#define DEBUG_WCET(A)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// #define INTERRUPT_ACTIVATION 1
|
// #define FUZZ_INT_ACTIVATION 1
|
||||||
|
|
||||||
// Begin Input Stuff
|
// Begin Input Stuff
|
||||||
#define NUM_TASKS 10
|
#define NUM_TASKS 10
|
||||||
@ -406,7 +406,7 @@ static void prvTask397( void * pvParameters ) {
|
|||||||
// 3 different activation strategies -------------
|
// 3 different activation strategies -------------
|
||||||
// activate sporadically from interrupts
|
// activate sporadically from interrupts
|
||||||
trigger_job_done();
|
trigger_job_done();
|
||||||
#ifdef INTERRUPT_ACTIVATION
|
#ifdef FUZZ_INT_ACTIVATION
|
||||||
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
|
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
|
||||||
#else
|
#else
|
||||||
// activate with worst possible frequency (700us, but tick resolution is too low)
|
// activate with worst possible frequency (700us, but tick resolution is too low)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user