diff --git a/README.md b/README.md index 5a9771be..fa6f63c7 100644 --- a/README.md +++ b/README.md @@ -114,10 +114,10 @@ ESP32 simulation with an HC-SR04 ultrasonic distance sensor — real Xtensa emul | **ESP32-CAM** | Xtensa LX6 @ 240 MHz | QEMU lcgamboa (backend) | C++ (Arduino) | | **Seeed XIAO ESP32-S3** | Xtensa LX7 @ 240 MHz | QEMU lcgamboa (backend) | C++ (Arduino) | | **Arduino Nano ESP32** | Xtensa LX6 @ 240 MHz | QEMU lcgamboa (backend) | C++ (Arduino) | -| **ESP32-C3 DevKit** | RISC-V RV32IMC @ 160 MHz | RiscVCore.ts (browser) | C++ (Arduino) | -| **Seeed XIAO ESP32-C3** | RISC-V RV32IMC @ 160 MHz | RiscVCore.ts (browser) | C++ (Arduino) | -| **ESP32-C3 SuperMini** | RISC-V RV32IMC @ 160 MHz | RiscVCore.ts (browser) | C++ (Arduino) | -| **CH32V003** | RISC-V RV32EC @ 48 MHz | RiscVCore.ts (browser) | C++ (Arduino) | +| **ESP32-C3 DevKit** | RISC-V RV32IMC @ 160 MHz | QEMU lcgamboa (backend) | C++ (Arduino) | +| **Seeed XIAO ESP32-C3** | RISC-V RV32IMC @ 160 MHz | QEMU lcgamboa (backend) | C++ (Arduino) | +| **ESP32-C3 SuperMini** | RISC-V RV32IMC @ 160 MHz | QEMU lcgamboa (backend) | C++ (Arduino) | +| **CH32V003** | RISC-V RV32EC @ 48 MHz | QEMU lcgamboa (backend) | C++ (Arduino) | | **Raspberry Pi 3B** | ARM Cortex-A53 @ 1.2 GHz | QEMU raspi3b (backend) | Python | --- @@ -176,14 +176,13 @@ See [docs/RP2040_EMULATION.md](docs/RP2040_EMULATION.md) for full technical deta See [docs/ESP32_EMULATION.md](docs/ESP32_EMULATION.md) for setup and full technical details. -#### ESP32-C3 / XIAO-C3 / SuperMini / CH32V003 (RISC-V, in-browser) +#### ESP32-C3 / XIAO-C3 / SuperMini / CH32V003 (RISC-V via QEMU) -- **RV32IMC emulation** in TypeScript — no backend, no QEMU, no WebSocket +- **RV32IMC emulation** through QEMU lcgamboa with `libqemu-riscv32` and the `esp32c3-picsimlab` machine — same backend pattern as Xtensa ESP32, different libqemu binary - **GPIO 0–21** via W1TS/W1TC MMIO registers (ESP32-C3); PB0–PB5 (CH32V003) - **UART0** serial output in Serial Monitor - **CH32V003** — RV32EC core at 48 MHz, 16 KB flash, DIP-8 / SOP package — ultra-compact -- **Instant startup** — zero latency, works offline -- **CI-testable** — same TypeScript runs in Vitest +- **TypeScript ISA layer** (`RiscVCore.ts`, `Esp32C3Simulator.ts`) is kept as Vitest-only unit-test infrastructure — it cannot handle the 150+ ROM functions ESP-IDF needs and is not the production emulation path See [docs/RISCV_EMULATION.md](docs/RISCV_EMULATION.md) for full technical details. diff --git a/frontend/index.html b/frontend/index.html index e02ed76b..ee5d5e43 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -126,7 +126,7 @@ "@id": "https://velxio.dev/#app", "name": "Velxio", "alternateName": ["Velxio Circuit Simulator", "Velxio Arduino Simulator", "Velxio SPICE Simulator", "Velxio Online Electronics Simulator", "Velxio Multi-Board Emulator"], - "description": "Free, open-source online circuit and microcontroller simulator running entirely in the browser. Real-time SPICE analog co-simulation via ngspice-WASM (resistors, capacitors, op-amps, transistors, diodes, voltage regulators) wired to 19 boards across 5 CPU architectures: ATmega328p/2560/ATtiny85 (AVR8 via avr8js), RP2040 ARM Cortex-M0+ (rp2040js), ESP32-C3/CH32V003 RISC-V RV32IMC (browser), ESP32/ESP32-S3 Xtensa LX6/LX7 (QEMU), and Raspberry Pi 3B ARM Cortex-A53 (QEMU Linux). Build custom chips in C/Rust/AssemblyScript via the Wokwi Custom Chips API. Includes live oscilloscope, voltmeter, ammeter, signal generator, 100+ interactive electronic components, Monaco Editor, Serial Monitor, arduino-cli compilation, and Library Manager.", + "description": "Free, open-source online circuit and microcontroller simulator. Real-time SPICE analog co-simulation via ngspice-WASM (resistors, capacitors, op-amps, transistors, diodes, voltage regulators) wired to 19 boards across 5 CPU architectures: ATmega328p/2560/ATtiny85 (AVR8 via avr8js), RP2040 ARM Cortex-M0+ (rp2040js, browser), ESP32-C3/CH32V003 RISC-V RV32IMC (QEMU lcgamboa libqemu-riscv32), ESP32/ESP32-S3 Xtensa LX6/LX7 (QEMU lcgamboa libqemu-xtensa), and Raspberry Pi 3B ARM Cortex-A53 (QEMU Linux). Build custom chips in C/Rust/AssemblyScript via the Wokwi Custom Chips API. Includes live oscilloscope, voltmeter, ammeter, signal generator, 100+ interactive electronic components, Monaco Editor, Serial Monitor, arduino-cli compilation, and Library Manager.", "url": "https://velxio.dev/", "applicationCategory": "DeveloperApplication", "applicationSubCategory": "Electronics Simulator", @@ -147,7 +147,7 @@ "Custom chips in C, Rust, and AssemblyScript (Wokwi Custom Chips API + WASI shim) — define your own ICs and reuse them across projects", "Real AVR8 emulation: Arduino Uno (ATmega328p), Nano, Mega 2560 (ATmega2560), ATtiny85, Leonardo (ATmega32u4), Pro Mini at 16 MHz", "RP2040 emulation: Raspberry Pi Pico and Pico W (ARM Cortex-M0+ at 133 MHz via rp2040js)", - "RISC-V emulation: ESP32-C3 DevKit, XIAO ESP32-C3, ESP32-C3 SuperMini, CH32V003 (RV32IMC/RV32EC browser-native)", + "RISC-V emulation: ESP32-C3 DevKit, XIAO ESP32-C3, ESP32-C3 SuperMini, CH32V003 (RV32IMC/RV32EC via QEMU lcgamboa libqemu-riscv32)", "ESP32 / ESP32-S3 / ESP32-CAM / Nano ESP32 emulation (Xtensa LX6/LX7 via QEMU)", "Raspberry Pi 3B emulation: full ARM Cortex-A53 Linux (Raspberry Pi OS via QEMU raspi3b)", "Live instruments: oscilloscope (multi-channel), voltmeter, ammeter, signal generator (sine/square/DC)", @@ -252,7 +252,7 @@ diff --git a/frontend/src/data/examples.ts b/frontend/src/data/examples.ts index 791c4cbb..d1f0a9d2 100644 --- a/frontend/src/data/examples.ts +++ b/frontend/src/data/examples.ts @@ -3626,18 +3626,18 @@ void loop() { ], }, - // ─── ESP32-C3 (RISC-V browser emulator) Examples ────────────────────────── + // ─── ESP32-C3 (RISC-V via QEMU lcgamboa) Examples ───────────────────────── { id: 'c3-blink', title: 'ESP32-C3: Blink LED', description: - 'Blink an LED on GPIO 8 of the ESP32-C3. Runs entirely in the browser via the RISC-V emulator — no backend needed.', + 'Blink an LED on GPIO 8 of the ESP32-C3. Runs through the QEMU lcgamboa backend (libqemu-riscv32) at 160 MHz.', category: 'basics', difficulty: 'beginner', boardType: 'esp32-c3', boardFilter: 'esp32-c3', code: `// ESP32-C3 — Blink LED on GPIO 8 -// Runs in-browser via RV32IMC emulator (Esp32C3Simulator) +// Runs via QEMU libqemu-riscv32 (esp32c3-picsimlab machine) #define LED_PIN 8 @@ -3696,7 +3696,7 @@ void setup() { Serial.begin(115200); delay(200); Serial.println("=== ESP32-C3 Serial Demo ==="); - Serial.println("RV32IMC @ 160 MHz — browser emulator"); + Serial.println("RV32IMC @ 160 MHz — QEMU libqemu-riscv32"); Serial.println(); } diff --git a/frontend/src/pages/AboutPage.tsx b/frontend/src/pages/AboutPage.tsx index df5e0513..cedab358 100644 --- a/frontend/src/pages/AboutPage.tsx +++ b/frontend/src/pages/AboutPage.tsx @@ -155,10 +155,10 @@ export const AboutPage: React.FC = () => { -

RISC-V In-Browser

+

RISC-V via QEMU

- ESP32-C3 and CH32V003 run on a custom RV32IMC core written in TypeScript — entirely - client-side, no QEMU. + ESP32-C3 (DevKit, XIAO, SuperMini) and CH32V003 are emulated through the QEMU + lcgamboa fork with libqemu-riscv32, the same backend pattern as Xtensa ESP32.

diff --git a/frontend/src/pages/ArduinoEmulatorPage.tsx b/frontend/src/pages/ArduinoEmulatorPage.tsx index 0d0f14f6..6e5dc0f1 100644 --- a/frontend/src/pages/ArduinoEmulatorPage.tsx +++ b/frontend/src/pages/ArduinoEmulatorPage.tsx @@ -157,8 +157,8 @@ export const ArduinoEmulatorPage: React.FC = () => {

RISC-V (ESP32-C3)

- Browser-native RV32IMC emulation for ESP32-C3 — no backend server required, compiled - to WebAssembly, runs at 160 MHz. + RV32IMC emulation for ESP32-C3 at 160 MHz via the QEMU lcgamboa fork + (libqemu-riscv32, esp32c3-picsimlab machine).

@@ -184,9 +184,10 @@ export const ArduinoEmulatorPage: React.FC = () => {

Raspberry Pi Pico, Raspberry Pi Pico W — dual ARM Cortex-M0+ at 133 MHz.

-

RISC-V — Browser

+

RISC-V — QEMU

- ESP32-C3 DevKit, XIAO ESP32-C3, ESP32-C3 SuperMini, CH32V003 — RV32IMC at 160 MHz. + ESP32-C3 DevKit, XIAO ESP32-C3, ESP32-C3 SuperMini, CH32V003 — RV32IMC at 160 MHz + via libqemu-riscv32.

diff --git a/frontend/src/pages/DocsPage.tsx b/frontend/src/pages/DocsPage.tsx index 61f84216..4e81cd7a 100644 --- a/frontend/src/pages/DocsPage.tsx +++ b/frontend/src/pages/DocsPage.tsx @@ -1812,9 +1812,11 @@ const RiscVEmulationSection: React.FC = () => ( // risc-v

RISC-V Emulation (ESP32-C3)

- ESP32-C3, XIAO ESP32-C3, and C3 SuperMini boards use a RISC-V RV32IMC core - running at 160 MHz. Velxio emulates them entirely in the browser, no backend, no QEMU, no - WebAssembly pipeline. The emulator is written in pure TypeScript and runs at real-time speeds. + ESP32-C3, XIAO ESP32-C3, and C3 SuperMini boards run on the RISC-V RV32IMC + architecture at 160 MHz. Velxio emulates them through the same QEMU-based backend as the + Xtensa ESP32 family, using libqemu-riscv32 with the esp32c3-picsimlab + machine target. A separate TypeScript ISA implementation lives in the repo for unit-testing + RV32IMC instruction decoding, but it is not the production emulation path.

Supported Boards

@@ -2088,10 +2090,10 @@ const Esp32EmulationSection: React.FC = () => (

- Note: This section applies only to ESP32 and{' '} - ESP32-S3 (Xtensa). For ESP32-C3, XIAO ESP32-C3, and C3 SuperMini (RISC-V), - see RISC-V Emulation (ESP32-C3) in the sidebar, those boards run entirely in - the browser. + Note: This section applies to ESP32,{' '} + ESP32-S3 (Xtensa) and ESP32-C3 (RISC-V) — they all share + the same QEMU lcgamboa pipeline, just with different libqemu binaries and machine targets. + See RISC-V Emulation (ESP32-C3) for the C3-specific differences.

How It Works

diff --git a/frontend/src/pages/ElectronicsSimulatorPage.tsx b/frontend/src/pages/ElectronicsSimulatorPage.tsx index 861a6260..98658b85 100644 --- a/frontend/src/pages/ElectronicsSimulatorPage.tsx +++ b/frontend/src/pages/ElectronicsSimulatorPage.tsx @@ -25,7 +25,7 @@ const FAQ_ITEMS = [ }, { q: 'Do I need to install anything?', - a: 'No. Open velxio.dev in any modern browser and start. Compilation of Arduino sketches uses the cloud arduino-cli backend, but the SPICE solver and AVR / RP2040 / RISC-V emulators all run locally in your browser.', + a: 'No. Open velxio.dev in any modern browser and start. The SPICE solver and the AVR / RP2040 emulators run locally in your browser; Xtensa and RISC-V boards (ESP32, ESP32-C3, CH32V003) plus Raspberry Pi 3 Linux run through QEMU lcgamboa, bundled in the Docker image. Compilation of Arduino sketches uses the cloud arduino-cli backend.', }, { q: 'Is it good for teaching electronics?', diff --git a/frontend/src/pages/Esp32C3SimulatorPage.tsx b/frontend/src/pages/Esp32C3SimulatorPage.tsx index 85d58bb5..2838921f 100644 --- a/frontend/src/pages/Esp32C3SimulatorPage.tsx +++ b/frontend/src/pages/Esp32C3SimulatorPage.tsx @@ -45,7 +45,7 @@ const JSON_LD: object[] = [ applicationCategory: 'DeveloperApplication', operatingSystem: 'Any (browser-based)', description: - 'Free online ESP32-C3 RISC-V simulator. Browser-native RV32IMC emulation at 160 MHz — no backend, no install. Simulate ESP32-C3 DevKit, XIAO ESP32-C3, SuperMini, and CH32V003.', + 'Free online ESP32-C3 RISC-V simulator. RV32IMC emulation at 160 MHz via the QEMU lcgamboa backend (libqemu-riscv32). Simulate ESP32-C3 DevKit, XIAO ESP32-C3, SuperMini, and CH32V003.', url: 'https://velxio.dev/esp32-c3-simulator', offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' }, author: { '@type': 'Person', name: 'David Montero Crespo' }, @@ -90,11 +90,12 @@ export const Esp32C3SimulatorPage: React.FC = () => {

Free ESP32-C3 Simulator
- RISC-V Emulation — Runs in Your Browser + RISC-V Emulation via QEMU

- Simulate ESP32-C3 and CH32V003 RISC-V code directly in your browser — no QEMU backend, - no install. RV32IMC at 160 MHz with 48+ interactive components. + Simulate ESP32-C3 and CH32V003 RISC-V code via the QEMU lcgamboa backend + (libqemu-riscv32, esp32c3-picsimlab machine). RV32IMC at 160 MHz with 48+ interactive + components.

{

- Free & open-source · 100% browser-native · No backend required + Free & open-source · QEMU lcgamboa backend · libqemu-riscv32

Supported RISC-V boards

- Velxio emulates RISC-V microcontrollers natively in the browser using WebAssembly — the - fastest simulation path available, no server round-trip. + Velxio emulates RISC-V microcontrollers through the QEMU lcgamboa fork — the same + backend pattern used for Xtensa ESP32 / ESP32-S3, with libqemu-riscv32 instead of + libqemu-xtensa.

diff --git a/frontend/src/pages/Esp32SimulatorPage.tsx b/frontend/src/pages/Esp32SimulatorPage.tsx index 1a45c918..490a3ef6 100644 --- a/frontend/src/pages/Esp32SimulatorPage.tsx +++ b/frontend/src/pages/Esp32SimulatorPage.tsx @@ -152,7 +152,8 @@ export const Esp32SimulatorPage: React.FC = () => {

ESP32-C3 (RISC-V)

- Single-core RISC-V RV32IMC at 160 MHz. Browser-native emulation — no QEMU needed.{' '} + Single-core RISC-V RV32IMC at 160 MHz, emulated via the same QEMU backend as Xtensa + ESP32 (libqemu-riscv32, esp32c3-picsimlab machine).{' '} Learn more →

diff --git a/frontend/src/pages/LandingPage.tsx b/frontend/src/pages/LandingPage.tsx index bbd7a9ee..def018f5 100644 --- a/frontend/src/pages/LandingPage.tsx +++ b/frontend/src/pages/LandingPage.tsx @@ -583,7 +583,7 @@ const features = [ { icon: , title: '5 Emulation Engines', - desc: 'AVR8 (ATmega328P, ATmega2560, ATtiny85), RP2040 (ARM Cortex-M0+), RV32IMC (ESP32-C3 in-browser), Xtensa LX6/LX7 (ESP32 via QEMU), and ARM Cortex-A53 (Raspberry Pi 3 Linux).', + desc: 'AVR8 (ATmega328P, ATmega2560, ATtiny85), RP2040 (ARM Cortex-M0+), RV32IMC (ESP32-C3, CH32V003 via QEMU), Xtensa LX6/LX7 (ESP32 via QEMU), and ARM Cortex-A53 (Raspberry Pi 3 Linux).', }, { icon: , @@ -779,7 +779,7 @@ export const LandingPage: React.FC = () => { name: 'Does Velxio work offline?', acceptedAnswer: { '@type': 'Answer', - text: 'The SPICE solver and the AVR / RP2040 / RISC-V CPU emulators all run in your browser. Compilation of Arduino sketches requires the arduino-cli backend. Self-hosted Docker deployments work fully offline once running.', + text: 'The SPICE solver and the AVR / RP2040 CPU emulators run in your browser. Xtensa and RISC-V boards (ESP32, ESP32-S3, ESP32-C3, CH32V003) and Raspberry Pi 3 Linux run through QEMU lcgamboa, bundled in the Docker image. Compilation of Arduino sketches requires the arduino-cli backend. Self-hosted Docker deployments work fully offline once running.', }, }, { @@ -1016,14 +1016,14 @@ export const LandingPage: React.FC = () => {
- {/* ── RISC-V · RV32IMC · Browser ───────────────────────────── */} + {/* ── RISC-V · RV32IMC · QEMU lcgamboa ───────────────────────────── */}
- RV32IMC · Browser - RISC-V · 160 MHz · no backend needed + QEMU lcgamboa + RISC-V · RV32IMC · 160 MHz · libqemu-riscv32
diff --git a/frontend/src/pages/Velxio2Page.tsx b/frontend/src/pages/Velxio2Page.tsx index cd1e9da6..e47a2f5b 100644 --- a/frontend/src/pages/Velxio2Page.tsx +++ b/frontend/src/pages/Velxio2Page.tsx @@ -262,7 +262,7 @@ const CHANGE_SECTIONS = [ items: [ 'Raspberry Pi 3B — full Linux (ARM Cortex-A53 via QEMU raspi3b)', 'ESP32 / ESP32-S3 / ESP32-CAM — Xtensa LX6/LX7 via QEMU', - 'ESP32-C3 / CH32V003 — RISC-V RV32IMC, browser-native', + 'ESP32-C3 / CH32V003 — RISC-V RV32IMC via QEMU (libqemu-riscv32)', 'RP2040 — Raspberry Pi Pico / Pico W (ARM Cortex-M0+)', 'ATtiny85, ATmega2560, Leonardo, Pro Mini — AVR8 via avr8js', 'Multi-board canvas — mix architectures on the same simulation', @@ -498,7 +498,7 @@ export const Velxio2Page: React.FC = () => { {/* RISC-V */}
- Browser-native + QEMU lcgamboa RISC-V -- RV32IMC -- 160 MHz
@@ -725,8 +725,8 @@ export const Velxio2Page: React.FC = () => {

More realistic emulation

- QEMU-based Xtensa and ARM emulation. Browser-native RISC-V. Cycle-accurate AVR8 via - avr8js. Real firmware execution, not approximations. + QEMU-based Xtensa, RISC-V and ARM emulation. Cycle-accurate AVR8 via avr8js. Real + firmware execution, not approximations.

diff --git a/frontend/src/seoRoutes.ts b/frontend/src/seoRoutes.ts index d85ca25d..16ef1b3f 100644 --- a/frontend/src/seoRoutes.ts +++ b/frontend/src/seoRoutes.ts @@ -43,7 +43,7 @@ export const SEO_ROUTES: SeoRoute[] = [ title: 'Velxio — Free Online Circuit & Arduino Simulator | SPICE · ESP32 · RP2040 · ATtiny85 · Custom Chips', description: - 'Velxio is a free, open-source online circuit simulator. Real-time SPICE analog simulation (ngspice-WASM) wired to 19 boards: Arduino Uno/Mega/ATtiny85 (AVR8), ESP32 (Xtensa QEMU), ESP32-C3/CH32V003 (RISC-V), Raspberry Pi Pico (RP2040), Raspberry Pi 3 (Linux). Build custom chips in C/Rust. 100+ components, oscilloscope, voltmeter, ammeter — no cloud.', + 'Velxio is a free, open-source online circuit simulator. Real-time SPICE analog simulation (ngspice-WASM) wired to 19 boards: Arduino Uno/Mega/ATtiny85 (AVR8), ESP32 (Xtensa QEMU), ESP32-C3/CH32V003 (RISC-V via QEMU libqemu-riscv32), Raspberry Pi Pico (RP2040), Raspberry Pi 3 (Linux). Build custom chips in C/Rust. 100+ components, oscilloscope, voltmeter, ammeter — no cloud.', url: `${DOMAIN}/`, }, }, @@ -343,9 +343,9 @@ export const SEO_ROUTES: SeoRoute[] = [ priority: 0.85, changefreq: 'monthly', seoMeta: { - title: 'Free ESP32-C3 & RISC-V Simulator — Browser-Native Emulation | Velxio', + title: 'Free ESP32-C3 & RISC-V Simulator — QEMU Emulation | Velxio', description: - 'Simulate ESP32-C3 RISC-V code directly in your browser — no backend needed. RV32IMC at 160 MHz, 48+ components, Serial Monitor. Also supports CH32V003. Free and open-source.', + 'Simulate ESP32-C3 RISC-V code via the QEMU lcgamboa backend (libqemu-riscv32) at 160 MHz. 48+ components, Serial Monitor. Also supports CH32V003. Free and open-source.', url: `${DOMAIN}/esp32-c3-simulator`, }, },