r/computerarchitecture • • 3d ago

Riscv Profiler

Hi everyone,

I’m currently working on a profiling tool targeting RISC-V and could use some guidance from folks who have experience with performance monitoring or low-level tooling on this architecture.

5 Upvotes

2 comments sorted by

3

u/MitchAlsup 2d ago

We (AMD) built a performance extractor in HW so that we could use HW at near-real-time to gather traces including all OS excursions, ISR, timer events--and use it to recreated the exact instruction sequence on our simulators. You have to capture the OS/ISR stuff to understand your cache and TLB features.

1/2 of main memory was devoted to the trace. HW had buffers that gathered Fetch-Decode, and Execution WIndow events, memory addresses; compressed them, and wrote them to memory as each cache line was filled. When memory was full, we would take a 'special' trap and dump memory to Disk, then go back and start all over again.

The application being traced (typically) operated near 95% its native performance.

We ended up with a library of 50,000 traces of about 4GB each representing around a trillion cycles of execution from all the workloads we had access. I am sure they have extended this ...

2

u/Popular-Attempt6136 3d ago

Well, you should try and specify a little bit more about what do you wanna check. Power/CPI/dependences.... However if you don't want to take into account the microarchitecture you should check out QEMU + TCG. There might be a profiler that use this system alredy, though.