Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1248 → Rev 1247

/demos/trunk/loader/nload.c
33,7 → 33,6
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);
41,7 → 40,6
 
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"
66,8 → 64,6
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
76,8 → 72,7
#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"
107,8 → 102,6
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
118,7 → 111,6
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"
181,7 → 173,7
int start_environment()
{
 
extern struct timespec total_time;
struct timespec total = {20,0};
generic_calibrate_cycle();
 
191,7 → 183,7
 
generic_start_simulation();
 
generic_set_simulation_time(&total_time);
generic_set_simulation_time(&total);
 
return 0;
 
/demos/trunk/loader/load.txt
47,8 → 47,6
 
TOTAL_EXEC_TIME:[20][0];
 
# SIMULATION TOTAL TIME
 
CONTRACT SECTION
 
[0]:[0][3000]:[0][10000]:[0][3000]:[0][10000]:[0]:POSIX;
/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,23 → 134,6
}
 
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)
{
 
404,8 → 387,6
 
close_loader_contract(total_contract_number);
 
write_simulation_time(&total_time);
 
return 0;
 
}