sim: cpu_sim: More refactoring.