I found in QEMU NIOS IP https://wiki.qemu.org/Documentation/Platforms/Nios2 I have downloaded intel tool chain from their website : https://www.intel.com/content/www/us/en/programmable/products/boards_and_kits/dev-kits/altera/kit-niosii-2s60.html I have few questions:
- Is the NIOS2 in QEMU IP matching intel’s NIOS IP ?
- What is the toolchain you use to compile and run it in QEMU ? Is it same tool-chain as provided by intel’s website ?
- How to general Firmware code and run it on NIOS over QEMU. In the Wiki it says: qemu-system-nios2 -M 10m50-ghrd -kernel -dtb -nographic
- How to generate dtb file for it?
- Do we need to take products created by the quartos/EDS for the running of the QEMU, other from the compiled binary? (DTB - board specification?)
- Do we need to run it with specific QEMU parameters/arguments ?
- Do you have code examples for NIOS using its peripherals?
Basically, I didn’t find any documentations/examples about how to use the NIOS2 in QEMU. Can you help with some additional info ? Even some basic “hello would” (compile and run in QEMU) would be great…
UPDATE: the most up-to-date answer to this question may be to analyse the linux console nios test at https://gitlab.com/qemu-project/qemu/-/blob/master/tests/acceptance/boot_linux_console.py#L1029 (or of course contact a maintainer). The kernel image from advent calendar 2018 day 14 runs great. It looks like it can all be done with buildroot.
My comments started bearing fruit, so I'll try to put a partial answer together. I haven't gotten this to work yet, but maybe this can be helpful to others who might work farther.
NOTE: If you just want to run a single nios2 binary, you can pass it straight to
qemu-nios2.qemu-system-nios2is for running linux.qemu-system-nios2 -M <machine> -kernel <kernel file> -dtb <dtb file> <rootfs image file>. The example machine is10m50-ghrdwhich we built the kernel for above, and this may be the only one.