Can anyone help me with how to use QEMU for RTL validation?

I am looking for emulation tool which can be used to validate UART RTL IP using embedded software. Can we use QEMU emulation? If yes can anyone provide training or setup guide for QEMU emulation?

I’m not a hardware designer, and can’t help with RTL validation, but I know a little about qemu. I would suggest this as a tutorial
https://readthedocs.org/projects/risc-v-getting-started-guide/downloads/pdf/latest/
It has some info about how to build linux and run it on qemu. Another source of info would be the qemu wiki which has info on getting started
https://wiki.qemu.org/Documentation/Platforms/RISCV
Unfortunately, it points at an out-of-date version of Fedora. The up to date info is here
https://fedoraproject.org/wiki/Architectures/RISC-V/Installing

If you are designing your own UART and want to test software with qemu, then you would have to write code to emulate your UART in qemu, and then a board description that includes your UART. This is no use for actually testing your UART RTL though. This is just for testing software using the UART.

In general, qemu is more useful to software developers than hardware developers. qemu uses a jit compiler to make software run fast, but as a result it can’t provide things like instructions traces that a hardware designer might want. Hardware designers are more likely to find spike more useful than qemu. spike (from the riscv-isa-sim project) is a lot slower than qemu, and has a lot fewer features, but it provides better tracing as it does one instruction at a time. It is also easier to modify than qemu.

But that still doesn’t help you test UART RTL. If it is the hardware you want to test, then you probably want to generate verilog and use a tool like verilator that can simulate the verilog code. I’ve never used verilator so I can’t help you with that.
https://www.veripool.org/wiki/verilator

Hi Jim,

Thanks for the response. I agree with all your inputs. One thing that I can make out from your reply is, I can use simulator to simulate my RTL design on it and then use embedded software to validate it. Now I need to check how I can make use of varilator to have pre-silicon level debugging enviornment during validating using embedded software.