OpenXiangShan / difftest

Modern co-simulation framework for RISC-V CPUs
Mulan Permissive Software License, Version 2
111 stars 63 forks source link

Question About Increased Simulation Time with --dump-commit-trace #470

Open figuresudo opened 4 days ago

figuresudo commented 4 days ago

When I enable the --dump-commit-trace option, the instruction sequence is successfully output, but I’ve noticed that the simulation time increases by 3 to 4 times. Could you kindly explain what might be causing this increase in simulation time?

poemonsense commented 4 days ago

This is a known performance issue because every line of commit trace requires calling the spike-dasm command.

See https://github.com/OpenXiangShan/difftest/blob/master/src/test/csrc/plugin/spikedasm/spikedasm.cpp#L42-L50

Since we are calling it through the command line instead of function calls, its performance is currently quite slow.

If you have any advice on this, we can discuss how to fix it.