[Libre-soc-dev] daily kan-ban update 09mar2021

Luke Kenneth Casson Leighton lkcl at lkcl.net
Tue Mar 9 19:31:24 GMT 2021


On Tue, Mar 9, 2021 at 7:11 PM Tobias Platen
<libre-soc at platen-software.de> wrote:
>
> I just had a look at _get_prtable_addr which takes an argument shift.
> I guess shift depends on the page size.

how far down the page-table walk things are progressing, something
like that.  let's look...

here, right at the beginning of mmu.vhdl:

            -- rts == radix tree size, # address bits being translated
            rts := unsigned('0' & pgtbl(62 downto 61) & pgtbl(7 downto 5));
            -- mbits == # address bits to index top level of tree
            mbits := unsigned('0' & pgtbl(4 downto 0));
            -- set v.shift to rts so that we can use finalmask for the
segment check
            v.shift := rts;

ahhh that's interesting.  that code starting at line 235 is a
duplication of _decode_rte().
https://github.com/antonblanchard/microwatt/blob/6523acc74344b95e7cceb83611fb8cb2a030c1a3/mmu.vhdl#L235

is a duplication of this:
https://github.com/antonblanchard/microwatt/blob/master/mmu.vhdl#L318

which has already been done as a function here:
https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/decoder/isa/radixmmu.py;h=f860e417e9f22597c44294c6ab35e698c65baa01;hb=HEAD#l315

l.



More information about the Libre-soc-dev mailing list