On Sat, Oct 28, 2023 at 05:54:21AM -0300, Daniel Henrique Barboza wrote: > The TCG emulation implements all the extensions described in the > RVA22U64 profile, both mandatory and optional. The mandatory extensions > will be enabled via the profile flag. We'll leave the optional > extensions to be enabled by hand. > > Given that this is the first profile we're implementing in TCG we'll > need some ground work first: > > - all profiles declared in riscv_profiles[] will be exposed to users. > TCG is the main accelerator we're considering when adding profile > support in QEMU, so for now it's safe to assume that all profiles in > riscv_profiles[] will be relevant to TCG; > > - we'll not support user profile settings for vendor CPUs. The flags > will still be exposed but users won't be able to change them. The idea > is that vendor CPUs in the future can enable profiles internally in > their cpu_init() functions, showing to the external world that the CPU > supports a certain profile. But users won't be able to enable/disable > it; > > - Setting a profile to 'true' means 'enable all mandatory extensions of > this profile, setting it to 'false' means 'do not enable all mandatory > extensions for this profile'.
While this definition of profile=off looks appealing at first, it's really just saying 'do not do anything', which means it's limiting the potential of the property. But, I'll stop talking about this now, as I have another design suggestion instead: Since profiles are like G, and other shorthand extensions (just without an official shorthand extension name), then I believe they should behave like shorthand extensions. Also, since shorthand extensions can be derived from their parts, then I think shorthand extensions should behave like synthetic extensions. For example, zic64b starts 'false', but, at realize time, if all its conditions are present, then it turns 'true'. Shorthand extensions should be able to do that too by detecting that each of the extensions they represent is present. So, I think we should automatically turn G and profiles (and future shorthand extensions) on when all their respective extensions are present. Thanks, drew