embed: device package #16
Conversation
Code Review CompleteI've completed a comprehensive review of PR #16. Here are my findings and recommendations: 🔍 OverviewThis PR makes significant architectural changes by:
|
49045b4 to
c2cf89a
Compare
There was a problem hiding this comment.
Summary of Changes
Hello @luoliwoshang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly refactors the project's device and machine configurations. It introduces an automated validation process for device package compilation across various LLGO targets, enhancing testing efficiency. Concurrently, a large number of older or redundant board-specific configuration files have been removed, streamlining the codebase and improving maintainability.
Highlights
- New Device Package Validation Script: A new shell script,
validate_device_packages.sh, has been added to the.github/scriptsdirectory. This script automates the compilation validation of various device packages against different LLGO targets, ensuring compatibility and correctness. - Extensive Board File Removal: Numerous board-specific machine configuration files (e.g.,
board_arduino.go,board_esp32.go,board_pico.go) have been removed from theemb/machinedirectory. This cleanup likely indicates a refactoring or consolidation of board definitions, or removal of deprecated/unused configurations.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request introduces a validation script for device packages and removes a significant number of board support package files, likely as part of a larger refactoring. My review focuses on the newly added script, .github/scripts/validate_device_packages.sh. I've identified a few areas for improvement to enhance its robustness and debuggability. Specifically, I'm suggesting fixes for a bug in the cleanup logic, a way to display compiler errors on build failure, and the removal of unused code.
c2cf89a to
c4f9748
Compare
c4f9748 to
481d6cd
Compare
06d2ffa to
f55f602
Compare
emb/device/emb*:remove .ld .s .c
4d7ab16 to
9f228bc
Compare
a182f47 to
dba834c
Compare
b31bc4f to
0afa242
Compare
0afa242 to
e3202b1
Compare
Migrate TinyGo v0.39.0 device package from goplus/lib/emb to goplus/emb repository root. This migration includes: - 17 architecture directories (ARM, ARM64, AVR, ESP, NRF, NXP, RP, SAM, STM32, etc.) - ~1000+ device definition files - Updated import paths from github.com/goplus/lib/emb to github.com/goplus/emb - LLGO-compatible adaptations (//llgo:link directives for Asm functions) - Placeholder implementations for runtime/interrupt.callHandlers - Support for embedded architectures: ARM Cortex-M, RISC-V, AVR, ESP32, Nordic, etc. Based on goplus/lib#16 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
Migrate device generation tools and validation infrastructure from goplus/lib PR goplus#16 (goplus/lib#16) for TinyGo v0.39.0 adaptation. Changes: - Add setup-llgo GitHub Action for LLGO installation - Add device-gen.sh script for device package generation verification - Add validate_embed_packages.sh for device/machine validation - Add validate-embed-packages workflow for CI validation - Add gen-device-avr and gen-device-svd code generation tools - Update all import paths from github.com/goplus/lib/emb to github.com/goplus/emb These tools enable automated device package generation and validation for embedded targets using LLGO compiler. Source: goplus/lib PR goplus#16 (mv/task3 branch) Commit: ebe1263c33e1a05b18df7b1b3de2132a4a4e115d 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Overview
This PR completes the migration of TinyGo v0.39.0
src/devicepackage togoplus/lib/emb, providing embedded development support for the LLGO compiler ecosystem.Major Changes
1. Device Package Migration
src/devicepackageemb/device/Import Path Standardization
emb/runtime/volatilepackageCompiler Intrinsic Adaptations
Inline Assembly Functions
Updated 5 files to be LLGO-compatible using
//llgo:linkdirectives:emb/device/asm.go- Generic inline assemblyemb/device/arm/arm.go- ARM architectureemb/device/arm64/arm64.go- ARM64 architectureemb/device/riscv/riscv.go- RISC-V architectureemb/device/avr/avr.go- AVR architectureRuntime Interrupt Handler Placeholders
Added placeholder implementations for
runtime/interrupt.callHandlersin 567 device files to resolve compilation errors:ARM System Calls (SVCall)
Added placeholder implementations for ARM Cortex-M system calls:
Related Issue: #18
RISC-V CSR Operations
Added placeholder implementations for Control Status Register operations:
Related Issue: #17
5. ARM Interrupt Placeholders
Documented existing LLGO interrupt control functions:
Package Validation Status
Most migrated device packages compile successfully. Three packages are excluded from validation:
device/riscv: picolibc compilation failuredevice/kendryte: RISC-V64 not supported by LLGOdevice/sifive: RISC-V32 not supported by LLGOdevice/renesas: no corresponding LLGO target foundllgo maybe need
llgo:exportdirective to support exporting functions with different symbol names xgo-dev/llgo#1377current will got warning
==> //export LPSPI2_IRQHandler LPSPI2_IRQHandler llgo: linkname LPSPI2_IRQHandler not found and ignored