Replies: 9 comments 37 replies
-
Dear Nik,
Although I am not @stnolting, I thought I'd drop my thoughts on your idea
for SMP using the NeoRV32. Thank you for sharing this idea!
There are various SMP implementations of Risc-V, for instance the Ox64 from
Pine implements two clusters of two Risc-V processors, each cluster is SMP
in itself. I don't know the exact details of the BL808 chip, however.
What might be interesting to look into is that the FreeRTOS port for the
ESP32 WiFi module, found in the (ESP32 SDK) is adapted for SMP, because the
ESP32 is a dual core. The initial ESP32 modules are not based on Risc-V,
however (it's Xtensa), but an idea of how to add SMP to FreeRTOS is
certainly there and fully operational. Since the 'portable' layer of
FreeRTOS is really really thin, it shouldn't be much of a hassle to combine
the fragments from the Risc-V port and the ESP32 SMP port together!
One other thing to keep in mind is that the NeoRV32 is *not* designed for
performance. The focus is on size, correctness of handling illegal opcodes
and exceptions, debug unit and documentation. I think Stephen did an
EXTRAORDINARY job in this!! The reason that I mentioned performance is that
you may get the same stuff done with a faster single core. Of course real
time properties will be different, so there is definitely a use for having
multiple slower cores.
Speaking of performance, one of the first things I would address when
improving it, would be to ditch the horrendous Wishbone bus. At this point
the processor bus is not capable of issuing multiple transactions; each of
them have to be finished before the next one can start. This eliminates the
possibility to cleverly interleave I and D accesses to external memory.
Another significant improvement would be the addition of burst support to
these buses. Especially with the cache, I believe this would make a
significant difference. Could you confirm @stnolting, that the external bus
interface is still the same as some months ago? I might have overlooked
some significant improvements in this area.
Best regards,
Gideon
…On Mon, Apr 10, 2023 at 7:33 PM NikLeberg ***@***.***> wrote:
Hi there @stnolting <https://github.com/stnolting>,
I'd love to implement and experiment with a multi-core architecture based
on your RISC-V core. That would then be a symmetric multiprocessing system
or SMP.
Based on the privileged ISA specification there are numerous additional
unratified specifications that define how this can be done and the
necessary modules for that. For example one spec proposes a CLINT (Core
Local Interrupter) or another a CLIC (Core Level Interrupt Controller).
Also the FreeRTOS sources mention CLINT/CLIC but basically only use the
mtime register used together with mtimecmp to produce the timer interrupt.
Do you know more about the state of RISC-V and SMP? Or do you have an
opinion about the unratified specs and maybe some guidance on what version
may be the best to implement? I'm asking here because I have noticed that
up to the ancient version 1.3.0.0 (25.07.2020) you provided a CLIC module
and most likely will have had more experience with the RISC-V specs than
me. Maybe you also know how all this can come together.
The RISC-V port of FreeRTOS sadly is only single-core and only uses the
memory mapped mtime together with mtimecmp as the timer interrupt. And
the inter-processor interrupt functionality (that CLIC, CLINT etc.
provides) for SMP is not used. Have you mabe encountered other RTOS that
have the SMP already implemented? Zephyr looks like it has but the source
code is a bit of a mess. Same for NuttiX.
Thanks,
Nik
—
Reply to this email directly, view it on GitHub
<#573>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUFDSM7LBYUVRARHH6TIJLXAQ76VANCNFSM6AAAAAAWZG5UZQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hey @NikLeberg! A multi-core setup is something I also would like to play around with 😉 The hardware requirements are heavily defined by the actual software that is going to be executed on the cores. Just a few thought (from the RISC-V bubble):
That's interesting. I was not aware of that. 👍
Haha, thank you 😉 This project cannot compete with other cores like VexRisc when it comes to performance as they use deep pipelines, smart prefetch logic and maybe even out-of-order/speculative execution. So size and especially "execution safety" (i.e. correct, precise and resumable trap handling) are the targeted "niche" of this project.
😆 I like Wishbone because it is damn simple, it allows to terminate pending transfers and it is completely royalty-free. However, AXI |
Beta Was this translation helpful? Give feedback.
-
The Wishbone specification also contains definitions of burst accesses. Full AXI is a whole new level of complexity which is not that easy to implement correctly if you want all the fancy features. Ah, I see @NikLeberg also answered to that specific topic. Next time I better read the comments correctly before post 😄 IIRC we have a wishbone verification component which implements classic bursts and registered feedback modes from the B3 spec. It was used to verify the wishbone module of NEORV32 during a master thesis of a student who I was in charge of. From my point of few, an enhancement of the current wishbone implementation to burst modes would be the easiest way. I would not remove Wishbone, as most of free IP supports it. |
Beta Was this translation helpful? Give feedback.
-
Me again 😊 We had a brief discussion about the removed Would you @stnolting be welcoming to such an pr? If so, I thought of two possible implementations:
I'm not certain about the implications of either of these options, that's why I'm asking here. :) |
Beta Was this translation helpful? Give feedback.
-
To add support for the RISC-V d_bus_rvset_o : out std_ulogic; -- set reservation for current address
d_bus_rvclr_o : out std_ulogic; -- clear reservation for current address
d_bus_rvrst_o : out std_ulogic; -- clear all reservations
d_bus_rvsta_i : in std_ulogic; -- reservation state for current address Adding just the We would add this hardware immediately keeping it deactivated for now so we can further experiment with it. What would be the required additions for the Wishbone interface? Is there something spec-defined for this purpose or do we have to implement those additional signals as custom tags? |
Beta Was this translation helpful? Give feedback.
-
For the records: atomic memory accesses / LR/SC instructions were implemented in #651. |
Beta Was this translation helpful? Give feedback.
-
Well hello @stnolting Just letting you know, that some progress has been made:
There is a lot more to do but the hardware (except coherent caching) would now be ready for SMP. Now the software is missing. Even though FreeRTOS has a SMP branch, that one has not been implemented for the risc-v architecture so far. I'll probably go with zephyr as there SMP on risc-v is already existent (and even a neorv32 board implementation! 😊). In the meantime I want to extend the |
Beta Was this translation helpful? Give feedback.
-
Not required, its just plain Wishbone and reacts as soon as the
Is there a repo somewhere? 😉
I think I have read that with that aproach two individual gdb sessions need to be started.
With this and an additional
Thats perfect! Thanks for clarifiying. Then I know what to do! 😋 |
Beta Was this translation helpful? Give feedback.
-
Revisiting my SMP shenanigans... I've seen that now the
I'm paraphrasing, as I could not find the relevant answer that I think to remember you @stnolting have given somewhere. But this is not feasable currently. Mainly because while enabling the Solving the above problem could be as simple as allowing for yet another generic paramerter to individually disable the reservation station. To as complex as to modularize (put in entities) the contents of the You mentioned above:
Did something come of it? Is is on github? 😃 Or what are the design considerations you did there? |
Beta Was this translation helpful? Give feedback.
-
Hi there @stnolting,
I'd love to implement and experiment with a multi-core architecture based on your RISC-V core. That would then be a symmetric multiprocessing system or SMP.
Based on the privileged ISA specification there are numerous additional unratified specifications that define how this can be done and the necessary modules for that. For example one spec proposes a CLINT (Core Local Interrupter) or another a CLIC (Core Level Interrupt Controller). Also the FreeRTOS sources mention CLINT/CLIC but basically only use the
mtime
register used together withmtimecmp
to produce the timer interrupt.Do you know more about the state of RISC-V and SMP? Or do you have an opinion about the unratified specs and maybe some guidance on what version may be the best to implement? I'm asking here because I have noticed that up to the ancient version
1.3.0.0
(25.07.2020) you provided aCLIC
module and most likely will have had more experience with the RISC-V specs than me. Maybe you also know how all this can come together.The RISC-V port of FreeRTOS sadly is only single-core and only uses the memory mapped
mtime
together withmtimecmp
as the timer interrupt. And the inter-processor interrupt functionality (that CLIC, CLINT etc. provides) for SMP is not used. Have you mabe encountered other RTOS that have the SMP already implemented? Zephyr looks like it has but the source code is a bit of a mess. Same for NuttiX.Thanks,
Nik
Beta Was this translation helpful? Give feedback.
All reactions