summaryrefslogtreecommitdiff
path: root/pyscv/main.py
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2021-07-23 20:49:14 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2021-07-23 20:49:14 +0200
commit681036ddc3891904f13c84197cd90e2472cb3e1c (patch)
tree080b9580c14274698d1848e7640cba0cc47a53a6 /pyscv/main.py
parent309d36182ef32a1bc5bff84f39e9e81db0ddb9a6 (diff)
Change folder nameHEADmaster
Diffstat (limited to 'pyscv/main.py')
-rw-r--r--pyscv/main.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pyscv/main.py b/pyscv/main.py
new file mode 100644
index 0000000..8cdc08f
--- /dev/null
+++ b/pyscv/main.py
@@ -0,0 +1,8 @@
+# Use a generator for the execution flow
+# -> PC has to be a global variable, updated by each instruction to the next val
+# So user can set the PC by hand and call next(run) and make the code jump!
+
+pc = 0
+while True:
+ inst = fetch_instruction(pc)
+ pc = inst.execute()