L
Lasse Langwadt Christensen
Guest
lørdag den 14. januar 2023 kl. 22.33.29 UTC+1 skrev John Larkin:
no, copy all the code to ram on boot
On Sat, 14 Jan 2023 12:20:24 -0800 (PST), Lasse Langwadt Christensen
lang...@fonz.dk> wrote:
lørdag den 14. januar 2023 kl. 21.09.04 UTC+1 skrev John Larkin:
On Sat, 14 Jan 2023 12:20:07 -0700, Don Y
blocked...@foo.invalid> wrote:
On 1/14/2023 8:52 AM, Martin Brown wrote:
ISR code is generally very short and best done in assembler if you want it as
quick as possible. Examining the code generation of GCC is worthwhile since it
sucks compared to Intel(better) and MS (best).
I always code ISRs in a HLL -- if only to act as pseudo-code
illustrating what the (ASM) code is actually doing. IME, people
miss details in ASM so having those expressed in a HLL makes
it easier for them to understand the *goal* of the code.
Looking at a .S is a great starting point *if* you have to
hand-tweak the code. Remembering that the code that gets
executed will change as the compiler is revised; ASM won\'t
(which can be A Good Thing as well as A Bad Thing).
In my tests GCC is between 30% and 3x slower than Intel or MS for C/C++ when
generating Intel CPU specific SIMD code with maximum optimisation.
I\'d be less worried about quality of code generator (compiler vs. human ASM)
than the effects of cache, core affinity, *which* bus(es) are called on
for each instruction, other contenders for those resources, etc.
The Pi Pico executes code out of the 2 Mbyte SPI flash, with a 16
Kbyte cache. Cache misses will be *very* slow. So code will need to be
very tight bare-metal. The entire ISR should fit in cache.
you can copy some (or all) of the code to ram instead of using execute-in-place from flash
That\'s a good idea. A typical ISR could be pretty small, and let the
mainline program thrash all it likes.
I think you can even turn off the cache to get an additional 16k ram
Yikes, execute out of SPI flash?
no, copy all the code to ram on boot