Em 22-03-2018 09:36, Paul Miranda escreveu:
> I'd like to get rid of the CSR's completely. I've never understood why
> the base ISA requires an atomic access method different than the general
> method, and also requires special instructions to access CSRs instead of
> just memory mapping them.
> Neither choice is very RISC.
Any proposal to get rid of all CSRs has to answer the following
question: what will happen to fcsr?
It can't be memory-mapped, since writes to it affect the following
floating-point instruction, and reads from it are affected by the
preceding floating-point instruction. Making it memory-mapped would mean
either serializing all memory reads and writes, or special-casing that
memory address and adding pipeline bubbles when it's seen (and if the
memory address is computed too late in the pipeline, it might mean
adding a bubble to every memory access).
>
> On Wednesday, March 21, 2018 at 10:03:36 PM UTC-5, Kelly Dean wrote:
>
> If there's CSR number space pressure, the space shouldn't be wasted
> for CSRs that the ISA spec says are always read-only (e.g.
> mvendorid, marchid, mimpid, mhartid), since they don't require
> atomic write or swap support. Instead, put them in a standard part
> of the address space, and read them using ordinary load instructions.
The mhartid might be read-only, but it's different for each hart. That
is, it's a hart-local value. That makes it a natural fit for a CSR.
> Then, since there's plenty of space for them, don't ever require
> probing to figure out platform config, or which CSRs are
> implemented, or which CSRs (or which parts of which CSRs, e.g. misa)
> are implemented as read-only vs. read/write when the ISA spec
> doesn't mandate one or the other. Instead, put in the ISA spec some
> new standard read-only meta-CSRs to record all that info, for all
> mandatory and optional CSRs for standard ISA bases and extensions,
> and for all standard platforms.
From a certain point of view, the vendor/arch/etc ID are already sort
of a meta-CSR. Software might need to branch on them very early, before
even initializing the memory (or cache-as-memory).
> To avoid having to store a lot of data in the processor's on-board
> ROM, compress it by having a single 4-bit read-only master meta-CSR
> that stores an identifier to specify one of a few popular standard
> configurations, each of which fully specifies all the options that
> require probing in the current privileged architecture manual. Then
> the full meta-CSRs are only required for unusual configurations.
> Indicate that using master CSR value zero.
RISC-V is very flexible, "unusual configurations" will probably be the norm.
--
Cesar Eduardo Barros
ces...@cesarb.eti.br