Skip to content

Commit 03e5f28

Browse files
committed
Minor revision to appreciate Xuantie and RuyiSDK people.
Signed-off-by: Yanfeng Liu <[email protected]>
1 parent 71e4cde commit 03e5f28

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

docs/nuttx-rv64ilp32.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ So how can NuttX benefit from this `rv64ilp32` thing?
1212

1313
## The toolchain
1414

15-
After downloading the [RuyiSDK rv64ilp32 toolchain](https://github.com/ruyisdk/riscv-gnu-toolchain-rv64ilp32/releases), playing the `hello` demo and raising questions to the friendly toolchain experts, concepts about how it works have been established.
15+
After downloading the [RuyiSDK rv64ilp32 toolchain](https://github.com/ruyisdk/riscv-gnu-toolchain-rv64ilp32/releases), playing the `hello` demo and raising questions to the friendly RuiyiSDK toolchain developers, concepts about how it works have been established.
1616

17-
Here are the major points:
17+
The following are the major points:
1818

19-
- The `rv64ilp32` program is of ELF-32 class, but with flag 0x25;
20-
- The `-rsicv64ilp32` named QEMU tools in the toolchain not only support the `rv64ilp32` program format, but also support masking of the higher 32-bit addresses used by the program;
19+
- The `rv64ilp32` program ABI is of ELF-32 class, but with flag 0x25;
20+
- The `-rsicv64ilp32` suffixed QEMU tools within the toolchain not only support `rv64ilp32` ABI, but also support masking of the higher 32-bit addresses on the fly;
2121
- The toolchain uses `-march=rv64`, `-mabi=ilp32` for rv64ilp32 binaries;
22-
- The compiler has `__riscv_xlen_t==64` and `sizeof(void*)==32` defined for programs to adapt themselves;
22+
- The compiler has `__riscv_xlen_t==64` and `sizeof(void*)==32` defined for programs to adapt themselves to this ABI;
2323
- Access to addresses beyond 4G space shall be done via assembly as compiled address has been limited in 32-bit.
2424

2525
## Building NuttX
@@ -29,7 +29,7 @@ With toolchain knowledge and [some tweaks](https://github.com/apache/nuttx/pull/
2929
- Add `rv64ilp32` toolchain in `arch/risc-v` Kconfig and Toolchain.cmake to support generation of nuttx-rv64ilp32 binary.
3030
- Add a type for register width data in `arch/risc-v` layer, with some tweaking of the code base to support both existing 64-bit and 32-bit ABIs and the new rv64ilp32 ABI.
3131

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.
32+
Thanks to well designed structure of NuttX, the `nuttx-rv64ilp32` image can boot smoothly on QEMU and `ostest` also passed, though there are still some cleanups left behind.
3333

3434
## QEMU results
3535

@@ -42,7 +42,7 @@ Static footprints with `C` extension:
4242
```
4343
$ size nuttx-*
4444
text data bss dec hex filename
45-
176861 397 10256 187514 2dc7a nuttx-ilp32
45+
176861 397 10256 187514 2dc7a nuttx-rv64ilp32
4646
173171 681 12416 186268 2d79c nuttx-lp64
4747
```
4848

@@ -66,20 +66,18 @@ We can see that the code size if `rv64ilp32` is slightly(2.13%) bigger, and data
6666

6767
### The C extension
6868

69-
When sharing the initial comparison with RuyiSDK people, they suggested to turn off the compressed instruction extension `C` and recheck the text sizes.
69+
When sharing above initial comparison with XuanTie developer, I was suggested to turn off the compressed instruction extension `C` and recheck the text sizes.
7070

7171
So here we have a another list, while the rv64ilp32 program's text size is smaller:
7272

7373
```
7474
$ size nuttx-*
7575
text data bss dec hex filename
76-
231321 397 10256 241974 3b136 nuttx-ilp32
76+
231321 397 10256 241974 3b136 nuttx-rv64ilp32
7777
231441 681 12416 244538 3bb3a nuttx-lp64
7878
```
7979

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-
82-
Let's hope the RISC-V ISA C extension can evolve to support `rv64ilp32` better in the future.
80+
The XuanTie developer futher exaplained that current RISC-V ISA C extension doesn't have enough considerations for the `rv64ilp32` ABI, thus code size is slightly larger when the C extension is used. Here we hope that the RISC-V ISA C extension can evolve to support `rv64ilp32` ABI better in the future.
8381

8482

8583
## K230 results
@@ -116,6 +114,6 @@ nsh> ps
116114
1 1 100 RR Task - Running 0000000000000000 003024002096 69.3% nsh_main
117115
nsh>
118116
```
119-
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.
117+
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 the [calib_udelay](https://github.com/apache/nuttx-apps/blob/master/examples/calib_udelay/calib_udelay_main.c) app even has 15% faster result.
120118

121119
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

Comments
 (0)