Update of /cvsroot/linux-hls/hls/simul/loads
In directory sc8-pr-cvs1:/tmp/cvs-serv5866/simul/loads
Added Files:
resps.c
Log Message:
- Some simulator work
- Unbreak the PS scheduler (share was 0 by default)
- Add a filter to convert the simulator output in a .fig file
--- NEW FILE: resps.c ---
/*
* Copyright (c) 2002 Luca Abeni
*
* Module Name: loads/continuous.c
* Abstract: Workload generator for the Simulator Backend.
* Task set composed of ``continuous tasks'', that
* are always backlogged (never block or unblock).
* After some time, some tasks are moved to res and ps1
* Author: Luca Abeni 2-Dec-2003
*
* This is free software; see GPL.txt
*/
#include <stdio.h>
#include <stdlib.h>
#include "interface-data.h"
#include "os.h"
#include "sim.h"
#include "event.h"
#define TH_FIXED_PRIO 3 /* FIXME: What do we want to do here??? */
int total_num_threads;
int rsv = 5;
int ps = 2;
extern long long int max_res_time;
extern long long int max_run_time_until_blocking;
extern long long int cpu_time_per_thread;
extern long long int max_blocking_time;
long long int execution_time(void)
{
return 10000;
}
long long int workload_generate(void)
{
int EndNumProcessors;
int threads;
int i;
struct sim_task_struct *t[100];
EndNumProcessors = 1;
threads = 10;
total_num_threads = 20;
sim_printf("simulating %d threads\n", threads);
#if 0
max_run_time_until_blocking = ((long long int)(sim_rand()%1000000))+500;
max_blocking_time = ((long long int)(sim_rand()%100000))+500;
max_res_time = 100000000;
cpu_time_per_thread = /*HLS_MsToNT * 500*/ /*1000000*/ 500000;
#endif
for(i = 0; i < threads; i++) {
t[i] = make_new_thread(100, 0, /*execution_time*/ NULL, NULL, TH_FIXED_PRIO);
}
{
struct sim_event *e;
long long int tt = 0;
for (i = 1; i < EndNumProcessors; i++) {
e = new_event(EVENT_TYPE_NEW_PROC, 0);
tt += sim_rand() % 500000;
insert_event (e, tt);
}
}
for (i = 0; i < rsv; i++) {
struct sim_event *e;
e = new_event(EVENT_TYPE_RES, 0);
e->u.res.t = t[i];
e->u.res.amount = 100000;
e->u.res.period = 2000000;
e->u.res.start = 1;
insert_event (e, 6000000);
}
for (i = 0; i < ps; i++) {
struct sim_event *e;
e = new_event(EVENT_TYPE_MOVETOPS, 0);
e->u.ps.t = t[i + rsv];
e->u.ps.share = (i + 1) * 10;
insert_event (e, 5000000);
}
#if 0
e = new_event (EVENT_TYPE_MOVETOPS, 0);
insert_event (e, (long long int)(sim_rand()%100000));
#endif
#if 0
e = new_event (EVENT_TYPE_LOADRES, 0);
insert_event (e, (long long int)(sim_rand()%10000000));
#endif
return 100000000;
}
|