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

Add Chipyard port of Zephyr RTOS #2191

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

CobbledSteel
Copy link
Contributor

Summary:
Add initial support of Zephyr RTOS to Chipyard. Intended to be an intermediate option between Linux/FireMarshal flow and BaremetalIDE flow. Evaluated on Spike and RTL sim with RocketConfig/DualRocketConfig.

Zephyr RTOS Integration:

  • Adds Zephyr as a submodule (chipyard/software/zephyr)
  • Implements west-based build system for Spike and Chipyard RTL simulation
  • Enables Zephyr boot (~20K cycles on RocketConfig) for lightweight RTOS support

HTIF UART Driver for Spike/FESVR:

  • Implements Zephyr UART driver for HTIF-based serial I/O
  • Supports console and shell via HTIF
  • Integrated into Zephyr device tree and KConfig

Documentation Updates:

  • Adds Zephyr Getting Started guide for Chipyard
  • Documents Zephyr driver structure and integration
  • Provides step-by-step guide for adding new Zephyr drivers

Related PRs / Issues:

Type of change:

  • Bug fix
  • New feature
  • Other enhancement

Impact:

  • RTL change
  • Software change (RISC-V software)
  • Build system change
  • Other

Contributor Checklist:

  • Did you set main as the base branch?
  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you state the type-of-change/impact?
  • Did you delete any extraneous prints/debugging code?
  • Did you mark the PR with a changelog: label?
  • (If applicable) Did you update the conda .conda-lock.yml file if you updated the conda requirements file?
  • (If applicable) Did you add documentation for the feature?
  • (If applicable) Did you add a test demonstrating the PR?
  • (If applicable) Did you mark the PR as Please Backport?

CI Help:
Add the following labels to modify the CI for a set of features.
Generally, a label added only affect subsequent changes to the PR (i.e. new commits, force pushing, closing/reopening).
See ci:* for full list of labels:

  • ci:fpga-deploy - Run FPGA-based E2E testing
  • ci:local-fpga-buildbitstream-deploy - Build local FPGA bitstreams for platforms that are released
  • ci:disable - Disable CI

Dima Nikiforov added 3 commits February 6, 2025 22:07
Adds basic support for running Zephyr applications on single and
multi-core CPUs. Tested using RocketConfig and DualRocketConfig using
Verilator RTL simulation.

Additionally, provide docs containing a Zephyr overview, installation
instructions, and a tutorial on important Zephyr concepts and an
example of adding a driver.
Copy link
Contributor

@jerryz123 jerryz123 left a comment

Choose a reason for hiding this comment

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

If this can boot in 20k instructions, we should add a CI test that checks it using RocketConfig.

.gitmodules Show resolved Hide resolved
Copy link
Contributor

@jerryz123 jerryz123 left a comment

Choose a reason for hiding this comment

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

Zephyr is a gigantic repo, it significantly degrades clone time of chipyard.

Can you modify scripts/init-submodules-no-riscv-tools-nolog.sh such that that script does not initialize Zephyr? You can follow the pattern of the existing repos on the "blocklist" for the recursive init.

Then indicate the user should manually git submodule update --init zephyr in the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants