@@ -37,20 +37,21 @@ static lf_ret_t S4NOCPollChannel_send_blocking(NetworkChannel *untyped_self, con
3737
3838 volatile _IODEV int * s4noc_data = (volatile _IODEV int * )(PATMOS_IO_S4NOC + 4 );
3939 volatile _IODEV int * s4noc_dest = (volatile _IODEV int * )(PATMOS_IO_S4NOC + 8 );
40+ // S4NOC_CHANNEL_DEBUG("S4NOCPollChannel_send_blocking called with message: %p", message);
4041
4142 if (self -> state == NETWORK_CHANNEL_STATE_CONNECTED ) {
4243 int message_size = serialize_to_protobuf (message , self -> write_buffer + 4 , S4NOC_CHANNEL_BUFFERSIZE - 4 );
4344
4445 * ((int * )self -> write_buffer ) = message_size ;
45-
46+ S4NOC_CHANNEL_DEBUG ( "S4NOCPollChannel_send_blocking: message size: ((%d))." , message_size );
4647 int total_size = message_size + 4 ;
4748 * s4noc_dest = self -> destination_core ;
4849 int bytes_send = 0 ;
4950 while (bytes_send < total_size ) {
5051 * s4noc_data = ((int * )self -> write_buffer )[bytes_send / 4 ];
5152 bytes_send += 4 ;
5253 }
53- S4NOC_CHANNEL_DEBUG ("Sent %d bytes" , bytes_send );
54+ S4NOC_CHANNEL_DEBUG ("Sent ((%d)) bytes" , bytes_send );
5455 return LF_OK ;
5556 } else {
5657 return LF_ERR ;
@@ -61,7 +62,7 @@ static void S4NOCPollChannel_register_receive_callback(NetworkChannel *untyped_s
6162 void (* receive_callback )(FederatedConnectionBundle * conn ,
6263 const FederateMessage * msg ),
6364 FederatedConnectionBundle * conn ) {
64- S4NOC_CHANNEL_INFO ("Register receive callback at %p" , receive_callback );
65+ // S4NOC_CHANNEL_INFO("Register receive callback at %p", receive_callback);
6566 S4NOCPollChannel * self = (S4NOCPollChannel * )untyped_self ;
6667
6768 self -> receive_callback = receive_callback ;
@@ -70,43 +71,42 @@ static void S4NOCPollChannel_register_receive_callback(NetworkChannel *untyped_s
7071
7172void S4NOCPollChannel_poll (NetworkChannel * untyped_self ) {
7273 S4NOCPollChannel * self = (S4NOCPollChannel * )untyped_self ;
73- S4NOC_CHANNEL_INFO ("S4NOCPollChannel_poll called" );
74+ // S4NOC_CHANNEL_INFO("S4NOCPollChannel_poll called");
7475
7576 volatile _IODEV int * s4noc_status = (volatile _IODEV int * )PATMOS_IO_S4NOC ;
7677 volatile _IODEV int * s4noc_data = (volatile _IODEV int * )(PATMOS_IO_S4NOC + 4 );
7778 volatile _IODEV int * s4noc_source = (volatile _IODEV int * )(PATMOS_IO_S4NOC + 8 );
7879
7980 if (((* s4noc_status ) & 0x02 ) == 0 ) {
80- S4NOC_CHANNEL_INFO ("S4NOCPollChannel_poll: No data available" );
81+ S4NOC_CHANNEL_INFO ("S4NOCPollChannel_poll: No data is available" ); //if i remove it platform-test doesn't work
8182 return ;
8283 }
8384
8485 int value = * s4noc_data ;
8586 int source = * s4noc_source ;
86- S4NOC_CHANNEL_INFO ("S4NOCPollChannel_poll: Received value 0x%08x (%c%c%c%c) from source %d" , value ,
87- ((char * )& value )[0 ], ((char * )& value )[1 ], ((char * )& value )[2 ], ((char * )& value )[3 ], source );
87+ S4NOC_CHANNEL_INFO ("S4NOCPollChannel_poll: Received data 0x%08x (%c%c%c%c) from source %d" , value , ((char * )& value )[0 ], ((char * )& value )[1 ], ((char * )& value )[2 ], ((char * )& value )[3 ], source );
8888 S4NOCPollChannel * receive_channel =
8989 s4noc_global_state .core_channels [source ][get_cpuid ()]; // Get the receive channel for the source core
9090
9191 ((int * )receive_channel -> receive_buffer )[receive_channel -> receive_buffer_index / 4 ] = value ;
9292 receive_channel -> receive_buffer_index += 4 ;
93- S4NOC_CHANNEL_DEBUG ("receive_buffer_index %d " , receive_channel -> receive_buffer_index );
93+ S4NOC_CHANNEL_DEBUG ("receive_buffer_index ((%d)) " , receive_channel -> receive_buffer_index );
9494 unsigned int expected_message_size = * ((int * )receive_channel -> receive_buffer );
95- S4NOC_CHANNEL_DEBUG ("Expected message size: %d " , expected_message_size );
95+ S4NOC_CHANNEL_DEBUG ("Expected message size: ((%d)) " , expected_message_size );
9696 if (receive_channel -> receive_buffer_index >= expected_message_size + 4 ) {
9797 int bytes_left = deserialize_from_protobuf (& receive_channel -> output ,
9898 receive_channel -> receive_buffer + 4 , // skip the 4-byte size header
9999 expected_message_size // only the message payload
100100 );
101- S4NOC_CHANNEL_DEBUG ("Bytes Left after attempted to deserialize: %d" , bytes_left );
101+ // S4NOC_CHANNEL_DEBUG("Bytes Left after attempted to deserialize: %d", bytes_left);
102102
103103 if (bytes_left >= 0 ) {
104104 receive_channel -> receive_buffer_index = bytes_left ;
105105 if (receive_channel -> receive_callback != NULL ) {
106- S4NOC_CHANNEL_DEBUG ("calling user callback at %p!" , receive_channel -> receive_callback );
106+ // S4NOC_CHANNEL_DEBUG("calling user callback at %p!", receive_channel->receive_callback);
107107 receive_channel -> receive_callback (self -> federated_connection , & receive_channel -> output );
108108 } else {
109- S4NOC_CHANNEL_WARN ("No receive callback registered, dropping message" );
109+ // S4NOC_CHANNEL_WARN("No receive callback registered, dropping message");
110110 }
111111 }
112112 }
0 commit comments