embeded/raspberry pi2021. 7. 7. 19:07

23페이지에 나오는 내용(2021.07.07 기준)

예전에 stellarisware(ti/cortex-m3) 쓸 때 이런 컨셉이 있었던 것 같은데, 플래시 용량 줄이는 것 외에는 큰 메리트가 있는지

몰랐는데 아키텍쳐의 차이인진 모르겠지만 벤치마크를 보니 꽤나 혹한다.

2.7.2. Floating-point Support
The SDK provides a highly optimized single and double precision floating point implementation. In addition to being fast, many of the functions are actually implemented using support provided in the RP2040 bootrom. This means the interface from your code to the ROM floating point library has very minimal impact on your program size, certainly using dramatically less flash storage than including the standard floating point routines shipped with your compiler. The physical ROM storage on RP2040 has single-cycle access (with a dedicated arbiter on the RP2040 busfabric), and accessing code stored here does not put pressure on the flash cache or take up space in memory, so not only are the routines fast, the rest of your code will run faster due them being resident in ROM. This implementation is used by default as it is the best choice in the majority of cases, however it is also possible to switch to using the regular compiler soft floating point support.

 

bootrom에 있는 함수들을 이용하면 더욱 빠르게 부동소수점 연산이 가능하다는데

나누기 연산의 경우 GCC 라이브러리에 비해서 586% 감소한다고

아래 두개는 먼가 미친듯한 성능 차이가 있어서 끌어 와봄.

Function        ROM/SDK (μs) GCC 9 (μs) Performance Ratio
__aeabi_fdiv 74.7                  437.5          586%
__aeabi_f2lz 63.1                 1240.5        1966%
__aeabi_f2ulz 46.1               1157            2510%

 

27페이지에 나오는 내용인데(2021.07.07 기준)

GCC 라이브러리를 사용하여 계산하는 것과

SDK 라이브러리(RP2040 hardware divider)를 이용하는 것의 속도 차이가 어마어마하다고 한다.

일단 하드웨어 divider를 사용하니 당연한걸지도 모르지만 고정속도라..

[링크 : https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-c-sdk.pdf]

[링크 : https://github.com/raspberrypi/pico-sdk]

[링크 : https://webnautes.tistory.com/1475]

 

+

2021.07.08

라즈베리 파이 pico의 bootrom 소스 리파지터리.

아무튼.. 위의 내용은 어셈블러로 함수를 작성해 놓은 듯.

[링크 : https://github.com/raspberrypi/pico-bootrom/blob/master/bootrom/mufplib-double.S]

[링크 : https://github.com/raspberrypi/pico-bootrom/blob/master/bootrom/mufplib.S]

'embeded > raspberry pi' 카테고리의 다른 글

조향장치 완성  (0) 2021.07.24
rpi 2b pxe  (0) 2021.07.12
rpi pico USB 키보드 코드 수정  (0) 2021.07.01
aarch, armv8 asimd build (neon)  (0) 2021.06.30
rpi 4b 32bit vs 64bit?  (0) 2021.06.30
Posted by 구차니