MCPcopy Create free account
hub / github.com/CMU-SAFARI/ramulator2 / run

Method run

src/ramulator/python/bindings.cpp:33–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 3

get_clock_ratioMethod · 0.45
tickMethod · 0.45
is_finishedMethod · 0.45

Tested by

no test coverage detected