Skip to content

Commit

Permalink
apply Victor's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tahaelbayad committed Dec 12, 2024
1 parent 1ac4c9a commit fe85e5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions DeeployTest/Platforms/MemPool/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "testinputs.h"
#include "testoutputs.h"

#ifndef BANSHEE_SIMULATION
#ifndef SIMULATORS
dump(timer_cycle, 0);
dump(timer_instr, 1);
dump(expected, 2);
Expand All @@ -61,7 +61,7 @@ int main() {

mempool_timer_t instr_init, instr_end;
mempool_timer_t timer_init, timer_end;
#ifdef BANSHEE_SIMULATION
#ifdef SIMULATORS
uint32_t const num_cores = NUM_THREADS;
#else
uint32_t const num_cores = mempool_get_core_count();
Expand All @@ -72,7 +72,7 @@ int main() {
// Initialize synchronization variables
mempool_barrier_init(core_id, num_cores);

#ifdef BANSHEE_SIMULATION
#ifdef SIMULATORS
if (core_id == num_cores - 1) {
printf("Network running on %ld of %ld cores\r\n", num_cores,
mempool_get_core_count());
Expand All @@ -82,7 +82,7 @@ int main() {
// Wait until initialization is done
mempool_barrier(num_cores);

#ifdef BANSHEE_SIMULATION
#ifdef SIMULATORS
if (core_id == 0) {
printf("Init network...\r\n");
}
Expand All @@ -96,7 +96,7 @@ int main() {
mempool_barrier(num_cores);

if (core_id == 0) {
#if BANSHEE_SIMULATION
#if SIMULATORS
for (uint32_t buf = 0; buf < DeeployNetwork_num_inputs; buf++) {
memcpy(DeeployNetwork_inputs[buf], testInputVector[buf],
DeeployNetwork_inputs_bytes[buf]);
Expand All @@ -115,7 +115,7 @@ int main() {
// Wait until initialization is done
mempool_barrier(num_cores);

#ifdef BANSHEE_SIMULATION
#ifdef SIMULATORS
if (core_id == 0) {
for (uint32_t buf = 0; buf < DeeployNetwork_num_inputs; buf++) {
printf("testInputVector%d @ %p\r\n", buf, testInputVector[buf]);
Expand Down Expand Up @@ -155,7 +155,7 @@ int main() {
int32_t diff;
int32_t expected, actual;

#ifdef BANSHEE_SIMULATION
#ifdef SIMULATORS
uint32_t tot = 0;
// Sequential part executed by all cores
if (core_id != 0) {
Expand Down
2 changes: 1 addition & 1 deletion DeeployTest/Platforms/Snitch/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main(void) {
uint32_t core_id = snrt_global_core_idx();
uint32_t compute_core_id = snrt_global_compute_core_idx();

#ifdef BANSHEE_SIMULATION
#ifdef SIMULATORS
uint32_t const num_compute_cores = (NUM_CORES - 1);
#else
uint32_t const num_compute_cores = snrt_global_compute_core_num();
Expand Down
2 changes: 1 addition & 1 deletion cmake/simulation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(banshee_stack_size 16777216 CACHE STRING "Stack size of banshee threads")

OPTION(banshee_simulation "Optimize binary for banshee simulation" OFF)
if(banshee_simulation)
add_compile_definitions(BANSHEE_SIMULATION)
add_compile_definitions(SIMULATORS)
endif()

#########################
Expand Down

0 comments on commit fe85e5c

Please sign in to comment.