From 97525bf8ab744486efb94c13e49e11e348217225 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Mon, 19 Apr 2021 11:16:05 +0200 Subject: [PATCH] fixed cpu __repr__ method --- docs/internal-structure.md | 0 riscemu/CPU.py | 2 +- riscemu/instructions/InstructionSet.py | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 docs/internal-structure.md diff --git a/docs/internal-structure.md b/docs/internal-structure.md new file mode 100644 index 0000000..e69de29 diff --git a/riscemu/CPU.py b/riscemu/CPU.py index 429341c..ec95ce6 100644 --- a/riscemu/CPU.py +++ b/riscemu/CPU.py @@ -100,5 +100,5 @@ class CPU: return "CPU(pc=0x{:08X}, cycle={}, instructions={})".format( self.pc, self.cycle, - " ".join(s.name for s in self.sets) + " ".join(s.name for s in self.instruction_sets) ) \ No newline at end of file diff --git a/riscemu/instructions/InstructionSet.py b/riscemu/instructions/InstructionSet.py index 93d6c8d..7f7b712 100644 --- a/riscemu/instructions/InstructionSet.py +++ b/riscemu/instructions/InstructionSet.py @@ -10,6 +10,7 @@ class InstructionSet(ABC): """ def __init__(self, cpu: 'CPU'): + self.name = self.__class__.__name__ self.cpu = cpu self.mmu = cpu.mmu self.regs = cpu.regs