Live data from Hacker News

TinyEMU – x86 and RISC-V emulator, small and simple while being complete

bellard.org

11–20 of 32 posts

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#11
post #6

I'm still not 100% sure what exactly this is, even after reading the description thrice. Is it basically a RISC-V core in a system with standard x86 PC peripherals, i.e. a very odd but theoretically possible configuration to emulate, in the same way that QEMU (of the same author) lets you attach e.g. a classic VGA controller to an ARM core?

I think it’s both a a RISCV emulator and an x86 emulator. I think it’s both, presumably reusing some pieces allowing systems to be emulated like you say with weird configurations.

The riscv system is emulated in software whereas the x86 system is virtualized using kvm.

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#12
post #8

The B extension never gets any love. The RISC-V crowd hates bitwise anything.

B extension was ratified in 2021, near the end. It is considerably newer than every extension this emulator implements, and thus reasonable it'd have these and not B.

Here's the ratified spec[1]. And some class slides[2]. And a list of other recent extensions[3].

[1] https://github.com/riscv/riscv-bitmanip/releases/download/1.... from https://github.com/riscv/riscv-bitmanip/releases . [2] https://courses.cs.washington.edu/courses/cse481a/20sp/notes... [3] https://wiki.riscv.org/display/HOME/Recently+Ratified+Extens...

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#13
https://bellard.org/tinyemu/readme.txt :

> 4.1) 128 bit support

> The RISC-V specification does not define all the instruction encodings for the 128 bit integer and floating point operations. The missing ones were interpolated from the 32 and 64 ones.

> Unfortunately there is no RISC-V 128 bit toolchain nor OS now (volunteers for the Linux port ?), so rv128test.bin may be the first 128 bit code for RISC-V !

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#14
post #9

To the risc-v folks: I am looking for a mini-board with a 64bits RISC-V core, USB-C (power+data), many(~30) available GPIOs, easy to flash or boot from a memory card. That for a keyboard firmware directly written in 64bits risc-v assembly. The BL808 is actually a 32bits risc-v as a main core with a 64bits risc-v core on the side (convoluted hardware programming from the 64bits risc-v core). The K210 does not seem to…

The soon to be released VisionFive 2 board seems like a good match https://www.starfivetech.com/en/site/boards

Recent discussion: https://news.ycombinator.com/item?id=34339752

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#15
post #9

To the risc-v folks: I am looking for a mini-board with a 64bits RISC-V core, USB-C (power+data), many(~30) available GPIOs, easy to flash or boot from a memory card. That for a keyboard firmware directly written in 64bits risc-v assembly. The BL808 is actually a 32bits risc-v as a main core with a 64bits risc-v core on the side (convoluted hardware programming from the 64bits risc-v core). The K210 does not seem to…

The soon to be released VisionFive 2 board seems like a good match https://www.starfivetech.com/en/site/boards

That's significantly more overkill than the D1.

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#16

I'm still not 100% sure what exactly this is, even after reading the description thrice. Is it basically a RISC-V core in a system with standard x86 PC peripherals, i.e. a very odd but theoretically possible configuration to emulate, in the same way that QEMU (of the same author) lets you attach e.g. a classic VGA controller to an ARM core?

My reading is that it emulates either x86 or RISC-V CPU and can emulate various real x86 peripherals but it also includes the abstract VirtIO services for ... both?

I assume the RISC-V emulation is all VirtIO based and not real...

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#17
See also "selfie": http://selfie.cs.uni-salzburg.at/

> An educational software system of a tiny self-compiling C compiler, a tiny self-executing RISC-V emulator, and a tiny self-hosting RISC-V hypervisor.

> Selfie is a project of the Computational Systems Group at the Department of Computer Sciences of the University of Salzburg in Austria.

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#18
post #8

The B extension never gets any love. The RISC-V crowd hates bitwise anything.

B extension was ratified in 2021, near the end. It is considerably newer than every extension this emulator implements, and thus reasonable it'd have these and not B.

B instructions are also recognized by the GNU bunutils assembler.

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#19
post #9

To the risc-v folks: I am looking for a mini-board with a 64bits RISC-V core, USB-C (power+data), many(~30) available GPIOs, easy to flash or boot from a memory card. That for a keyboard firmware directly written in 64bits risc-v assembly. The BL808 is actually a 32bits risc-v as a main core with a 64bits risc-v core on the side (convoluted hardware programming from the 64bits risc-v core). The K210 does not seem to…

The soon to be released VisionFive 2 board seems like a good match https://www.starfivetech.com/en/site/boards

Super-early bird are out! If shipping is good.

I haven't been able to boot mine. But I have no UART adapter to see whats wrong.

Re: TinyEMU – x86 and RISC-V emulator, small and simple while being complete

#20
post #8

The B extension never gets any love. The RISC-V crowd hates bitwise anything.

B extension was ratified in 2021, near the end. It is considerably newer than every extension this emulator implements, and thus reasonable it'd have these and not B.

Hopefully B becomes ubiquitous in the next generation of SoC's, or RISC-V is going to look bad in any benchmarks that happen to have a popcnt in the hot path.
Post reply on HN