Skip to content
Snippets Groups Projects
Commit 0fc247d2 authored by Martin Högstedt's avatar Martin Högstedt
Browse files

saving clock cycles for each new asm instruction

parent e4ead8b9
Branches
Tags
1 merge request!13We know have asm instructions, can step forward and backward between clock cycle and asm instructions
Pipeline #131508 passed
...@@ -280,17 +280,22 @@ class MIA_CPU(Processor): ...@@ -280,17 +280,22 @@ class MIA_CPU(Processor):
self.micro_memory = uM self.micro_memory = uM
# List containing all clock cycles where a new asm instruction started
self.assembly_cycles = []
self.lambdas = {} self.lambdas = {}
def do_tick(self) -> None: def do_tick(self) -> None:
"""After each tick Mia checks for a new instruction. """Mia has special assembly related behaviour.
This is done by checking if the value of the micro PC is equal to zero.""" This includes fetching the curret asm instruction, and saving the current clock
cycle in a list to enable stepping back over assembly instructions.
"""
super().do_tick() super().do_tick()
if self.get_module("uPC").value == 0: if self.get_module("uPC").value == 0:
self.new_instruction = True self.new_instruction = True
self.current_instruction = self.get_current_instrution() self.current_instruction = self.get_current_instrution()
print(self.current_instruction) self.assembly_cycles.append(self.get_clock())
else: else:
self.new_instruction = False self.new_instruction = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment