#include <rtems/mw_uid.h>
#include <errno.h>
#include <stdint.h>
+#include <rtems/score/wkspace.h>
+
#define TEST_DURATION 130
-#define T1_DUR 400000000
-#define T2_DUR 600000000
+//utilization setup: T1 3/7, T2 5/10
+
+#define T1_DUR 300
+#define T2_DUR 500
#define T1_PER 7
#define T2_PER 10
+#define T1_SERVER 0
+#define T2_SERVER 0
rtems_task Task_1(
rtems_task_argument argument
char output2[50];
unsigned int start, stop, period_length, max_i, max_j;
unsigned int i,j,k;
+ void *mem;
name = rtems_build_name( 'P', 'E', 'R', 'A' );
status = rtems_rate_monotonic_create( name, &period );
}
period_length = T1_PER; // duration 3 ticks
- max_i = 10000; max_j = T1_DUR;
- edf_deadline_init(period_length);
+ max_i = 1000; max_j = T1_DUR;
+ edf_deadline_init(period_length, T1_SERVER, NULL);
while ( 1 ) {
+ edf_next_period();
if (rtems_rate_monotonic_period(period,period_length)==RTEMS_TIMEOUT)
puts("P1 - Deadline miss");
- edf_next_period();
+
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start);
- sprintf(output1,"P1-S ticks:%u",start);
+ sprintf(output1,"P1-S ticks:%u prio:%u",start, (unsigned int) _Per_CPU_Information.executing->current_priority);
puts(output1);
if ( start >= TEST_DURATION ) break;
{
k = j/ 3;
k++;
+ mem = _Workspace_Allocate (4);
+ _Workspace_Free(mem);
}
}
char output2[50];
unsigned int start, stop, period_length, max_i, max_j;
unsigned int i,j,k;
+ void *mem;
name = rtems_build_name( 'P', 'E', 'R', 'B' );
status = rtems_rate_monotonic_create( name, &period );
}
period_length = T2_PER; // duration 5 ticks
- max_i = 10000; max_j = T2_DUR;
- edf_deadline_init(period_length);
+ max_i = 1000; max_j = T2_DUR;
+ edf_deadline_init(period_length, T2_SERVER, NULL);
while ( 1 ) {
+ edf_next_period();
if (rtems_rate_monotonic_period(period,period_length)==RTEMS_TIMEOUT)
puts("P2 - Deadline miss");
- edf_next_period();
+
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start);
- sprintf(output1,"P2-S ticks:%u",start);
+ sprintf(output1,"P2-S ticks:%u prio:%u",start, (unsigned int)_Per_CPU_Information.executing->current_priority);
puts(output1);
if ( _Watchdog_Ticks_since_boot >= TEST_DURATION ) {
for ( j = 1; j < max_j; j++)
{
k = j/ 3;
- k++;
+ k++;
+ mem = _Workspace_Allocate (4);
+ _Workspace_Free(mem);
}
}