return unsigned int from binary reading
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 12 Jul 2020 12:33:19 +0000 (13:33 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 12 Jul 2020 12:33:19 +0000 (13:33 +0100)
src/soc/simulator/program.py

index ee5ed7d72190f088aae143cd8021a2455e5a6c87..16a172bb3bb9a8ea338c418f8d31189b3fdb5ab2 100644 (file)
@@ -82,7 +82,7 @@ class Program:
             data = self.binfile.read(4)
             if not data:
                 break
-            yield struct.unpack('<i', data)[0]
+            yield struct.unpack('<I', data)[0] # unsigned int
 
     def generate_instructions(self):
         yield from self._instructions