litex icon indicating copy to clipboard operation
litex copied to clipboard

vexriscv_smp: only 32 CSR locations supported with current mem_mam

Open AndrewD opened this issue 1 year ago • 3 comments

The current memory map allows for 32 CSR locations: INFO:SoC:32-bit CSR Bus, 32-bit Aligned, 16.0KiB Address Space, 2048B Paging, big Ordering (Up to 32 Locations).

This can be expanded to 64 by specifying --csr-address-width=15, however the cpu mem_map places clint straight after csr "csr": 0xf000_0000, "clint": 0xf001_0000,

So this causes the following build error:

ERROR:SoCBusHandler:Region overlap between clint and csr:
ERROR:SoCBusHandler:Origin: 0xf0010000, Size: 0x00010000, Mode: RW, Cached: False Linker: False
ERROR:SoCBusHandler:Origin: 0xf0000000, Size: 0x00020000, Mode: RW, Cached: False Linker: False

Can the mem_map be adjusted easily to support additional CSR locations?

AndrewD avatar Jan 19 '24 01:01 AndrewD

Hi, True: CSR region is a bit small.

With https://github.com/enjoy-digital/litex/pull/1876 it is possible to move CSR/CLINT/PLIC (and consequently it's possible to increase CSR region).

This may be done by overriding region directly from the target and/or by passing region base address using CLI args.

Is this solution is good to you?

trabucayre avatar Jan 22 '24 17:01 trabucayre

Thanks - that should address the issue.

On Tue, 23 Jan 2024 at 04:41, Gwenhael Goavec-Merou < @.***> wrote:

Hi, True: CSR region is a bit small.

With #1876 https://github.com/enjoy-digital/litex/pull/1876 it is possible to move CSR/CLINT/PLIC (and consequently it's possible to increase CSR region).

This may be done by overriding region directly from the target and/or by passing region base address using CLI args.

Is this solution is good to you?

— Reply to this email directly, view it on GitHub https://github.com/enjoy-digital/litex/issues/1875#issuecomment-1904497090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAX6Y3FEERAPVRCMLSROZ3YP2QGNAVCNFSM6AAAAABCBGK6PKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBUGQ4TOMBZGA . You are receiving this because you authored the thread.Message ID: @.***>

AndrewD avatar Jan 24 '24 04:01 AndrewD

As noted by @AndrewD, https://github.com/enjoy-digital/litex/pull/1885 can also be useful for this. You now have the possibility to move CLINT/PLIC or reduce CSR paging.

enjoy-digital avatar Feb 05 '24 12:02 enjoy-digital

Thanks @AndrewD for the feedback.

enjoy-digital avatar Mar 12 '24 08:03 enjoy-digital