Skip to content

Commit 74dc986

Browse files
committed
global state are set in channel
1 parent 3240bd6 commit 74dc986

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/platform/patmos/s4noc_channel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@ void S4NOCPollChannel_ctor(S4NOCPollChannel *self, unsigned int destination_core
138138
self->destination_core = destination_core;
139139
memset(self->receive_buffer, 0, S4NOC_CHANNEL_BUFFERSIZE);
140140
memset(self->write_buffer, 0, S4NOC_CHANNEL_BUFFERSIZE);
141-
141+
unsigned int src_core = get_cpuid();
142+
s4noc_global_state.core_channels[destination_core][src_core] = self;
142143
}

test/platform/patmos/s4noc_channel_test/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ void setUp(void) {
3030
FederatedEnvironment_ctor(&fed_env, &parent, NULL, false, net_bundles, 2, &startup_coordinator, NULL);
3131

3232
/* init channel */
33+
LF_INFO(NET,"init channel");
3334
S4NOCPollChannel_ctor(&sender_channel, DESTINATION_CORE);
3435
S4NOCPollChannel_ctor(&receiver_channel, SOURCE_CORE);
3536

3637
/* init bundles */
38+
LF_INFO(NET,"init bundles");
3739
FederatedConnectionBundle_ctor(&sender_bundle, &parent, sender, NULL, NULL, 0, NULL, NULL, 0, 0);
3840
FederatedConnectionBundle_ctor(&receiver_bundle, &parent, receiver, NULL, NULL, 0, NULL, NULL, 0, 0);
3941

42+
LF_INFO(NET,"init global state");
4043
s4noc_global_state.core_channels[SOURCE_CORE][DESTINATION_CORE] = &receiver_channel;
4144
s4noc_global_state.core_channels[DESTINATION_CORE][SOURCE_CORE] = &sender_channel;
4245

0 commit comments

Comments
 (0)