RISCVEMU: 128 bit RISC-V emulator
bellard.org
bellard.org
It gets as far as the "Welcome to Fedora 25 (Twenty Five)!" banner but then gives a bunch of systemd errors around "Function not implemented". inotify seems to be the main one.
[1] https://fedoraproject.org/wiki/Architectures/RISC-V
[2] https://github.com/rwmjones/fedora-riscv-kernel/blob/master/...
The more glib one is that if you're interested in building a CPU emulator from source but don't want to rebuild a kernel, you're probably skipped a few important skills along the way.
I'm quite capable of rebuilding the kernel, just lazy. The main problem is that the kernel is embedded in the bootloader, and the bootloader for this emulator is patched because the RISC-V HTIF [obsolete device] emulation is different from the other RISC-V implementations, which makes rebuilding the whole thing somewhat tedious.
Really?! Got a link? I thought the ISA was still in flux, isn't it a bit early to be making hardware?
The user-level ISA is fixed. The privileged-level ISA is in flux, but people obviously think there's enough there to make real hardware. To be fair the main problems with the privspec are to do with virtualization, and likely the first crop of hardware won't support that or will have only interim support.
> BOOM supports atomics, IEEE 754-2008 floating-point, and page-based virtual memory. We have demonstrated BOOM running Linux, SPEC CINT2006, and CoreMark.
[1] https://www2.eecs.berkeley.edu/Pubs/TechRpts/2015/EECS-2015-...
Amarisoft
We are delighted to bring some affordable tools and software to the 4G mobile community to unleash creativity and at the end expand communications among people. Accessible technology is the basement of possible success story. We at Amarisoft are working on helping all size of company or individuals being a player in mobile networks of now and future generation. We hope you'll enjoy the opportunity.
[..]
Fabrice Bellard
Fabrice is a computer programmer who is best known as the creator of the FFmpeg and QEMU software projects. He studied at Ecole Polytechnique, specializing at Telecom Paris in 1996. Fabrice is an amazing person bringing creativity to the whole team.
[0] https://news.ycombinator.com/item?id=2557422
But when running the 128bit demo I get a funny value for sqrt(2) in fp64 mode: 1.728102266788482
On the other hand, this makes the code portable and indeed the 32-bit and 64-bit targets work pretty well even on my ARM AArch32 machine.
The RISC-V spec mentions it supports this in the “L” Standard Extension for Decimal Floating-Point.
Although there is discussion about creating one if you want to join the ISA-dev mailing list.
I read it about a year ago and found it straightforward and clean.
Are you making a technical point about stuff missing?
Dismissing it as a "technical point" and implying that kobeya never should have commented is not.
Without having looked at the code, I would guess that it wasn't worth the effort of being the first 128-bit target on a core that is based on JIT compilation and supports 32-bit hosts.
- the assembler dst, src backward syntax (like intel);
- the fact that this processor design is being aggressively pushed here (featured several times already);
- the fact that the instruction set is non-orthogonal (32-bit fixed encoding makes the decoder simple, but creates the same load-store problem as on SPARC - hello non-existent, synthetic instructions!);
- the fact that they could have extended the open source UltraSPARC T-series design, but decided to just re-invent the wheel all over again. How does 128-bit support justify starting from scratch, and not re-using what is already there and open sourced?
The last point is their biggest sin, in my view. There is already an open source processor design, and a good, solid design, and they just went ahead and invented their own anyway. All the lessons about reuse went out of the window. We're the only industry that I know of that keeps nuking itself and starting from scratch, throwing away all the work which had been done before.
Oh, and I seriously dislike the instruction mnemonics. To the authors of RISC-V:
couldn't you have made the mnemonics MC68000 compatible, or at least make them similar?
- Assembler syntax is a matter of personal preference. I also loved programming the 68K, writing OS-9/68k drivers back in 1990. However the vast majority of even kernel/embedded programmers rarely touch assembler these days.
- SPARC & register windows. A very unfortunate design choice in hindsight. The RISC-V ISA developers have paid very close attention to existing designs, and other ISAs and microarchitectures are frequently referenced. Have a look at the discussions on the ISA-Dev mailing list: https://groups.google.com/a/groups.riscv.org/forum/#!forum/i...
- RISC-V is trying to avoid patents, so they cannot necessarily reuse existing ISAs, even open ones.
What do you mean, unfortunate design choice? The register windows help compilers and provide 256 virtual registers, thus significantly boosting performance. It's one of the biggest, best features of the Scalable Processor ARChitecture.
And that's the exact feature RISC-V considers "unfortunate". I cannot believe it!
Considering that the OpenSPARC cores are under the GPL, what impact do patents have in that case?
Another aim of RISC-V is to provide an architecture which is both easy to implement at the low end, and can be scaled at the high end. Register windows are not easy to implement. Register renaming OTOH can be left out of low end designs and included (as an invisible microarchitectural detail) at the high end.
The smallest RISC-V implementation is PicoRV32 which is ridiculously small (https://github.com/cliffordwolf/picorv32 - smallest is 725 LUTs in an FPGA). It couldn't have been done if the architecture had register windows.
BTW I'm fairly certain that high end SPARC implementations must be doing register renaming, otherwise each function is limited to 8 or 16 registers.
Wanting to facilitate others to do so, sure. This is a common thing to do in a computer engineering program, and I believe it was an explicit design goal that student projects could be real RISC-V implementations instead of targeting the toy ISAs commonly used for this purpose.
The very very low end PicoRV32 is not pipelined (unsurprisingly). More ordinary low end (eg. Rocket) has the canonical Hennessey-and-Patterson 5 stage pipeline and still doesn't need to expose branch delay slots in the ISA.
I should say also that the classical MIPS -- ie. no instruction dependencies -- was another mistake in hindsight.
...and earlier you wrote
However the vast majority of even kernel/embedded programmers rarely touch assembler these days.
It is unclear to me why this double-standard is okay: on one hand, that which is really important, like assembler syntax and mnemonics is exposed and yet not considered relevant, but "micro-architectural details" which really don't hurt me as the coder one way or the other should be hidden.
I am not sure who the RISC-V designers expect for their audience, nor why this double standard, but in the light of "the 50 year plan", it appears that the designers haven't given it much thought, if any at all.
In the end is this: we have a RISC-V processor design which is not human friendly as far as mnemonics go, and with such processors, relying on compilers will be the only practical solution. Who has not learned from the lessons of history is in for another bitter teaching: such attempts have failed miserably in the past. As evidence, I point to PA-RISC and Itanium. If it were but for a better compiler!
The microarchitecture is nothing to do with the assembler syntax or instruction set.
I know that, my point is that this processor design has completely screwed up priorities in terms of features and usage.
What do you mean by "no instruction dependencies"?
However, my knowledge is years old. Have these problems been solved?
They must have been. I used some Snoracle T4 hardware, and the CPU's were blazingly fast. How they did it though, I don't know, as I didn't have a chance to look into it.
I'm not familiar with this. Could you explain the problem or point me in the right direction for background info?
That's why the SPARC assembler, as(1), accepts a completely made-up, non-existent, synthetic instruction, ld. In reality, what happens is that as(1) assembles this made-up fantasy into two instructions, sethi and or. This is the cold, hard reality of loading a 32-bit value from memory:
String0:
.asciz "Counter is %.2d\\n"
.align 4
main: sethi %hi(String0), %l0
or %l0, %lo(String0), %l01: no trap on integer overflow instructions? Come on:
a) the MIPS (a processor designed for simplicity too) has those!
b) in 21st century, security features should not be optional.