From a5468f968b46707e08eacf79847f1e12a4213ff7 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 16 Oct 2022 16:02:52 -0600 Subject: Add C simulation testbench --- tb/sim/fibonacci.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tb/sim/fibonacci.py (limited to 'tb/sim/fibonacci.py') diff --git a/tb/sim/fibonacci.py b/tb/sim/fibonacci.py new file mode 100644 index 0000000..48a17d8 --- /dev/null +++ b/tb/sim/fibonacci.py @@ -0,0 +1,15 @@ +BASE = 0x0001_0000 +COUNT = 20 + +mem_dumps = [range(BASE, BASE + 4 * COUNT)] + +def final(): + words = [] + a, b = 1, 1 + + for _ in range(COUNT): + words.append(a) + c = a + b + a, b = b, c + + assert_mem(BASE, words) -- cgit v1.2.3