From: Luke Kenneth Casson Leighton Date: Thu, 18 Jun 2020 10:26:10 +0000 (+0100) Subject: get instructions immediately from assembly code X-Git-Tag: div_pipeline~329^2~4 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d73352b1409a3763704ee491d1672dffeb3aa54c;p=soc.git get instructions immediately from assembly code --- diff --git a/src/soc/simulator/program.py b/src/soc/simulator/program.py index cd515a8d..fdcea642 100644 --- a/src/soc/simulator/program.py +++ b/src/soc/simulator/program.py @@ -24,6 +24,7 @@ class Program: instructions = '\n'.join(instructions) self.assembly = instructions + '\n' # plus final newline self._assemble() + self._instructions = list(self._get_instructions()) def __enter__(self): return self @@ -64,13 +65,16 @@ class Program: sys.exit(1) self._link(outfile) - def generate_instructions(self): + def _get_instructions(self): while True: data = self.binfile.read(4) if not data: break yield struct.unpack('