-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DRAFT] Bugs Found while building FSW25 Demo #236
base: main
Are you sure you want to change the base?
Conversation
Memory usage after merging this PR will be: Memory Reportaction_empty_test_c
action_microstep_test_c
action_overwrite_test_c
action_test_c
deadline_test_c
delayed_conn_test_c
event_payload_pool_test_c
event_queue_test_c
nanopb_test_c
port_test_c
reaction_queue_test_c
request_shutdown_test_c
startup_test_c
tcp_channel_test_c
timer_test_c
|
Benchmark results after merging this PR: Benchmark resultsPerformance:PingPongUc: PingPongC: ReactionLatencyUc: ReactionLatencyC: Memory usage:PingPongUc: PingPongC: ReactionLatencyUc: ReactionLatencyC: |
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 looks mostly good. I think your solution to the handshake works.
@@ -61,15 +61,16 @@ function(lf_build_generated_code MAIN_TARGET SOURCE_GEN_DIR) | |||
endif() | |||
|
|||
# Check if the Include.cmake file exists in SOURCE_GEN_DIR | |||
if (NOT EXISTS ${SOURCE_GEN_DIR}/Include.cmake) | |||
if (NOT EXISTS ${SOURCE_GEN_DIR}/${FEDERATE}/Include.cmake) |
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.
Instead of introducing a global variable, the caller of lf_build_generated_code should pass the correct SOURCE_GEN_DIR to this function. If you code-generate a federated program, source-gen dir must include the federate name
message(FATAL_ERROR "Include.cmake does not exist in src-gen directory: ${SOURCE_GEN_DIR}/Include.cmake") | ||
endif() | ||
|
||
include(${SOURCE_GEN_DIR}/Include.cmake) | ||
include(${SOURCE_GEN_DIR}/${FEDERATE}/Include.cmake) | ||
message(${REACTOR_UC_PATH}) |
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.
Again, dont think we should introduce the dependency on this global variable. ALso no need to print the REACTOR_UC_PATH here
@@ -150,8 +150,11 @@ struct AsyncNetworkChannel { | |||
#endif | |||
|
|||
#elif defined(PLATFORM_PICO) | |||
#ifdef NETWORK_CHANNEL_TCP_POSIX | |||
#error "NETWORK_POSIX_TCP not supported on PICO" | |||
//#ifdef NETWORK_CHANNEL_TCP_POSIX |
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.
Why is this commented out?
@@ -52,7 +52,8 @@ abstract class UcCmakeGenerator( | |||
|set(LF_MAIN_TARGET ${mainTarget}) | |||
|set(CMAKE_BUILD_TYPE ${targetConfig.getOrDefault(BuildTypeProperty.INSTANCE)}) | |||
|set(PLATFORM POSIX CACHE STRING "Target platform") | |||
|include($S{CMAKE_CURRENT_SOURCE_DIR}/Include.cmake) | |||
|#include($S{CMAKE_CURRENT_SOURCE_DIR}/src-gen/$S{LF_MAIN}/$S{FEDERATE}/Include.cmake) |
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.
We shouldnt code-generated commented out code. And this code change includes the same file but makes it more brittle by depending on a relative path
#error "NETWORK_POSIC_TCP not supported on PICO" | ||
#endif | ||
//#ifdef NETWORK_CHANNEL_TCP_POSIX | ||
//#error "NETWORK_POSIC_TCP not supported on PICO" |
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.
Why is this removed?
UartPolledChannel *self = (UartPolledChannel *)untyped_self; | ||
UART_CHANNEL_DEBUG("Open connection - Sending Ping"); | ||
char connect_message[] = UART_OPEN_MESSAGE; | ||
uart_write_blocking(self->uart_device, (const uint8_t *)connect_message, sizeof(connect_message)); |
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.
We shouldnt send the UART_OPEN_MESSAGE if we already are connected?
@@ -34,6 +34,7 @@ int calculate_port_level(Port *port) { | |||
} | |||
} | |||
|
|||
printf("Input port %p has level %d", port, current); |
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.
Should probably be removed
@@ -25,7 +25,7 @@ int calculate_port_level(Port *port) { | |||
} | |||
} | |||
|
|||
for (size_t i = 0; i < port->sources.size; i++) { | |||
for (size_t i = 0; i < port->sources.num_registered; i++) { |
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.
num_registered and size should be the same
@@ -30,7 +30,6 @@ void Reactor_validate(Reactor *self) { | |||
if (trigger->type == TRIG_INPUT || trigger->type == TRIG_OUTPUT) { | |||
Port *port = (Port *)trigger; | |||
validate(port->effects.num_registered == port->effects.size); | |||
validate(port->sources.num_registered == port->sources.size); |
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.
Why remove this check? It is a code-gen bug if we say that a port has N sources but then we do not register N
if (memcmp(connect_message, &self->receive_buffer[self->receive_buffer_index - sizeof(connect_message)], | ||
sizeof(connect_message)) == 0) { | ||
self->receive_buffer_index -= sizeof(connect_message); | ||
printf("Found Byte Signature of Open Message\n"); |
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.
Should probably not do any printf here since we are in an ISR?
No description provided.