| 31 | Simulation& operator=(const Simulation&) = delete; |
| 32 | |
| 33 | void run() { |
| 34 | int fe_tick = m_frontend->get_clock_ratio(); |
| 35 | int mem_tick = m_memory_system->get_clock_ratio(); |
| 36 | if (fe_tick <= 0 || mem_tick <= 0) { |
| 37 | throw std::runtime_error("clock_ratio must be > 0 for both frontend and memory system"); |
| 38 | } |
| 39 | |
| 40 | int fe_count = mem_tick - 1, mem_count = fe_tick - 1; |
| 41 | for (;;) { |
| 42 | if (++fe_count >= mem_tick) { |
| 43 | fe_count = 0; |
| 44 | m_frontend->tick(); |
| 45 | } |
| 46 | |
| 47 | if (m_frontend->is_finished()) { |
| 48 | break; |
| 49 | } |
| 50 | |
| 51 | if (++mem_count >= fe_tick) { |
| 52 | mem_count = 0; |
| 53 | m_memory_system->tick(); |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | nb::dict get_stats() { |
| 59 | m_frontend->finalize(); |
nothing calls this directly
no test coverage detected