2
16
Fork
You've already forked sentinel
0
Another size-optimized RISC-V CPU for your consideration.
  • Python 84.3%
  • Assembly 7.2%
  • C 3.7%
  • Rust 3.3%
  • SystemVerilog 1.4%
2026年06月01日 15:09:21 -04:00
.cargo Apply lints to Rust workspace. 2024年11月12日 22:11:20 -05:00
.forgejo Improve formal CI job splits [no ci]. 2026年06月01日 15:09:21 -04:00
ci Bring release notes Verilog generation commands up to date. 2026年05月09日 19:14:59 -04:00
doc Make some doc updates that I forgot before cutting a release. 2026年05月09日 22:29:28 -04:00
examples Fix doc warnings on my end. 2026年05月07日 22:46:40 -04:00
sentinel-rt Preemptively make 'cargo fix' work for sentinel-rt. 2024年12月12日 21:56:54 -05:00
src/sentinel_cpu Fix line-too-long lints resulting from package name change. 2026年05月07日 22:46:40 -04:00
tests pdm lint-fix. 2026年05月07日 22:46:40 -04:00
.gitignore Improve .gitignore. 2026年05月07日 22:46:31 -04:00
.gitmodules Add non-working RISCOF support (tests generate, but don't run, SAIL simulators not included yet). 2023年11月06日 20:42:42 -05:00
.readthedocs.yaml Fix some readthedocs issues. 2024年11月26日 01:03:02 -05:00
Cargo.lock Accept user input to change rule (default 110). 2024年11月12日 22:11:17 -05:00
Cargo.toml Apply lints to Rust workspace. 2024年11月12日 22:11:20 -05:00
CHANGELOG.md Update CHANGELOG.md for v0.1.0-beta.2. 2026年05月09日 19:44:54 -04:00
cliff.toml Update CHANGELOG.md and cliff.toml. 2025年01月12日 10:51:52 -05:00
CONTRIBUTING.md Add CONTRIBUTING.md. 2026年05月08日 10:02:05 -04:00
dodo.py Remove dependency on riscv GCC for ci-rvformal; use Python disassembler instead. 2026年05月03日 14:56:15 -04:00
LICENSE.md Create LICENSE.md 2023年11月24日 21:26:37 -05:00
pdm.lock pdm lock --refresh (somehow went out of sync). 2026年05月09日 19:11:28 -04:00
pyproject.toml Fix minimal amaranth version, as specified in CHANGELOG.md for previous release. 2026年05月07日 23:08:02 -04:00
README.md Make some doc updates that I forgot before cutting a release. 2026年05月09日 22:29:28 -04:00

Sentinel Logo. A lighthouse is shining its light on a PCB and computer chip. The silicon die of the computer chip is visible. The text "Sentinel" in a black and gray gradient stretches in parallel with the lighthouse's beam. The text covers the base of the lighthouse and is below the chip.

Logo by Tokino Kei.

Documentation Status main next

sentinel

Sentinel is a small RISC-V CPU (RV32I_Zicsr) written in Amaranth. It implements the Machine Mode privileged spec, and is designed to fit into ~1000 4-input LUTs or less on an FPGA. It is a good candidate for control tasks where a programmable state machine or custom size-tailored core would otherwise be used.

Unlike most RISC-V implementations, Sentinel is microcoded, not pipelined. Instructions require multiple clock cycles to execute. Sentinel is therefore not necessarily a good fit for applications where high throughput/ IPC is required. Short version: minimum of 4 CPI for basic arithmetic, maximum of 69 for a 31-bit shift (yes, shift instructions need work).

Sentinel has been tested against RISC-V Formal and the RISCOF frameworks, and passes both. Once I have added a few extra tests, the core can be considered correct with respect to the RISC-V Formal model. The core is also probably correct with respect to the SAIL golden model.

Why The Name sentinel?

I've like the way the word "sentinel" sounds ever since I first learned of the word, either from the title of a book on NJ lighthouses, or on an enemy from an old Sega Genesis RPG. The term has always stuck with me since then, albeit in a much more positive light than "the soldier golems of the forces of Darkness" :). Since "sentinel" means "one who stands watch", I think it's an apt name for a CPU intended to watch over the rest of your silicon, but otherwise stay out of the way. Also, since lighthouses are indeed "Sentinels Of The Shore", I wanted to shoehorn a lighthouse into the logo :).

Quick Quick Start

Verilog Programmers

If you're primarily a Verilog/VHDL programmer, each Sentinel release includes ready-to-use, standalone Verilog as an asset. If you wish to use Verilog generated from an arbitrary commit without getting involved with the source, see Pre-Generated Verilog section of the Quick Start docs.

Amaranth Programmers

For Amaranth programmers wishing to use Sentinel without playing with the source, you can install sentinel-cpu using pip or pdm:

  • pip install sentinel-cpu
  • pdm add sentinel-cpu

See the As A Dependency section of the Installation docs for other useful command-lines.

Source Code Demos

For those who want to play with the source, the absolute fastest way to get started is to check out the source code, install pdm, use pdm to create a virtual environment with appropriate tools, and generate an .env.toolchain file that pdm uses to set some environment variables for Amaranth:

pipx install pdm
git clone https://codeberg.org/cr1901/sentinel.git
cd sentinel
pdm venv create -n quick-quickstart
pdm install --venv quick-quickstart -G examples -G yowasp
pdm run use-yowasp

Use pip or pipx to install pdm depending on your Python install's recommendation.

Then, to generate Verilog core with a Wishbone Classic bus, and clk, rst, and irq input pins, run:

pdm run --venv quick-quickstart gen

To create a demo bitstream that counts primes and sets LEDs accordingly (for the iCE40-HX8K Breakout Board), run:

pdm run --venv quick-quickstart demo -i csr -p ice40_hx8k_b_evn

The output will be available in build/ at the source code root.

If you have Rust installed with the riscv32i-unknown-none-elf target, you can create a Rule 110 demo that prints neat patterns to the serial port:

pdm run --venv quick-quickstart demo-rust -i csr -p ice40_hx8k_b_evn

The output will be available in build-rust/ at the source code root.

Run pdm run --venv quick-quickstart gen -h and pdm run --venv quick-quickstart demo -h for help, and experiment!

When you're done, unset the environment variables and optionally destroy the virtual environment, as we will not be using it again:

pdm run use-local
pdm venv remove quick-quickstart

Note that extra dependencies are required for development. See the next section.

  • To get started with an environment suitable for development, consult the Installation doc page.
  • For information on the source code development environment, click here.
  • For other use cases, consult the Quick Start page. Note that they are a little less quick than the Quick Quick Start :).
  • Sentinel has multiple test suites. External submodules have their own README.mds for context and quick instructions. The Testing page and subpages give further instructions and information.
  • The Public API has its own page.
  • A copy of the below block diagram, detailed instruction cycle counts, and implemented CSRs are also on the Internals page.
  • Microcode information has its own page.

Block Diagram

Simplified block diagram of Sentinel. Black arrows are physical connections. Blue arrows represent microcode ROM outputs to Sentinel components, including feedback into the microcode ROM as inputs. Purple arrows represent microcode ROM inputs from the other components.