News for hackers. Stuff that matters.
Re:STM32MP2: ST’s first Linux capable 64-bit MPU with NPU, G... by snvzz on Saturday August 26, 2023 @02:26PM (#37275501)
>the great advantage of risc-v is that you don't need to pay arm a license for every chip, but i think that's like 99¢ or something

99¢ would be a big deal for a microcontroller. I think you might have meant a different amount.

>gigadevice's risc-v clones of popular stm32s, the gd32vf line, seem to have failed despite lower power usage. gigadevice's arm clones of the same chips (gd32f) are enormously successful

As far as I am aware, there is no GD32VF line. There is a few variants of GD32VF103 and that's it. They are still at their first iteration of RISC-V chips, testing the waters.

Instead, I would look at WCH32V, as they have a range of RISC-V based families.

>it's worse in others

RISC-V always led in 64bit code density.

As of the recently ratified bit manipulation and code size extensions, RISC-V does now offer higher density in 32bit too, beating ARM thumb2.

>and the compilers aren't as good

Potentially still the case, yet RISC-V is rapidly building the strongest ecosystem.

Re:STM32MP2: ST’s first Linux capable 64-bit MPU with NPU, G... by kragen on Saturday August 26, 2023 @03:47PM (#37276185)
for a cortex-m0 microcontroller it would be a big deal, but i think this chip is probably a 15-dollar 'microcontroller', and i'm pretty sure arm charges less for the cortex-m0

i'd say 'a few variants of gdvf103' amounts to a 'gd32vf' line, but they seem to no longer be produced. maybe you're right that they'll dip back in, especially as tensions continue to build over taiwan; i was enthusiastic to see the gd32vf though admittedly i haven't actually done anything with the ones i got

i agree that wch's ch32v line is extremely exciting, especially at the low end, where it reaches a 10¢ price point i've never before seen in 32-bit mcus (probably because arm's licensing fees are too high), and i should have mentioned it

i agree that risc-v has always led in 64-bit code density, and that with some extensions it beats thumb-2, but actually i think it was already kind of tied with thumb-2 on code density

i agree that risc-v compilers will probably eventually be better than arm compilers

but i also think that if your hardware budget includes enough ram and battery to run linux it's unlikely that issues like these will be very significant

this weekend i'm prototyping a jit compiler with the objective of keeping most of my code in a bytecode form that's denser than even thumb-2 or rv32c; i anticipate about 20% better code density and about a 2-4× slowdown, with on the order of 64 clocks per instruction of compilation time. i think this should mostly eliminate the rv64c code density advantage, which i agree is pretty killer. that's not why i'm doing it, of course (i love risc-v)

Re:STM32MP2: ST’s first Linux capable 64-bit MPU with NPU, G... by snvzz on Saturday August 26, 2023 @04:42PM (#37276714)
>but i also think that if your hardware budget includes enough ram and battery to run linux it's unlikely that issues like these will be very significant

Yeah, when you have that much ram, code density advantage matters less (although in L1$ it will still matter), and other factors weight more.

When it's designed for realtime, then high assurance and formal verification enter the game. There, I'd argue that the complexity of the ARM ISA runs counter to the goals, and RISC-V does an order of magnitude better.

>this weekend i'm prototyping a jit compiler with the objective of keeping most of my code in a bytecode form that's denser than even thumb-2 or rv32c; i anticipate about 20% better code density and about a 2-4× slowdown, with on the order of 64 clocks per instruction of compilation time. i think this should mostly eliminate the rv64c code density advantage, which i agree is pretty killer. that's not why i'm doing it, of course (i love risc-v)

Seems you're having a fun weekend. I am instead playing with old hardware, and reading some 80s book on serial comms.

Re:STM32MP2: ST’s first Linux capable 64-bit MPU with NPU, G... by kragen on Saturday August 26, 2023 @06:22PM (#37277441)
yes, the more complex arm isa runs counter to formal verification, and so does the complexity and secrecy of the arm implementation

lots of realtime systems still don't bother with formal verification, even though it's enormously more accessible today than 20 or 40 years ago

Re:STM32MP2: ST’s first Linux capable 64-bit MPU with NPU, G... by RetroTechie on Saturday August 26, 2023 @05:04PM (#37276892)
> (..) yet RISC-V is rapidly building the strongest ecosystem.

Architecture & software support is one thing, quality implementations is another.

ARM has decades of evolution & optimization behind it. Implemented in billions of devices. From cheap, small, low power to high-performance cores implemented on latest process nodes.

True, RISC-V is picking up speed. But world domination is a big task. ;-) All the places that ARM already has gone, RISC-V has still to go.

Re:STM32MP2: ST’s first Linux capable 64-bit MPU with NPU, G... by snvzz on Saturday August 26, 2023 @05:19PM (#37277010)
>All the places that ARM already has gone, RISC-V has still to go.

As NASA and ESA both selected RISC-V, it'll go quite far, in the literal sense.