Skip to content
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

Support for Patmos platform #383

Merged
merged 8 commits into from
Aug 3, 2024
Merged

Support for Patmos platform #383

merged 8 commits into from
Aug 3, 2024

Conversation

EhsanKhodadad
Copy link
Contributor

@EhsanKhodadad EhsanKhodadad commented Mar 5, 2024

Summary by CodeRabbit

  • New Features

    • Added support for the Patmos platform, enhancing compatibility across diverse hardware environments.
    • Introduced essential support functions for the Patmos platform, including interrupt management and real-time system functionalities.
  • Bug Fixes

    • Minor formatting adjustments made to improve readability; no functional changes.
  • Documentation

    • Updated files to include copyright notices and author information for new functionalities.
  • Chores

    • Standardized formatting across various files for improved clarity and maintainability.

@lhstrh lhstrh requested a review from erlingrj March 5, 2024 23:05
@lhstrh lhstrh changed the title Patmos platform added Support for Patmos platform Mar 5, 2024
Copy link
Collaborator

@erlingrj erlingrj left a comment

Choose a reason for hiding this comment

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

Great. There has been some changes to the reactor-c layout since you started so you need to merge your changes to the CMakeLists.txt into the new CMakeLists.txt.

low_level_platform/api/platform/lf_patmos_support.h Outdated Show resolved Hide resolved
low_level_platform/api/platform/lf_patmos_support.h Outdated Show resolved Hide resolved
low_level_platform/api/platform/lf_patmos_support.h Outdated Show resolved Hide resolved
low_level_platform/impl/src/lf_patmos_support.c Outdated Show resolved Hide resolved
low_level_platform/impl/src/lf_patmos_support.c Outdated Show resolved Hide resolved
low_level_platform/impl/src/lf_patmos_support.c Outdated Show resolved Hide resolved
core/platform/CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

Could you please fix the merge conflicts?

low_level_platform/api/platform/lf_patmos_support.h Outdated Show resolved Hide resolved
low_level_platform/impl/src/lf_patmos_support.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@erlingrj erlingrj left a comment

Choose a reason for hiding this comment

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

Looks good, but as Marten says, you need to merge main into your branch and resolve any conflict. Also, you should run our clang-format. You need to install it, and the run make format in the root of reactor-c

low_level_platform/impl/src/lf_patmos_support.c Outdated Show resolved Hide resolved
low_level_platform/impl/src/lf_patmos_support.c Outdated Show resolved Hide resolved
@erlingrj erlingrj added community feature New feature labels Apr 3, 2024
@EhsanKhodadad EhsanKhodadad force-pushed the main branch 3 times, most recently from f4d1af2 to b3dcbac Compare April 12, 2024 15:09
@lhstrh
Copy link
Member

lhstrh commented Apr 14, 2024

Note that the Arduino tests are failing with this following error:

     /home/runner/work/reactor-c/reactor-c/test/C/src-gen/arduino/AnalogReadSerial/src/low_level_platform/impl/src/lf_patmos_support.c:4:10: fatal error: lf_patmos_support.h: No such file or directory
     #include <lf_patmos_support.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.

@erlingrj
Copy link
Collaborator

You need an #if defined(PLATFORM_PATMOS) inside lf_patmos_support.c

@lhstrh
Copy link
Member

lhstrh commented May 10, 2024

@EhsanKhodadad and @erlingrj could you guys please go over the conversations and resolve whatever issues have been resolved? Thanks!

@lhstrh lhstrh requested a review from erlingrj May 17, 2024 20:37
Copy link
Collaborator

@erlingrj erlingrj left a comment

Choose a reason for hiding this comment

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

Looks good. We are still missing support in lfc for generating a CMakeListst.txt that integrates with the Patmos SDK and toolchain.

@lhstrh
Copy link
Member

lhstrh commented May 30, 2024

Looks good. We are still missing support in lfc for generating a CMakeListst.txt that integrates with the Patmos SDK and toolchain.

@EhsanKhodadad, could you respond to this? It seems we're super close to merging this, so let's try to get this across the finish line.

Copy link
Contributor

coderabbitai bot commented Aug 1, 2024

Walkthrough

The recent changes enhance platform support for the Patmos architecture within the Lingua Franca framework. Key updates include new header files providing necessary APIs, modifications to CMake build configurations, and the introduction of critical support functions for managing interrupts and timing on the Patmos platform. These improvements aim to expand compatibility without impacting existing functionality or logic.

Changes

Files Change Summary
core/CMakeLists.txt Formatting adjustments for readability in conditional statements; no functional changes.
low_level_platform/api/low_level_platform.h Added support for PLATFORM_PATMOS, including the inclusion of the lf_patmos_support.h header file for platform-specific functionalities.
low_level_platform/api/platform/lf_patmos_support.h New header file providing definitions and macros for Patmos support, ensuring type consistency and logging functionalities.
low_level_platform/impl/CMakeLists.txt Added support for building on the Patmos platform with new conditional compilation for relevant source files.
low_level_platform/impl/src/lf_atomic_irq.c Expanded conditional compilation to include support for PLATFORM_PATMOS.
low_level_platform/impl/src/lf_patmos_support.c New source file implementing interrupt management and timing functions tailored for the Patmos architecture, enhancing real-time capabilities.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Outside diff range, codebase verification and nitpick comments (2)
low_level_platform/api/platform/lf_patmos_support.h (1)

51-52: Use standard format for closing include guard.

Ensure consistency with the standard format.

- #endif // LF_PATMOS_SUPPORT_H
+ #endif /* LF_PATMOS_SUPPORT_H */
low_level_platform/impl/src/lf_patmos_support.c (1)

112-114: Use standard format for closing preprocessor directive.

Ensure consistency with the standard format.

- #endif // PLATFORM_PATMOS
+ #endif /* PLATFORM_PATMOS */
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 543b738 and 92a6457.

Files selected for processing (6)
  • core/CMakeLists.txt (5 hunks)
  • low_level_platform/api/low_level_platform.h (1 hunks)
  • low_level_platform/api/platform/lf_patmos_support.h (1 hunks)
  • low_level_platform/impl/CMakeLists.txt (3 hunks)
  • low_level_platform/impl/src/lf_atomic_irq.c (1 hunks)
  • low_level_platform/impl/src/lf_patmos_support.c (1 hunks)
Files skipped from review due to trivial changes (1)
  • core/CMakeLists.txt
Additional comments not posted (8)
low_level_platform/api/platform/lf_patmos_support.h (2)

38-42: Verify the necessity of the NO_TTY macro.

Ensure that the NO_TTY macro is required for the Patmos platform.


44-50: LGTM!

The include statements and format specifiers are appropriate.

low_level_platform/impl/src/lf_atomic_irq.c (1)

1-1: LGTM! Verify the integration.

The new preprocessor directive is correctly integrated.

Ensure that the integration does not affect existing functionality.

Verification successful

The PLATFORM_PATMOS directive is correctly integrated and follows the same pattern as other platform-specific directives.

  • low_level_platform/api/low_level_platform.h
  • low_level_platform/impl/src/lf_patmos_support.c
  • low_level_platform/impl/src/lf_atomic_irq.c
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of the new PLATFORM_PATMOS directive.

# Test: Search for the PLATFORM_PATMOS directive. Expect: Correct integration without affecting existing functionality.
rg --type c -A 5 $'PLATFORM_PATMOS'

Length of output: 1709


Script:

#!/bin/bash
# Description: Verify conditional compilation blocks and usage of PLATFORM_PATMOS directive.

# Search for conditional compilation blocks in low_level_platform/api/low_level_platform.h
rg --type c -A 5 '#elif defined(PLATFORM_PATMOS)' low_level_platform/api/low_level_platform.h

# Search for conditional compilation blocks in low_level_platform/impl/src/lf_patmos_support.c
rg --type c -A 5 '#if defined(PLATFORM_PATMOS)' low_level_platform/impl/src/lf_patmos_support.c

# Search for conditional compilation blocks in low_level_platform/impl/src/lf_atomic_irq.c
rg --type c -A 5 'defined(PLATFORM_PATMOS)' low_level_platform/impl/src/lf_atomic_irq.c

Length of output: 283


Script:

#!/bin/bash
# Description: Verify the usage and integration of the PLATFORM_PATMOS directive with broader context.

# Search for PLATFORM_PATMOS directive and its surrounding context in low_level_platform/api/low_level_platform.h
rg --type c -C 5 'PLATFORM_PATMOS' low_level_platform/api/low_level_platform.h

# Search for PLATFORM_PATMOS directive and its surrounding context in low_level_platform/impl/src/lf_patmos_support.c
rg --type c -C 5 'PLATFORM_PATMOS' low_level_platform/impl/src/lf_patmos_support.c

# Search for PLATFORM_PATMOS directive and its surrounding context in low_level_platform/impl/src/lf_atomic_irq.c
rg --type c -C 5 'PLATFORM_PATMOS' low_level_platform/impl/src/lf_atomic_irq.c

Length of output: 1392

low_level_platform/impl/src/lf_patmos_support.c (3)

92-110: Ensure correct handling of nested critical sections.

The logic for nested critical sections should be correctly implemented.


73-90: Ensure up-to-date clock functionality.

The clock functionality should be correctly implemented and up-to-date.


31-38: Include missing headers.

Ensure that all necessary headers are included.

+ #include "platform/lf_patmos_support.h"
+ #include "low_level_platform.h"

Likely invalid or redundant comment.

low_level_platform/impl/CMakeLists.txt (1)

42-46: LGTM! Patmos platform support added correctly.

The conditional block for the Patmos platform is well-structured and includes the necessary source files.

low_level_platform/api/low_level_platform.h (1)

51-52: LGTM! Patmos platform header included correctly.

The #elif block for the Patmos platform is well-structured and includes the necessary header file.

@lhstrh lhstrh enabled auto-merge August 2, 2024 21:43
@lhstrh lhstrh added this pull request to the merge queue Aug 2, 2024
Merged via the queue into lf-lang:main with commit 2581c15 Aug 3, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants