summaryrefslogtreecommitdiff
path: root/pyscv/main.py
blob: 8cdc08fdf04e43156aebbee3b37475b52ef4733f (plain)
1
2
3
4
5
6
7
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()