aboutsummaryrefslogtreecommitdiff
path: root/bench.j2.c
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-11-19 04:42:58 +0100
committerPaul Oliver <contact@pauloliver.dev>2025-11-19 16:40:08 +0100
commit0075d1b10c475d303a314a3425ee472252855f32 (patch)
tree2537411ad2b9691f413eeab62d7f541724ea47c6 /bench.j2.c
parentd91b8a6196af711f9dface0c2a0d37794c12ac02 (diff)
Python/SQLite refactor
- Uses Python/Jinja2 to preprocess C files - Uses SQLite3 for data compression
Diffstat (limited to 'bench.j2.c')
-rw-r--r--bench.j2.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/bench.j2.c b/bench.j2.c
new file mode 100644
index 0000000..a776892
--- /dev/null
+++ b/bench.j2.c
@@ -0,0 +1,42 @@
+// Author: Paul Oliver <contact@pauloliver.dev>
+// Project: Salis
+
+// Simple benchmark test helps measure simulation speed.
+// Steps the simulation N times and prints part of the simulator's state.
+
+int main() {
+ printf("Salis Benchmark Test\n\n");
+
+ salis_init();
+ salis_step({{ args.steps }});
+
+ printf("seed => %#lx\n", {{ args.seed }});
+ printf("g_steps => %#lx\n", g_steps);
+ printf("g_syncs => %#lx\n", g_syncs);
+
+ for (int i = 0; i < {{ args.cores }}; ++i) {
+ putchar('\n');
+ printf("core %d mall => %#lx\n", i, g_cores[i].mall);
+ printf("core %d mut0 => %#lx\n", i, g_cores[i].muta[0]);
+ printf("core %d mut1 => %#lx\n", i, g_cores[i].muta[1]);
+ printf("core %d mut2 => %#lx\n", i, g_cores[i].muta[2]);
+ printf("core %d mut3 => %#lx\n", i, g_cores[i].muta[3]);
+ printf("core %d pnum => %#lx\n", i, g_cores[i].pnum);
+ printf("core %d pcap => %#lx\n", i, g_cores[i].pcap);
+ printf("core %d pfst => %#lx\n", i, g_cores[i].pfst);
+ printf("core %d plst => %#lx\n", i, g_cores[i].plst);
+ printf("core %d pcur => %#lx\n", i, g_cores[i].pcur);
+ printf("core %d psli => %#lx\n", i, g_cores[i].psli);
+ printf("core %d cycl => %#lx\n", i, g_cores[i].cycl);
+ printf("core %d ivpt => %#lx\n", i, g_cores[i].ivpt);
+ putchar('\n');
+
+ for (int j = 0; j < 32; ++j) {
+ printf("%02x ", g_cores[i].mvec[j]);
+ }
+
+ putchar('\n');
+ }
+
+ salis_free();
+}