bad hack to get HSRR0/1 to be "same" as SRR0/1
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 14 Aug 2020 19:44:59 +0000 (20:44 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 14 Aug 2020 19:44:59 +0000 (20:44 +0100)
src/soc/decoder/isa/caller.py

index c8b5f4de151cfa8f6c9f64668a583fb9bae1b6db..59728a0befd8c8e84d10b87500fcb26535e80b04 100644 (file)
@@ -216,6 +216,10 @@ class SPR(dict):
         if isinstance(key, int):
             key = spr_dict[key].SPR
         key = special_sprs.get(key, key)
+        if key == 'HSRR0': # HACK!
+            key = 'SRR0'
+        if key == 'HSRR1': # HACK!
+            key = 'SRR1'
         if key in self:
             res = dict.__getitem__(self, key)
         else:
@@ -235,6 +239,10 @@ class SPR(dict):
             key = spr_dict[key].SPR
             print("spr key", key)
         key = special_sprs.get(key, key)
+        if key == 'HSRR0': # HACK!
+            self.__setitem__('SRR0', value)
+        if key == 'HSRR1': # HACK!
+            self.__setitem__('SRR1', value)
         print("setting spr", key, value)
         dict.__setitem__(self, key, value)