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.
go build ./cmd/remoteproc-simulatorgo test ./...Start the simulator daemon:
./remoteproc-simulator --root-dir /tmp/fake-root --index 0 --name dsp0Control 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/stateInspect remote processor name:
cat /tmp/fake-root/sys/class/remoteproc/remoteproc0/nameSpecify 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/stateThe release binaries are unsigned. On macOS, you'll need to remove the quarantine attribute before running:
xattr -d com.apple.quarantine ./remoteproc-simulator