Read the $misa CSR?
Yes, but MISA does not have room for all ratified extensions. The answer is there is no standard RISC-V way for software to know every ratified extension included on a core.
Jeff
From: Tommy Murphy <tommy_...@hotmail.com>
Sent: Monday, January 24, 2022 10:03 AM
To: Mark Manning <mman...@int-bio.com>; RISC-V ISA Dev <isa...@groups.riscv.org>
Cc: Mark Manning <mman...@int-bio.com>
Subject: [EXT] Re: [isa-dev] possible to determin what extensions are available at run time?
Caution: EXT Email
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
isa-dev+u...@groups.riscv.org.
To view this discussion on the web visit
https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/LO2P265MB4776C185942235F16AACBE60F95E9%40LO2P265MB4776.GBRP265.PROD.OUTLOOK.COM.
--
The "misa" functionality that Tommy mentioned --- specified in Vol. II, Sec. 3.1.1 --- is a standard mechanism to detect ISA functionality. An alternative is to try an instruction, and catch an (illegal-instruction) exception. As you gain experience using misa, you'll quickly become aware of its limitations --- several ratified extensions are unaccounted for --- and you may find yourself resorting to that alternative. There is hope on the horizon: the Configuration Structure (task group, current draft spec).If you're developing software for an operating system, there may be a configuration structure already in place. For example, Linux uses things like "DTS" and "HWCAP". The developers of your operating system will know more.
Yes, the new (in development by the tech-config TG) "RISC-V unified low-level discovery method" will support discovery of lots of information - such as what arch extensions are supported, what optional extension features are supported, what parameters are supported, etc. In Linux-class systems, for example, this would be employed during boot by M-mode software, and some of that information may then be populated into Device Tree or ACPI tables that are passed to the OS.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/AM6PR04MB6053BBCCCECBCDDA5AE5BEA38D5E9%40AM6PR04MB6053.eurprd04.prod.outlook.com.
Well, the salient point was"Is it possible for a user level application to determine which ratified extensions are active on a given CPU at run time?No, you can't, because, even if they were listed in MISA, MISA is a machine prive level CSR, and cannot be accessed by user code.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAF4tt%3DAnqT%3DFBG%3DA7xiELEgUaMkVJgyTHtHhVb6OHYRc2g6x%3DA%40mail.gmail.com.
Connect with us!int-bio.com | Facebook | Twitter | LinkedinSave the Date! May 4-6, 2022 | https://int-bio.com/airborne-conference/This e-mail and any files transmitted with it are the property of International Biomedical, Ltd. and/or its affiliates, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited.
This is a HORRENDOUSLY bad state of affairs. There is absolutely no good reason why available core functionality should be hidden from user applications.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/20220125161850.C58BFEC2C09%40serpent.at.major2nd.com.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAF4tt%3DCB2Hv3oEWvc_VxhYJys2ZToA9_BtfJ6Qfwc%3DzB1%2B0rdA%40mail.gmail.com.
* Being able to say "require the following capabilities to run this process";
* Being able to say "require the following capabilities in hardware (not
emulated) to run this process";
* Being able to say "send a signal if this process is moved to a core that
has / doesn't have the following capabilities".
Good points, but (and this is my ignorance) Is requiring an SBI call to query the current configuration insufficient to either dynamically select or compile a library?
SBI would be heavyweight, but really only needs to be done once, e.g. to get/build an ACPI table or a Device tree(assuming it isn't simply handed to the OS at boot time - more ignorance. )One could do individual queries, or not, which is an "if it hurts when you do that, don't do that" case. (assuming the query can return more than a simple Boolean)But, having the OS know or be able to determine it is different than having a user app know it - and that was the original ask.I think my question is relevant, but restated:Is using a query mechanism to higher level software insufficient to perform the functionality required?as well as: does user level software even need to know this at all, as opposed to having OS level software load the right library based on ELF headers?(with the assumption that there is an OS level mechanism, using ACPI tables of Device tree, to get the desired information).The latter question might be answered "yes, it is needed" - in which case there would need to be a mechanism for user code to query this from OS level.
This is a HORRENDOUSLY bad state of affairs. There is absolutely no good reason why available core functionality should be hidden from user applications.I am developing a forth compiler. One of the "words" in said compiler shall be "/" (pronounced "slash") which does a division. If there is hardware division available it should use that, if not it should call the much slower software division function - THIS IS NOT a compile time selection, this is a RUN time selection.This is just one of many instances where my user application code needs to know the capabilities of the hardware it is running on.