Skip to content

Conversation

EhsanKhodadad
Copy link

No description provided.

Copy link
Member

@tanneberger tanneberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks pretty good so far!

I will probably make a second round to precisely understand your stuff.

=> run make format to format all the code.
=> also checkout what clang-tidy has to say about your code.

*((int *)self->write_buffer) = message_size;

int total_size = message_size + 4;
*s4noc_dest = self->destination_core;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhh I dont know if this plays nicely if you have multiple S4NOC Channels sending to different cores.

return;
}

int value = *s4noc_data;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how fast do we need to poll, this function so no data loss occurs?

case StartupCoordinationState_RUNNING:
// Should not be possible.
validate(false);
// validate(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want that back ;D

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In file included from /home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/src-gen/MyFed/src/reactor-uc/include/reactor-uc/startup_coordinator.h:4,
from /home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/src-gen/MyFed/src/reactor-uc/src/startup_coordinator.c:1:
/home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/src-gen/MyFed/src/reactor-uc/src/startup_coordinator.c: In function ‘StartupCoordinator_handle_start_time_proposal’:
/home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/src-gen/MyFed/src/reactor-uc/include/reactor-uc/error.h:32:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
32 | if ((expr) == 0) {
| ^
/home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/src-gen/MyFed/src/reactor-uc/src/startup_coordinator.c:253:7: note: in expansion of macro ‘validate’
253 | validate(false);
| ^~~~~~~~
/home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/src-gen/MyFed/src/reactor-uc/src/startup_coordinator.c:254:5: note: here
254 | case StartupCoordinationState_HANDSHAKING:
| ^~~~
cc1: all warnings being treated as errors
gmake[3]: *** [src-gen/MyFed/src/reactor-uc/CMakeFiles/reactor-uc.dir/build.make:331: src-gen/MyFed/src/reactor-uc/CMakeFiles/reactor-uc.dir/src/startup_coordinator.c.o] Error 1
gmake[3]: Leaving directory '/home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/build'
gmake[2]: *** [CMakeFiles/Makefile2:145: src-gen/MyFed/src/reactor-uc/CMakeFiles/reactor-uc.dir/all] Error 2
gmake[2]: Leaving directory '/home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/build'
gmake[1]: *** [Makefile:91: all] Error 2
gmake[1]: Leaving directory '/home/ehsan/lf-pat-mul/reactor-uc/examples/fed-template/MyFed/src/build'
make: *** [Makefile:29: examples] Error 2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EhsanKhodadad try putting a breakl; behind the validate.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no difference


bool receiver_callback_called = false;

void setUp(void) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this code base we generally used sneak_case

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setUp and teadDown are weakly defined in test/unit/mock.c and used widely with the same name.

return 0;
}

int lf_sleep(interval_t sleep_duration) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about you just include your patmos.cfor those functions?

return counter++; // Incremental values
}

#define MAX_ITER 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please at the top of the file

.trimMargin()
FileUtil.writeToFile(make, projectRoot.resolve("Makefile"))
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relocate this into the patmos template repo.


companion object {
fun fromAttribute(federate: UcFederate, attr: Attribute): UcS4NocInterface {
val s4nocId = attr.getParamInt("s4noc_id") ?: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont get this. what is the s4noc_id and port?

I thought you basically only need, what is my current core and what is the core the other federate runs on?

@tanneberger tanneberger added enhancement New feature or request platform Platform support labels Jun 11, 2025
=}
}

main reactor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be federated instead of main

@EhsanKhodadad
Copy link
Author

Current output:

(170000000) [DEBUG] [SCHED] Scheduler running with keep_a4iv1=00m00) [DEBUG] [FED] S4NoCFedLF_r2 Established connection to all[34me18r2te00pe rsEB0m] [SCHED] Polling network channels
(190675000) [INFO] [NET] S4NOCPollChannel: S4NOCPollChannel_poll: No data is availaml1
000) [DEBUG] [QUEUE] Inserting event with tag (8302395121467392,0) into EventQueue
(210314000) [DEBUG][34m(20]811a00fy[DgBUven[QCHuD]atexn ex ns
a system_event at (8583904458059988,0)
(220430000) [DEBUG] [SCHED] Scheduler running with keep_alive=[340(224909000) [DEBUG] [QUEUE] Popping event from EventQueue
[34m(230663000) [DEBUG] [SCHED] Polling network channels
(241115000) [INFO] [NET] S4NOCPollChannel: S4NOCPoll[hamne3_086000) [DEBUG] [SCHED] Handling system event 0x1e7ebc for tag (8583612400140289,0)
(258114000) [DEBUG] [CLOCK_SYNC] Handle ClockSy3c (2s32m 0ve)t 7EfrGm [SigEbor -1t[ev
nt is a system_event at (8302481020956884,0)
(270142000) [DEBUG] [CLOCK_SYNC] Broadcasting priority 0 to all nei3hb(rs000) [DEBUG] [QUEUE] Popping event from EventQueue
(284769000) [DEBUG] [NET] S4NOCPollChannel: S4NOCPollChannel_send_blocking: message size: ((7)).
(286577000) [DEBUG] [SCHED] Handling system event 0x1[74m(29o98ta0 ( [02B88]63NE71 5,NOmlChannel: Total size to send: ((11))
(307189000) [DEBUG] [CLOCK_SYNC] Handle ClockSync system4ev3nt663f00) [DiBUG]r[NET[ S4NOCPollChannel: Sent ((12)) bytes
m319247000) [DEBUG] [CLOCK_SYNC] No master neighbor, w4it322712000) [DEBUG]n[SCHED] Polling network channels
[NET] S4NOCPollChannel: S4NOCPollChannel_poll: No data is available
(341412000) [DEBUG] [QUEUE] Inserting event with tag (8301811005915136,0) i[3om(ven858000) [m
BUG] [SCHED] Next event is a system_event at (8583904459914944,[)0362024000) [DEBUG] [QUEUE] Heapifying EventQueue at index 0
(373701000) [DEBUG] [SCHED] Polling network channels
(382841000) [INFO] [NET] S4NOCPollChannel: S4NOCPollChannel_po[34m(e8ei1ed 0at[ 0BU00000U7 E]o) inomesonr fr1mentQueue
(398454000) [DEBUG] [NET] S4NOCPollChannel: receive_buffer_index ((4))
(399774000) [DEBUG] [SCHED] [anmli09 99st0) [DenU 0 [eETbcSfoOCtal Cha8ne12400pe02ed,meam
size: ((7))
(420442000) [DEBUG] [FED] Received handshake request from self
(422038000) [DEBUG] [SCHED] Next event is a(43ev5nt00t [83BU4]102E74 S4NO0)ol0mhannel: S4NOCPollChannel_send_blocking: message size: ((5)).
(442800000) [DEBUG] [QUEUE] Popping event from EventQueue3
m(447395000) [DEBUG] [NET] S4NOCPollChannel: Total size to send: ((9))
(459739000) [DEBUG] [NET] S4NOCPollm(an3el:0Se)t ((B2G) [yteE
ndling system event 0x1d7ec8 for tag (8302188963037185,0)(470373000) [DEBUG] [SCHED] Polling network channels
[34m(475607000) [DEBUG] [FED] Received handshake request from[30m(
6000) [INFO] [NET] S4NOCPollChannel: S4NOCPollChannel_poll: No data is available
(489258000) [DEBUG] [NET] S4NOCPollChannel: S4NOCPollChannel_send_blocking: message size: ((5)).
(503652000) [DEBUG] [NET] S4NOCPollCh[34ml49T5ta00si e EB s]ndS (ED))N[0t event is at (8583852920307392,2147483647)
(514537000) [DEBUG] [NET] S4NOCPollChannel: Sent ((12)) bytes
(525160000) [DEBUG] [SCHED] Polling network channels
(518541000) [DEBUG] [SCHED] Next event is beyond or at stop tag: (1780298325(53835,000)4[3NF7] [0ET] S4NOCPollChannel: S4NOCPollChannel_poll: Received data 0x06220412 (") from source 1
(551432000) [DEBUG] [NET] S4NOCPollChannel: receive_buffer_index ((8))
(562429000) [DEBUG] [NET] S4NOCPollChannel: Expected message size: ((7))
(573731000) [DEBUG] [SCHED] Next event is a system_event at (8302481022746316,0)
(1340479000) [DEBUG] [QUEUE] Popping event from EventQueue
(1350750000) [DEBUG] [SCHED] Handling system event 0x1d7ec8 for tag (8302188963037185,0)
(1371858000) [DEBUG] [CLOCK_SYNC] Handle ClockSync system event 3 from neighbor -1
(1384420000) [DEBUG] [CLOCK_SYNC] No master neighbor, wait for next sync round.
(1396284000) [DEBUG] [CLOCK_SYNC] Scheduling next RequestSync
(1407559000) [DEBUG] [QUEUE] Inserting event with tag (8301811005915136,0) into EventQueue
(1428834000) [DEBUG] [SCHED] Polling network channels
(1438442000) [INFO] [NET] S4NOCPollChannel: S4NOCPollChannel_poll: Received data 0x02080000 ) from source 1
(1454533000) [DEBUG] [NET] S4NOCPollChannel: receive_buffer_index ((12))
(1466311000) [DEBUG] [NET] S4NOCPollChannel: Expected message size: ((7))
(1479537000) [WARN] [NET] S4NOCPollChannel: No receive callback registered, dropping message
(1492669000) [DEBUG] [SCHED] Next event is a system_event at (8302481022746316,0)

@EhsanKhodadad
Copy link
Author

PlatformPatmos_wait_until_interruptible will be changed in the next commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform Platform support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants