Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 1.62 KB

File metadata and controls

72 lines (48 loc) · 1.62 KB

Remoteproc Simulator

A simulator for the Linux remoteproc subsystem that creates a fake sysfs interface for testing purposes. It allows you to simulate remote processor lifecycle management without requiring actual hardware.

Build

go build ./cmd/remoteproc-simulator

Test

go test ./...

Usage

Start the simulator daemon:

./remoteproc-simulator --root-dir /tmp/fake-root --index 0 --name dsp0

Control the simulated remote processor via sysfs:

# Prepare firmware file
touch /tmp/fake-root/lib/firmware/hello-world.elf

# Set firmware
echo hello-world.elf > /tmp/fake-root/sys/class/remoteproc/remoteproc0/firmware

# Start the remote processor
echo start > /tmp/fake-root/sys/class/remoteproc/remoteproc0/state

# Check status
cat /tmp/fake-root/sys/class/remoteproc/remoteproc0/state

# Stop the remote processor
echo stop > /tmp/fake-root/sys/class/remoteproc/remoteproc0/state

Inspect remote processor name:

cat /tmp/fake-root/sys/class/remoteproc/remoteproc0/name

Specify custom firmware load path:

# Set custom load path
echo /tmp > /tmp/fake-root/sys/module/firmware_class/parameters/path

# Prepare firmware file in custom path
touch /tmp/hi-universe.elf

# Set firmware
echo hi-universe.elf > /tmp/fake-root/sys/class/remoteproc/remoteproc0/firmware

# Start the remote processor
echo start > /tmp/fake-root/sys/class/remoteproc/remoteproc0/state

Installation from Releases

The release binaries are unsigned. On macOS, you'll need to remove the quarantine attribute before running:

xattr -d com.apple.quarantine ./remoteproc-simulator