Skip to content

Commit cc06c6b

Browse files
committed
updated READMEs
1 parent 3198c8e commit cc06c6b

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is a simple and readable **RISC-V RV32I emulator** written in pure Python.
1313
- **Supports memory-mapped IO** and provides a **UART peripheral** using a pseudo-terminal, and a **memory-mapped block device** backed by an image file
1414
- **Passes all `rv32ui` and `rv32mi` unit tests** provided by [RISC-V International](https://github.com/riscv-software-src/riscv-tests)
1515
- **Supports logging** of register values, function calls, system calls, traps, invalid memory accesses, violations of invariants
16-
- Runs [MicroPython](https://micropython.org/) and [FreeRTOS](https://www.freertos.org/) with preemptive multitasking
16+
- Runs [MicroPython](https://micropython.org/), [CircuitPython](https://circuitpython.org/) with emulated peripherals, and [FreeRTOS](https://www.freertos.org/) with preemptive multitasking
1717
- Self-contained, modular, extensible codebase
1818

1919
## 🔧 Requirements
@@ -51,8 +51,9 @@ pip install -r requirements.txt
5151
├── prebuilt/ # Pre-built examples
5252
├── run_unit_tests.py # Runs RISC-V unit tests (RV32UI and RV32MI)
5353
├── riscv-tests/ # Git submodule with RISC-V unit tests
54-
├── advanced/micropython/ # MicroPython port
5554
├── advanced/freertos/ # FreeRTOS port
55+
├── advanced/micropython/ # MicroPython port
56+
├── advanced/circuitpython/ # CircuitPython port
5657
└── README.md # You're here!
5758
```
5859

advanced/circuitpython/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,53 @@
11
## Compiling CircuitPython
2+
23
```
34
cd port-riscv-emu.py
45
make
56
```
67

78
## Running CircuitPython
9+
10+
Run the emulator:
811
```
912
./riscv-emu.py --timer=mmio --ram-size=4096 --uart --blkdev=advanced/circuitpython/riscv-emu.py/build-riscv-emu.py/circuitpy.img advanced/circuitpython/riscv-emu.py/build-riscv-emu.py/firmware.elf
13+
000.001s [INFO] [UART] PTY created: /dev/ttys007
14+
000.002s [INFO] [BLOCK] Opening block device image: advanced/circuitpython/riscv-emu.py/build-riscv-emu.py/circuitpy.img
1015
```
1116

17+
Connect to CircuitPython using your favorite terminal program:
18+
```
19+
screen /dev/ttys007 115200
20+
```
21+
22+
This CircuitPython port supports an emulated serial backed by a pseudoterminal, an emulated block device backed by a filesystem image, interrupt-driven timer and tick support, CTRL+C support for tight Python loops, autoreload, and more:
23+
```
24+
Adafruit CircuitPython 9.2.7-dirty on 2025-05-19; riscv-emu.py with riscv-emu.py
25+
>>> import sys
26+
>>> sys.platform
27+
'riscv-emu.py'
28+
>>> import os
29+
>>> os.listdir("/")
30+
['code.py']
31+
>>> import time
32+
>>> time.monotonic()
33+
23.779
34+
>>> time.monotonic()
35+
24.765
36+
>>> time.sleep(1)
37+
>>> while True:
38+
... pass
39+
...
40+
...
41+
...
42+
Traceback (most recent call last):
43+
File "<stdin>", line 2, in <module>
44+
KeyboardInterrupt:
45+
>>> help("modules")
46+
__future__ busio micropython struct
47+
__main__ collections os supervisor
48+
array gc rainbowio sys
49+
board math random time
50+
builtins microcontroller storage
51+
Plus any modules on the filesystem
52+
>>>
53+
```

0 commit comments

Comments
 (0)