Open Source Hardware: The Rise of RISC-V
thenewstack.io
thenewstack.io
Every decade or so, someone tries an open, current technology and specs CPU. Plenty of free FOSS or FOSS-like z80 or 6502 cores out there, not so many cutting edge designs. The key differentiator with RISC-V is its pretty near cutting edge compared to every other free core out there.
There are tons of cores out there for FPGAs but usually they are not cutting edge powerful (although close...) and they always have interesting and expensive licensing for non-trivial use. RISC-V should, once community support and toolchains catch up, eat every licensing dollar currently being spent on Xylinx Microblaze or Intel/Altera NIOS-II. So there's money laying around interested in RISC-V. Or a more negative way of looking at it is there's a lot of money thats interested in not seeing RISC-V succeed.
Around the turn of the century, the same idea was OpenSPARC. Around last decade, the same idea was OpenPOWER. Now, its RISC-V and ... maybe its going to be a winner? Its about time.
For example, if you're a Chinese manufacturer who relies on STM32 chips with their ARM Cortex-M cores and you're worried about the winds of global trade, what do you do?
It looks like you make a new line of RISC-V chips with the same memory and peripheral layout. Problem solved:
https://www.gigadevice.com/products/microcontrollers/gd32/ri...
And as a consequence, civilians who live in heavily-sanctioned places like Iran can also learn about modern embedded computing more easily on a budget. The economic incentives to produce actual hardware brings the ISA out of FPGA-land, which can improve equality of access and opportunity around the world.
It might also help that the ISA is designed in a modular way so that it can be suitable for everything from small microcontrollers to large-scale application processors.
BTW: RISC-V being a royalty-free ISA does not mean every implementation is gonna be open source. Though it seems like SiFive's implementation is.
I thought it was an express goal of RISC-V to not depend on cutting-edge features in the ISA, in order to avoid the IP issues that constrain most other architectures, and also to keep basic implementations simple enough for e.g. educational use. Although RISC-V also puts quite a bit of emphasis on being open to extensibility, which requires some extra attention in e.g. making efficient use of the ISA encoding space.
So, in the grand scheme of things, about $0?
Small Microblaze and Nios-II cores come for free. Their larger versions are available for a token license fee. (TBH, I don't know why they even bother...)
That was definitely not the case at the turn of the century. In 2000, a new personal computer might have had a Pentium 4 or PowerPC G4, while in 1990 it had an 80486 or 68030 -- a huge performance difference. You couldn't even run a 2000-era OS (except Linux) on a 1990 CPU, and you wouldn't have wanted to if you could.
I don't know much about RISC-V, but even if it's 10 years behind the state of the art, that sounds good to me!
For instance the bit manipulation set at https://github.com/riscv/riscv-bitmanip adds frequently used operations like conditional move and population count, but also adds things like "multiply binary matrix" and "generalized or-combine", which I'm not sure even exists in X86 or AMD64.
FJCVTZS[1] seems pretty specialized, but it also seems rather simple. It converts the value in one register and puts the result in another register.
Compare that with say MOVSB[2] from X86, which reads from memory, writes to memory and updates two registers.
[1]: https://developer.arm.com/docs/100069/0607/a64-floating-poin...
[2]: https://www.felixcloutier.com/x86/movs:movsb:movsw:movsd:mov...
Having more and more specialized operations not only adds extra HW for rarely used ops, it also increases the program code size and also compiler complexity.
Standard HN automobile analogy is the subcompact car class has always been the lightest car class on the road, although a 2020 subcompact car weighs about a thousand pounds more than a subcompact did when I was in high school. Think of a 1990 Geo Metro at 1500 pounds vs a 2500 pound contemporary Toyota Yaris. Its always been weird to me that an old girlfriend's Metro weighed 1000 pounds less than the Yaris I own today.
The average American mass has gone from perhaps 150 pounds up to 300+ pounds over the same time frame, so weirdly enough cars are getting fat slower than humans on a percentage basis, LOL. Cars (AND RISC CPUs) don't run on corn syrup, I suppose.
But it is weird how heavy cars have gotten. I guess it's a combination of adding security features and demand for larger cars. I'm in the market for a car, and everything is just a bit larger than I remember for a given class. I dislike big cars, so finding a good fit is annoying.
The second disappointment is that they flubbed the once-in-a-generation opportunity to represent the boolean true value as all-1s, which would make it also useful as a mask.
Third is that the comparison and conditional-branch instructions are merged, impoverishing the sets of comparisons and branches. (E.g., comparisons could set an output register to zero or all-ones, and branches could then depend on a register.)
You might consider these pretty small disappointments, but I feel them no less keenly for that.
RISC-V will first be important in embedded applications simply as a way to avoid paying ARM royalties. Then in servers for people who want an easy way to add instruction extensions without having to beg Intel.
- ECP5 is the lowest cost medium size FPGA. Usually I would say that using a soft core is a waste of money vs. an external microcontroller unless you need to save space, but the cost of the added gates (say the next larger FPGA size than what you would need for a design without the soft core) is less than the cost of a microcontroller for the case where you are using ECP5 and you need video (a non-video micro is still cheaper).
- Mico32 is Lattice's soft core solution. You can argue about its quality, but the very stupid reason that I prefer RISC-V is that the Mico32 tool chain does not work in Ubuntu (or at least not without a lot of work- it is supposed to work in RedHat). A lot of other people complain about Mico32 because it will not run Linux, but this is not so much of an issue for my design.
- PicoRV32 is designed for high clock speed. This is probably not good for its own performance (multiple cycles per instruction), but it does mean that the RISC-V core is not the limiting factor for the rest of your FPGA design.
https://github.com/cliffordwolf/picorv32
- The barrier to entry is low (as long as you already know GCC linker scripts). The problem with NIOS-II and especially Xilinx Microblaze is that the their tools are not simple. There is a payoff for learning their tools, in that a lot of vendor cores become available. But if you don't need the vendor cores, then the non-existent toolchain (there is no system building to learn) for RISC-V is better. An example of this is the following project trellis (a cool open source FPGA toolchain, but that's another story) example design:
https://github.com/SymbiFlow/prjtrellis/tree/master/examples...
The second largest economy is going to run with this. After the trade war, they’ll reduce exposure to US restrictions.
I'm curious how much effort is left, before it's possible to build an open source PCB that those who wanted to could send off to be printed and populated, which could serve as some kind of MVP motherboard.
https://www.seeedstudio.com/Sipeed-Longan-Nano-RISC-V-GD32VF...
Kendryte K210 modules are a bit more expensive, but they include an "AI coprocessor" which looks like a sort of SIMD accelerator. They come in creepy "camera+wifi" form factors for all of your dystopian facial recognition needs:
https://www.seeedstudio.com/Sipeed-M1w-dock-suit-M1w-dock-2-...
And if you're willing to spend a bit more, SiFive also sells "Freedom" boards which are more like SBCs than microcontrollers:
The design files and schematics are available, though, so I guess it's possible to get the boards built. Thanks for the links.