8000 GitHub - Mazin-O3/vemu: An 8-bit inspired RISC-V computer emulator · GitHub
[go: up one dir, main page]

Skip to content
Mazin-O3Public

About

An 8-bit inspired RISC-V computer emulator

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Vemu

A RISC-V microcomputer emulator running CP/M Neo in the browser

An 8-bit inspired RISC-V computer emulator, designed to give a simple environment for learning about computer architecture and operating systems.

Run Emulator License

Vemu

Overview

Vemu simulates a self-contained 32-bit hardware environment inside the browser.

Hardware Specification

Vemu emulates a custom 32-bit RISC-V microcomputer:

Component Specification
CPU RV32I + M extension for hardware multiplication and division
RAM 64 KB, byte-addressable (0x0000–0xFEFF)
Memory-mapped I/O Top page 0xFF00–0xFFFF
Storage 2 MB CP/M Neo disk
Flash (XIP) Read-only flash window at 0x10000 extending over the loaded disk image; kernel/CCP run in place
System clock Selectable 50 kHz – 1 MHz

Register Map

Addr Name Access Description
0xFF00 DISK_BUFFER R/W 512-byte sector buffer; each read/write advances the buffer offset
0xFF04 DISK_SECTOR W Select sector: [15] write flag, [14:0] LBA
0xFF08 KBD_DATA R Pop next key, [6:0] ASCII (bit 7 cleared)
0xFF0C KBD_STATUS R [0] = 1 if a key is ready; read does not consume
0xFF10 DSP_DATA W Write a character to the text display
0xFF14 CLK_KHZ R System clock frequency in kHz
0xFF18 TIMER_CSTR R/W Timer control/status (see bit table)
0xFF1C TIMER_CNTR R/W 16-bit timer counter (writes set it)
0xFF20 DMA_SAR R/W DMA source address (16-bit)
0xFF24 DMA_DAR R/W DMA destination address (16-bit)
0xFF28 DMA_WCR R/W DMA word count (16-bit)
0xFF2C DMA_CSTR R/W DMA control (write) / status (read)

DMA_CSTR — 0xFF2C

Write:

Bit Field Description
0 START Write 1 toggles the transfer on/off
1 STREAM 1 = stream mode (bus-locked)
2 SRC_INC Auto-increment source address
3 DST_INC Auto-increment destination address
5:4 STEP 00 8-bit, 01 16-bit, 10 32-bit
7:6 — Ignored

Read: [0] RUNNING (1 = busy), [1]–[5] readback of STREAM/SRC_INC/DST_INC/STEP, [7:6] reads 0. STEP 10 and 11 both decode to 32-bit; writing 11 reads back as 10.

TIMER_CSTR — 0xFF18

Bit Field Description
0 EN 1 = Enabled
1 MOD 0 = Continuous, 1 = One-shot
2 OVF 1 = Overflow; write 1 to clear
5:4 PRESCALE 00 1, 01 8, 10 64, 11 256
3 — —
7:6 — —

DISK_SECTOR — 0xFF04

Bit Field Description
15 WRITE 1 = Write buffer to disk, 0 = load sector into buffer
14:0 LBA Physical sector number

CP/M Neo

Vemu boots CP/M Neo, a CP/M-inspited operating system.

Boot Modes: Disk vs Flash