extmod/modplatform: Expose CPU features/extensions.

This adds the ability to expose CPU-specific features/extensions to
scripts when the `platform` module is compiled in, by implementing
`platform.processor()`.   Right now this is only available on
bare-metal RV32 and RV64.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
Alessandro Gatti
2024-06-12 07:58:02 +02:00
committed by Damien George
parent 2327972947
commit c224e976f7
2 changed files with 46 additions and 0 deletions

View File

@@ -36,3 +36,11 @@ Functions
Returns a tuple of strings *(lib, version)*, where *lib* is the name of the
libc that MicroPython is linked to, and *version* the corresponding version
of this libc.
.. function:: processor()
Returns a string with a detailed name of the processor, if one is available.
If no name for the processor is known, it will return an empty string
instead.
This is currently available only on RISC-V targets (both 32 and 64 bits).