Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1247 → Rev 1248

/demos/trunk/loader/event_gen.c
127,7 → 127,7
fprintf(file_event_header,"};\n\n");
fprintf(file_event_header,"int total_loader_contract = %d;\n\n",total_contract_number);
fclose(file_event_header);
return 0;
134,6 → 134,23
}
 
int write_simulation_time(struct timespec *total)
{
 
FILE *file_event_header;
file_event_header = fopen(EVENT_DEFINE,"a+");
if (file_event_header == NULL) return 1;
fprintf(file_event_header,"struct timespec total_time = {%d,%d};\n\n",total->tv_sec,total->tv_nsec);
fclose(file_event_header);
return 0;
 
 
}
 
int write_single_act(struct timespec *t, struct loader_task *c)
{
 
387,6 → 404,8
 
close_loader_contract(total_contract_number);
 
write_simulation_time(&total_time);
 
return 0;
 
}
/demos/trunk/loader/load.txt
47,6 → 47,8
 
TOTAL_EXEC_TIME:[20][0];
 
# SIMULATION TOTAL TIME
 
CONTRACT SECTION
 
[0]:[0][3000]:[0][10000]:[0][3000]:[0][10000]:[0]:POSIX;
/demos/trunk/loader/nload.c
33,6 → 33,7
struct loader_task *l = (struct loader_task *)(arg);
char tmp[20];
 
if (l->act_current == 0) l->act_current = 1;
#ifdef TASK_OUTPUT
sprintf(tmp,"[ONESHOT]");
printf_xy((get_current_exec_task() % 5) * 9 + 34,get_current_exec_task() / 5 + 5, GREEN, tmp);
40,6 → 41,7
 
exec_cycles = (long long)(TIMESPEC2USEC(&l->exec[l->act_current-1])) * CALIBRATION_DELTA / cal_cycles;
/* Execution delay */
for (i=0;i<exec_cycles;i++)
__asm__ __volatile__ ("xorl %%eax,%%eax\n\t"
"cpuid\n\t"
64,6 → 66,8
struct loader_task *l = (struct loader_task *)(arg);
char tmp[20];
 
if (l->act_current == 0) l->act_current = 1;
 
while(1) {
 
#ifdef TASK_OUTPUT
72,7 → 76,8
#endif
exec_cycles = (long long)(TIMESPEC2USEC(&l->exec[l->act_current-1])) * CALIBRATION_DELTA / cal_cycles;
/* Execution delay */
for (i=0;i<exec_cycles;i++)
__asm__ __volatile__ ("xorl %%eax,%%eax\n\t"
"cpuid\n\t"
102,6 → 107,8
struct loader_task *l = (struct loader_task *)(arg);
char tmp[20];
 
if (l->act_current == 0) l->act_current = 1;
 
while(1) {
 
#ifdef TASK_OUTPUT
111,6 → 118,7
exec_cycles = (long long)(TIMESPEC2USEC(&l->exec[l->act_current-1])) * CALIBRATION_DELTA / cal_cycles;
/* Execution delay */
for (i=0;i<exec_cycles;i++)
__asm__ __volatile__ ("xorl %%eax,%%eax\n\t"
"cpuid\n\t"
173,7 → 181,7
int start_environment()
{
 
struct timespec total = {20,0};
extern struct timespec total_time;
generic_calibrate_cycle();
 
183,7 → 191,7
 
generic_start_simulation();
 
generic_set_simulation_time(&total);
generic_set_simulation_time(&total_time);
 
return 0;