You can now run uLisp on the RP2350 RISC-V core


#1

The latest version of Earle Philhower’s Arduino core for the RP2350 now allows you to access the RISC-V core on the RP2350. So you have the option of running uLisp in RISC-V code rather than ARM code.

Performance

How does the RISC-V core perform? Here are the same benchmarks as I use on the Performance page:

Processor Architecture Clock Objects Image Code GC time Tak Q2 FFT
RP2350 ARM 150 MHz 47000 All Yes 5.0 ms 3.3 s 8.9 s 95 ms
RP2350 RISC-V 150 MHz 42500 All Yes 4.3 ms 2.9 s 7.6 s 97 ms

Installing uLisp on the RP2350

Whichever architecture you want to use, upload the ARM version of uLisp. See the updated instructions here for how to install it: Raspberry Pi Pico 2.

Why go RISC-V?

Why would you want to run uLisp on the RISC-V core?

One reason is to learn RISC-V assembler, and experiment with writing machine-code RISC-V programs, using the built-in machine code feature in uLisp together with the RISC-V assembler written in Lisp.

For example, here’s a simple RISC-V machine code program to calculate the Greatest Common Divisor of two numbers:

; Greatest Common Divisor
(defcode gcd (a b)
  swap
  ($mv 'a2 'a1)
  ($mv 'a1 'a0)
  again
  ($mv 'a0 'a2)
  ($sub 'a2 'a2 'a1)
  ($bltz 'a2 swap)
  ($bnez 'a2 again)
  ($ret))

To find the GCD of 3287 and 3460:

> (gcd 3287 3460)
173

For more information see: RISC-V assembler overview.

For example programs see: RISC-V assembler examples.

Update: Corrected the clock frequency in the table.