riscv / sail-riscv

Sail RISC-V model
https://lists.riscv.org/g/tech-golden-model
Other
430 stars 159 forks source link

Needed: command line switch that allows for experimental functionality of model #209

Open billmcspadden-riscv opened 1 year ago

billmcspadden-riscv commented 1 year ago

For RISC-V extensions that have Sail implementations, but whose specs have not been ratified, we need a command line switch that enables "experimental" execution of these extensions.

Background: In the discussion within the tech-golden-model group, two schemes were proposed to support these types of extensions: 1) to use a git "feature branch" upon which the extension would be included, and 2) follow the pattern of the LLVM compiler which uses a command line switch to enable the experimental functionality. The consensus of the group was to use #2.

billmcspadden-riscv commented 1 year ago

The LLVM experimental switches that are used for this sort of thing are (per email with Philipp Tomsich):

See LINK for details.

Short summary: -menable-experimental-extensions + "experimental-" (in the march= string)

jrtc27 commented 1 year ago

It's not "experimental-" in the -march= string, that's only for if you're using the LLVM-specific backend target feature flags. For -march it is just the unprefixed extension name, but you must specify the version you want (so that if a newer draft is published and LLVM updates to it your code doesn't silently start using the new version that may or may not correspond to what your implementation has). For example, you'd do -menable-experimental-extensions -march=rv64gcv0p7.