diff --git a/kernel/bench.c b/kernel/bench.c index d51fed8..8bc820d 100644 --- a/kernel/bench.c +++ b/kernel/bench.c @@ -126,12 +126,13 @@ int run_suite(testcase_t *tests) for (i = 0; i < num; i++) { testresult_t result; run_benchmark(&tests[i], &result); - if(enable_printf) print_result(&tests[i], &result); - + if(enable_printf && (get_core_id()==0)) + print_result(&tests[i], &result); errors += result.errors; } - print_summary(errors); + if(get_core_id() == 0) + print_summary(errors); return errors; } @@ -275,5 +276,9 @@ extern int main(int argc, const char * const argv[]); int bench_cluster_forward(int cid) { + #ifdef ARCHI_NO_FC + return 0; + #else return bench_cluster_exec(cid, main); + #endif } diff --git a/kernel/cluster.c b/kernel/cluster.c index 872eab9..3b122b4 100644 --- a/kernel/cluster.c +++ b/kernel/cluster.c @@ -47,12 +47,19 @@ void cluster_entry_stub() { cluster_core_init(); + synch_barrier(); + int retval = ((int (*)())cluster_entry)(); + synch_barrier(); + if (hal_core_id() == 0) { cluster_retval = retval; cluster_running = 0; + #ifdef ARCHI_NO_FC + exit(cluster_retval); + #endif } pos_wait_forever(); @@ -65,18 +72,22 @@ void cluster_start(int cid, int (*entry)()) cluster_entry = entry; // Init FLL + #ifndef ARCHI_NO_FC pos_fll_init(POS_FLL_CL); - + #endif + // Initialize cluster L1 memory allocator alloc_init_l1(cid); // Activate icache hal_icache_cluster_enable(cid); + #ifndef ARCHI_NO_FC if (!hal_is_fc()) { cluster_core_init(); } + #endif alloc_init_l1(cid); @@ -87,12 +98,14 @@ void cluster_start(int cid, int (*entry)()) cluster_running = 1; // Fetch all cores + #ifndef ARCHI_NO_FC for (int i=0; i