Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.gtkw
/env
/venv
/venv-cocotb
/caravel
/dependencies
/mgmt_core_wrapper
Expand Down
Binary file added Extreme-Low-Power Accelerator Block Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 31 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,40 @@
# Neuromorphic Edge Inference Accelerator with ReRAM-based Synaptic Weight Storage
# Extreme-Low-Power Edge Inference Accelerator with ReRAM-based Compute

**ChipFoundry BM Labs NVM Power-Up Design Contest Submission**

## Project Overview

This project implements a neuromorphic computing accelerator that leverages BM Labs' ReRAM (Neuromorphic X1) for non-volatile synaptic weight storage, enabling ultra-low-power edge AI inference for medical monitoring devices, automotive driver assistance systems, or space-based sensor processing.
This project implements a small matrix multiplication accelerator utilizing systolic arrays that, paired with BM Labs' ReRAM and Analog In-Memory Compute, enables extreme-low-power yet fast edge AI inference.

### Key Innovation Points

- **Strategic NVM Integration:** Store trained neural network weights directly in ReRAM for instant-on operation
- **Zero Boot Time:** Eliminate SRAM/DRAM power consumption with non-volatile weight retention
- **In-Memory Analog Compute:** Leverage ReRAM's analog properties for matrix operations
- **Medical Wearable Application:** Real-time ECG/EEG anomaly detection with 10x battery life extension
- **Leverage Analog In-Memory Compute**: Utilize automatic quantization for low-power AI
- **Small and Mighty**: Slim design minimizes power consumption

### Technical Highlights

- 32x32 synaptic array (1024 programmable weights)
- <10µW inference power in active mode
- <1µW standby with full weight retention
- <1ms inference latency for typical medical signals
- Event-driven spiking neural network implementation
- 8x8 byte matrix multiplication accelerator
- Wishbone bus interface for Caravel SoC integration
- Extreme-low-power operation

## Architecture
### Architecture

**System Components:**
- **Neuromorphic Core:** BM Labs' Neuromorphic X1_32x32 array
- **Digital Controller:** FSM for timing and control via Wishbone
- **Input Buffer:** Digital-to-analog conversion for sensor data
- **Output Classifier:** Threshold detection and interrupt generation
- **Power Management:** Intelligent sleep/wake with NVM retention
<img src="./Extreme-Low-Power Accelerator Block Diagram.png" alt="Block Diagram" />

## Get Started Quickly
## Replicating Locally

### Follow these steps to set up your environment and harden the Neuromorphic X1:
### Follow these steps to set up your environment and harden the design:

1. **Clone the Repository:**

```bash
git clone https://github.com/BMsemi/caravel_user_Neuromorphic_X1_32x32.git
git clone https://github.com/partcleda/caravel_user_neuromorphic_comp.git
```

2. **Prepare Your Environment:**

```bash
cd caravel_user_Neuromorphic_X1_32x32
cd caravel_user_neuromorphic_comp
make setup
```

Expand All @@ -60,34 +50,40 @@ pip install cf-ipm
ipm install Neuromorphic_X1_32x32
```

5. **Harden the User Project Wrapper:**
5. **Edit Behavioral Model Name in IP:**

The cocotb simulation flow uses `verilog/includes/includes.rtl.caravel_user_project` as its source files, which includes a path to the Neuromorphic IP behavioral model. In order to avoid making a second `user_project_wrapper.v`, it is simpler to modify the behavioral model module name from `Neuromorphic_X1` to `Neuromorphic_X1_wb` to align with the stub that is used when actually hardening. With this change, the same `user_project_wrapper.v` works for both (cocotb) testbenching as well as hardening.

In other words, rename line 16...
```
File: ip/Neuromorphic_X1_32x32/hdl/beh_model/Neuromorphic_X1_Beh.v
16: module Neuromorphic_X1_wb (
```

6. **Run Testbenches:**

```bash
make user_project_wrapper
make cocotb-verify-all-rtl
```

6. **Harden multiple instances of IP:**
7. **Harden the Design:**

```bash
# Replace content of /verilog/rtl/user_project_wrapper.v with user_project_wrapper_multi_inst.v
# Replace content of /openlane/user_project_wrapper/config.json with config_multi_inst.json
make user_project_wrapper
```

## Application: Medical Wearable Device
## Application: Extreme-Low-Power AI

This neuromorphic accelerator targets real-time biosignal processing:
This neuromorphic accelerator targets real-time inference in extremely power-limited environments:

- **Real-time ECG/EEG anomaly detection** with on-device privacy
- **Low-power operation** extending battery life 10x vs. conventional approaches
- **Instant wake-up** with pre-loaded models (no boot time)
- **Adaptive learning** with non-volatile weight updates
- **Deep space, sea inference** where on-board power limited
- **Low-cost chiplet integration** with minimal heat and cost

## Why This Design Wins

**Innovation:** Novel neuromorphic approach that authentically exploits ReRAM's unique analog computing capabilities for in-memory compute, not just simple data storage.
**Innovation:** Novel approach that exploits ReRAM's unique analog computing capabilities for in-memory compute, not just simple data storage.

**Practicality:** Targets real-world medical device market with clear, measurable power/performance benefits.
**Practicality:** Hyper-focus on minimalist efficiency simplifes design and makes for low-risk integration in any project.

**Differentiation:** While most designs use NVM for basic memory, this leverages it for neural network inference acceleration.

Expand Down
6 changes: 6 additions & 0 deletions artifacts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Artifacts for Extreme-Low-Power Edge Inference Accelerator with ReRAM-Based Compute

This directory contains various artifacts that were requested as deliverables for the purposes of the [ChipFoundry NVM Innovation Contest](https://chipfoundry.io/challenges/bmlabs).

- `run_02_Nov_04_40_06_64`: Simulation artifacts from the local testbenching process, specifically within the directory `verilog/dv/cocotb/sim`. See the main directory `README.md` for steps to replicate.
- `ai_compliace`: As specified, a full transcript of AI/LLM tools used in the design process.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"parentUuid":null,"isSidechain":true,"userType":"external","cwd":"/home/marcus/caravel_rtl_fix","sessionId":"fe73a2da-e25b-4581-b934-8ce20a5d762f","version":"2.0.31","gitBranch":"bugfix/matmul","agentId":"60e4ebc3","type":"user","message":{"role":"user","content":"Warmup"},"uuid":"92800bfb-c3af-4ea2-9bda-69229624ec07","timestamp":"2025-11-02T09:37:47.383Z"}
{"parentUuid":"92800bfb-c3af-4ea2-9bda-69229624ec07","isSidechain":true,"userType":"external","cwd":"/home/marcus/caravel_rtl_fix","sessionId":"fe73a2da-e25b-4581-b934-8ce20a5d762f","version":"2.0.31","gitBranch":"bugfix/matmul","agentId":"60e4ebc3","message":{"model":"claude-haiku-4-5-20251001","id":"msg_012dQe6FMxnaqgxGPBKwy1fV","type":"message","role":"assistant","content":[{"type":"text","text":"I'm ready to help you search through the caravel_rtl_fix repository! I'm Claude Code, Anthropic's CLI for Claude, and I specialize in navigating and exploring codebases.\n\nI can help you with:\n\n- **Finding files** using glob patterns to search by name and extension\n- **Searching code contents** with regex patterns to locate specific implementations\n- **Reading files** when you know the exact path\n- **Navigating the repository structure** to understand your project layout\n\nYou're currently on the `bugfix/matmul` branch in `/home/marcus/caravel_rtl_fix`, which appears to be related to RTL design and testing for a matrix multiplier based on the recent commits.\n\nWhat would you like to search for or explore in this repository? Just let me know:\n\n- What files or directories you're interested in\n- What code patterns or functionality you're looking for\n- What aspects of the matrix multiplier design you want to understand\n\nI'm ready to dive in whenever you are!"}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":18207,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":18207,"ephemeral_1h_input_tokens":0},"output_tokens":227,"service_tier":"standard"}},"requestId":"req_011CUiqahs1bkudwmQEXLUnn","type":"assistant","uuid":"64968257-bb79-4df1-b9fc-9a64ed2e2cf7","timestamp":"2025-11-02T09:37:51.196Z"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"parentUuid":null,"isSidechain":true,"userType":"external","cwd":"/home/marcus/caravel_rtl_fix","sessionId":"fe73a2da-e25b-4581-b934-8ce20a5d762f","version":"2.0.31","gitBranch":"bugfix/matmul","agentId":"cf02bf68","type":"user","message":{"role":"user","content":"Warmup"},"uuid":"54ad7b45-4f18-45c1-ad20-6d37f001bce0","timestamp":"2025-11-02T09:37:47.383Z"}
{"parentUuid":"54ad7b45-4f18-45c1-ad20-6d37f001bce0","isSidechain":true,"userType":"external","cwd":"/home/marcus/caravel_rtl_fix","sessionId":"fe73a2da-e25b-4581-b934-8ce20a5d762f","version":"2.0.31","gitBranch":"bugfix/matmul","agentId":"cf02bf68","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01DnoNbmuD6s2nS2s9qAjKBs","type":"message","role":"assistant","content":[{"type":"text","text":"I'll help you search through the codebase. I'm ready to assist with finding files, searching code, or exploring the repository structure.\n\nTo get started, let me quickly understand the repository structure:\n\n<bash>\n<command>find /home/marcus/caravel_rtl_fix -maxdepth 2 -type f -name \"*.md\" -o -type f -name \"*.txt\" -o -type d -maxdepth 1 | head -30</command>\n</bash>\n\n<bash>\n<command>ls -la /home/marcus/caravel_rtl_fix/</command>\n</bash>\n\nThis appears to be a Caravel-based hardware design project with:\n- RTL design files (Verilog)\n- Cocotb verification environment\n- Documentation in README files\n- Recent work on a matrix multiplier design\n\nI can help you with:\n1. Finding specific files using glob patterns\n2. Searching code content with regex patterns\n3. Reading and analyzing file contents\n4. Exploring the codebase structure\n\nWhat would you like me to search for or explore?"}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":18218,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":18218,"ephemeral_1h_input_tokens":0},"output_tokens":257,"service_tier":"standard"}},"requestId":"req_011CUiqahrGRJP3H3bLjxkCi","type":"assistant","uuid":"16ee8f68-44b0-49ea-8e74-539e3922bed5","timestamp":"2025-11-02T09:37:54.796Z"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"parentUuid":null,"isSidechain":true,"userType":"external","cwd":"/home/marcus/caravel_rtl_fix","sessionId":"21be6f1f-585b-43fe-80f4-9da34e1eb7c8","version":"2.0.31","gitBranch":"bugfix/matmul","agentId":"d902d008","type":"user","message":{"role":"user","content":"Warmup"},"uuid":"2365fa94-a719-421e-988e-6ff8d7037116","timestamp":"2025-11-02T09:42:40.840Z"}
{"parentUuid":"2365fa94-a719-421e-988e-6ff8d7037116","isSidechain":true,"userType":"external","cwd":"/home/marcus/caravel_rtl_fix","sessionId":"21be6f1f-585b-43fe-80f4-9da34e1eb7c8","version":"2.0.31","gitBranch":"bugfix/matmul","agentId":"d902d008","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01JeaBp84iJKgce3mEPTkY2G","type":"message","role":"assistant","content":[{"type":"text","text":"I'll help you search through the codebase. Let me start by understanding the repository structure and what we're working with.\n\n<BashTool>\n<bash>\npwd && ls -la\n</bash>\n</BashTool>\n\n<BashTool>\n<bash>\nfind /home/marcus/caravel_rtl_fix -type f -name \"*.v\" -o -name \"*.sv\" | head -20\n</bash>\n</BashTool>\n\n<BashTool>\n<bash>\nfind /home/marcus/caravel_rtl_fix -type f -name \"*.py\" | head -20\n</bash>\n</BashTool>\n\n<BashTool>\n<bash>\ncat /home/marcus/caravel_rtl_fix/README.md | head -100\n</bash>\n</BashTool>\n\nI'm ready to help you search through this codebase! This appears to be a Caravel project with:\n\n- RTL files (Verilog/SystemVerilog) for matrix multiplication hardware\n- Python testbenches using cocotb\n- A verification flow using caravel_cocotb\n\nKey areas I can help you explore:\n- **RTL Design**: Hardware description files (`.v`, `.sv`)\n- **Testbenches**: Python/cocotb verification files\n- **Configuration**: Build and simulation setup files\n- **Documentation**: README and design specifications\n\nWhat would you like me to search for or explore in this codebase?"}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":0,"cache_read_input_tokens":18218,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":351,"service_tier":"standard"}},"requestId":"req_011CUiqxLXycibNm2Y9HNaHw","type":"assistant","uuid":"fa2ad55e-0c20-4671-be14-54a823fbc588","timestamp":"2025-11-02T09:42:49.249Z"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"parentUuid":null,"isSidechain":true,"userType":"external","cwd":"/home/marcus/caravel_rtl_fix","sessionId":"21be6f1f-585b-43fe-80f4-9da34e1eb7c8","version":"2.0.31","gitBranch":"bugfix/matmul","agentId":"dec42415","type":"user","message":{"role":"user","content":"Warmup"},"uuid":"b8c43184-c809-40ba-86af-5dd4903f9e79","timestamp":"2025-11-02T09:42:40.840Z"}
{"parentUuid":"b8c43184-c809-40ba-86af-5dd4903f9e79","isSidechain":true,"userType":"external","cwd":"/home/marcus/caravel_rtl_fix","sessionId":"21be6f1f-585b-43fe-80f4-9da34e1eb7c8","version":"2.0.31","gitBranch":"bugfix/matmul","agentId":"dec42415","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01M9hivbM1vPjrPY8pYA4TMp","type":"message","role":"assistant","content":[{"type":"text","text":"I'm ready to help you search through the codebase! I'm Claude Code, Anthropic's file search specialist, and I can help you:\n\n- **Find files** using glob patterns\n- **Search file contents** with regex patterns\n- **Read specific files** when you know the path\n- **Perform file operations** like listing directories\n\nI can see you're working on the `caravel_rtl_fix` repository on the `bugfix/matmul` branch. The recent commits indicate work on a matrix multiplier RTL design and testbench.\n\nWhat would you like me to search for or explore in your codebase? Just let me know:\n- What files or patterns you're looking for\n- What code you want to search through\n- Or any specific information about the project structure\n\nI'm ready when you are!"}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":0,"cache_read_input_tokens":18207,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":185,"service_tier":"standard"}},"requestId":"req_011CUiqxLXjAPjE1YfPBfbjW","type":"assistant","uuid":"7f4a99b4-e6a6-4fbd-990f-916c2860242f","timestamp":"2025-11-02T09:42:44.548Z"}
Loading
Loading