changes time handling at sockets

This commit is contained in:
2023-05-06 19:57:29 +02:00
parent d330307ed5
commit cfa7b72363
3 changed files with 20 additions and 11 deletions

View File

@@ -157,13 +157,16 @@ public:
~core_complex();
inline void sync(uint64_t cycle) {
auto time = curr_clk * (cycle - last_sync_cycle);
quantum_keeper.inc(time);
auto core_inc = curr_clk * (cycle - last_sync_cycle);
auto incr = std::max(core_inc, std::max(ibus_inc, dbus_inc));
quantum_keeper.inc(incr);
if (quantum_keeper.need_sync()) {
wait(quantum_keeper.get_local_time());
quantum_keeper.reset();
}
last_sync_cycle = cycle;
ibus_inc = SC_ZERO_TIME;
dbus_inc = SC_ZERO_TIME;
}
bool read_mem(uint64_t addr, unsigned length, uint8_t *const data, bool is_fetch);
@@ -195,6 +198,7 @@ protected:
std::vector<uint8_t> write_buf;
core_wrapper* cpu{nullptr};
sc_core::sc_signal<sc_core::sc_time> curr_clk;
sc_core::sc_time ibus_inc, dbus_inc;
core_trace* trc{nullptr};
std::unique_ptr<scc::tick2time> t2t;
private:
@@ -202,7 +206,7 @@ private:
std::vector<iss::vm_plugin *> plugin_list;
};
} /* namespace SiFive */
} /* namespace tgfs */
} /* namespace sysc */
#endif /* _SYSC_CORE_COMPLEX_H_ */