litex-hub / linux-on-litex-vexriscv

Linux on LiteX-VexRiscv
BSD 2-Clause "Simplified" License
574 stars 174 forks source link

Settings to speed up simulation #220

Closed troibe closed 3 years ago

troibe commented 3 years ago

Are there any flags/settings that can be utilized to speed up the simulation? The simulation does work for me but it takes about 30m to get to the intial buildroot login.

enjoy-digital commented 3 years ago

Hi @developandplay,

Linux generally boots in 15 minute on the machine using for the tests (an I7 from 2014). Which machine are you testing with? Verilator is already configured to compile the code in O3 and is a SoC with medium complexity (with the DRAM core also simulated), so it's not really possible to speed the simulation.

troibe commented 3 years ago

Thank you! I'm using a pretty powerful ryzen 7 mobile cpu. However I guess that doesn't help if it's all about high single core clock speed. Boot times are maybe 30m and then entering a character on the console takes 30s. I was just surprised by the performance difference compared to a simple temu riscv simulation.

enjoy-digital commented 3 years ago

The simulation will indeed be a lot slower than software emulation (since here the whole logic of the SoC is simulated). It should still be faster than 30min, but this time is probably related to the configuration of your machine.

troibe commented 3 years ago

When using the normal litex-sim command for other cores the --threads option was exactly what I was looking for. I now created a quick PR for it.