Skip to content

Refactor haveExt() & sys_enable_ext() functions #495

@Timmmm

Description

@Timmmm

I think the haveExtension() functions are a bit confusingly named. It's unclear whether they mean that the CPU supports the extension, or if it is currently enabled (which are not necessarily the same if you have writeable misa). I believe the answer is the latter, and there are a few sys_enable_extension() functions which actually dictate whether the extension is supported. That function only exists for some extensions though.

This is confusing. I think we should do the following:

  1. Rename all haveExtension() functions to extensionEnabled().
  2. Rename all sys_enable_extension() functions to sys_support_extension() or sys_extension_supported().
  3. Add sys_extension_supported() functions corresponding to all the haveExtension() functions, so they are 1:1. Initially we can just hard-code the result rather than adding CLI arguments.
  4. Update legalize_misa() to use the sys_extension_supported() functions (even if they are hard-coded to true).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions