From c8fc429d9e5ed8ab0566729003d60ef41f578807 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Sat, 22 Nov 2025 03:03:11 +0100 Subject: Improves logging system --- core.j2.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core.j2.c') diff --git a/core.j2.c b/core.j2.c index 8aeff5d..64873d8 100644 --- a/core.j2.c +++ b/core.j2.c @@ -62,6 +62,11 @@ char g_asav_pbuf[{{ auto_save_name_len }}]; sqlite3 *g_sim_data; {% endif %} +// Before invoking salis_init(), +// each UI must install its own logger functions +void (*g_info)(const char *fmt, ...); +void (*g_warn)(const char *fmt, ...); + // Forward declarations // Each architecture must define these {% if args.command in ["bench", "new"] and anc_bytes is defined %} @@ -582,12 +587,16 @@ void salis_auto_save() { assert(rem >= 0); assert(rem < {{ auto_save_name_len }}); + g_info("Saving simulation state on step '%#lx'", g_steps); salis_save(g_asav_pbuf); } {% endif %} {% if args.command in ["bench", "new"] %} void salis_init() { + assert(g_info); + assert(g_warn); + uint64_t seed = {{ args.seed }}; for (int i = 0; i < {{ args.cores }}; ++i) { -- cgit v1.2.1