From 008b2fa47db4d04941a2bd6d512a204d76cbfea8 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 22 Jan 2023 12:33:01 -0800 Subject: Add deadman timer (only ten cycles!) based on time between interruptable points. --- uarch/core.cpp | 3 +++ uarch/core.h | 2 ++ 2 files changed, 5 insertions(+) (limited to 'uarch') diff --git a/uarch/core.cpp b/uarch/core.cpp index 503e286..ce58df2 100644 --- a/uarch/core.cpp +++ b/uarch/core.cpp @@ -364,6 +364,9 @@ bail_out: if (interrupt || oldctlregs != ctlregs) if (!restarttr.has_value()) restarttr = infra::pt::toplevel(); + cycles_since_progress = 0; + } else { + assert(++cycles_since_progress < 10); } if (restarttr.has_value()) { diff --git a/uarch/core.h b/uarch/core.h index b8473e6..ebfd388 100644 --- a/uarch/core.h +++ b/uarch/core.h @@ -78,6 +78,8 @@ struct indir_stage : public infra::sim { struct exec_stage : public infra::sim { core &c; + unsigned int cycles_since_progress = 0; + unsigned int gen = 0; unsigned int stores_sent = 0; -- cgit v1.2.3