-
Notifications
You must be signed in to change notification settings - Fork 6
patmos and s4noc support #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.c
for those functions?
return counter++; // Incremental values | ||
} | ||
|
||
#define MAX_ITER 5 |
There was a problem hiding this comment.
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")) | ||
} | ||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
=} | ||
} | ||
|
||
main reactor { |
There was a problem hiding this comment.
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
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 |
PlatformPatmos_wait_until_interruptible will be changed in the next commit. |
No description provided.