You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/nuttx-rv64ilp32.md
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ With toolchain knowledge and [some tweaks](https://github.com/apache/nuttx/pull/
31
31
32
32
Thanks to NuttX's well designed structure, the `nuttx-ilp32` image can boot smoothly on the QEMU comes with the toolchain and `ostest` also passed, though there are still some cleanups left behind.
33
33
34
-
## Initial comparison
34
+
## QEMU results
35
35
36
36
Here are initial comparisons between normal `lp64` and the `rv64ilp32`, the baseline configuration is `rv-virt/nsh64`. The toolchain used for `lp64` is the stock `gcc-riscv64-unknown-elf` package version 10.2.0, and the rv64ilp32 toolchain used is the 2024.05.23 release downloaded from URL above.
37
37
@@ -64,7 +64,7 @@ nsh> free
64
64
65
65
We can see that the code size if `rv64ilp32` is slightly(2.13%) bigger, and data memory reduced 18% or 22% for static or dynamic regions.
66
66
67
-
## The C extension
67
+
###The C extension
68
68
69
69
When sharing the initial comparison with RuyiSDK people, they suggested to turn off the compressed instruction extension `C` and recheck the text sizes.
70
70
@@ -80,3 +80,42 @@ $ size nuttx-*
80
80
Experts further said that current RISC-V ISA C extension doesn't have enough considerations for the `rv64ilp32` ABI, thus code size is slightly larger when the ISA C extension is turned on.
81
81
82
82
Let's hope the RISC-V ISA C extension can evolve to support `rv64ilp32` better in the future.
83
+
84
+
85
+
## K230 results
86
+
87
+
With a few more tweaks ending with [this patch](https://github.com/apache/nuttx/pull/12528), NuttX FLAT build can run on CanMV230:
88
+
89
+
```
90
+
Hit any key to stop autoboot: 0
91
+
starting USB...
92
+
Bus usb-otg@91540000: dwc2_usb usb-otg@91540000: Core Release: 4.30a
93
+
USB DWC2
94
+
scanning bus usb-otg@91540000 for devices... 2 USB Device(s) found
95
+
scanning usb for storage devices... 0 Storage Device(s) found
96
+
Waiting for Ethernet connection... done.
97
+
Using r8152_eth device
98
+
TFTP from server 10.0.1.1; our IP address is 10.0.1.2
99
+
Filename 'master.bin'.
100
+
Load address: 0x8000000
101
+
Loading: #############
102
+
1.7 MiB/s
103
+
done
104
+
Bytes transferred = 187236 (2db64 hex)
105
+
## Starting application at 0x08000000 ...
106
+
ABC
107
+
NuttShell (NSH) NuttX-12.4.0
108
+
nsh> cat /proc/version
109
+
NuttX version 12.4.0 caa94ef64b-dirty Jun 19 2024 06:55:46 canmv230/nsh32
110
+
nsh> free
111
+
total used free maxused maxfree nused nfree
112
+
Umem: 16574332 6396 16567936 6752 16567904 19 2
113
+
nsh> ps
114
+
PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK USED FILLED COMMAND
The data memory reducation is in line with that of QEMU. Performances of a few checked apps like [getprime](https://github.com/apache/nuttx-apps/tree/master/testing/getprime) and slightly tweaked [smallpt](https://www.kevinbeason.com/smallpt/) are no worse than that of the `rv64lp64` build, and one app [calib_udelay](https://github.com/apache/nuttx-apps/blob/master/examples/calib_udelay/calib_udelay_main.c) has 15% faster result.
120
+
121
+
Note that this isn't a formal test due to limited set of apps at hand, but the result is basically in line with [those published results](https://mp.weixin.qq.com/s/rsF7kriYYaiWQYmHGYGjlg).
0 commit comments