Skip to content

Commit

Permalink
Update profiles format descriptions
Browse files Browse the repository at this point in the history
Update profiles format descriptions, follow all comments in discuss. Thanks Alex Bradbury and Kito Cheng's review.

Signed-off-by: Jiawei <jiawei@iscas.ac.cn>
  • Loading branch information
pz9115 authored Jun 29, 2023
1 parent ec70e4c commit 47389da
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,38 @@ The ISA subset naming conventions are described in Chapter 27 of the RISC-V
user-level ISA specification. However, tools do not currently follow this
specification (input is case sensitive, ...).

If the 'C' (compressed) instruction set extension is targeted, the compiler
will generate compressed instructions where possible.

### Profile-based format

Profiles should be recognized and used in the `-march=` option.
The benefit is that it is easy for toolchain parsing the profiles string and expanding it into normal extensions combinations. It’s also easy to combine a profile with any extensions.
Profiles should be recognized and used in the `-march=` option. The benefit use
`-march` option is easy for toolchain parsing the profiles string and expanding
it into normal extensions combinations.

Profiles format has the following form `-march=<profile-name>[+<option-ext>]+`.

As the spec defines, to use the profiles it should follow profile naming convention (See [3.4 form spec doc](https://github.com/riscv/riscv-profiles)), the toolchain will check whether an input profile name is correct at first, then do the parse work.
As the spec defines, to use the profiles it should follow profile naming convention
(See [3.4 form spec doc](https://github.com/riscv/riscv-profiles)), the toolchain
will check whether an input profile name is correct at first, then do the parse
work.

In order to distinguish between ordinary extension input and input with profiles, profiles are assumed to be entered `at the beginning of the -march option`, and then input other extensions. Profiles `should use uppercase letters` in the -march option.
In order to distinguish between ordinary extension input and input with profiles,
profiles are assumed to be entered `at the beginning of the -march option`, and
then input other extensions. Profiles `should use uppercase letters` in the `-march`
option.

e.g. `-march = RVA20U64` is a legal profile input, it will be expand into:

`-march = rv64imafdc_zicsr_ziccif_ziccrse_ziccamoa_zicclsm_za128rs`
`-march = rv64imafdc_zicsr_ziccif_ziccrse_ziccamoa_zicclsm_za128rs`,
which include all the mandatory extensions required by this profile.
Here we are `not dealing with optional extensions` to profiles in the toolchain.

Moreover, some extensions are still not ratified yet. So the toolchain only keeps their name strings only.
`-march = RVA20U64+zba_zbb_zbc_zbs` is also a legal profile input, it will add
four new extensions after expanded profile strings:

If the 'C' (compressed) instruction set extension is targeted, the compiler
will generate compressed instructions where possible.
`-march = rv64imafdc_zicsr_ziccif_ziccrse_ziccamoa_zicclsm_za128rs_zba_zbb_zbc_zbs`

and `-march = rva20u64` is an illegal profile input, it not use uppercase letters.

### Issues for consideration
* Whether `riscv32` and `riscv64` should be accepted as synonyms for `rv32`
Expand Down

0 comments on commit 47389da

Please sign in to comment.