From: Luke Kenneth Casson Leighton Date: Sat, 4 Jul 2020 16:59:52 +0000 (+0100) Subject: resolve spr names in ISACaller X-Git-Tag: div_pipeline~162^2~88 X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=commitdiff_plain;h=f156f22024d462676949f799e475e9b3766ddec1;hp=f166049e23ea94ab589b4327fc1013173cff8972;ds=sidebyside resolve spr names in ISACaller --- diff --git a/src/soc/decoder/isa/caller.py b/src/soc/decoder/isa/caller.py index 12cb6647..a57194be 100644 --- a/src/soc/decoder/isa/caller.py +++ b/src/soc/decoder/isa/caller.py @@ -188,8 +188,6 @@ class SPR(dict): self.sd = dec2 dict.__init__(self) for key, v in initial_sprs.items(): - if isinstance(key, str): - key = spr_byname[key].SPR if isinstance(key, SelectableInt): key = key.value key = special_sprs.get(key, key) @@ -207,6 +205,8 @@ class SPR(dict): # if key in special_sprs get the special spr, otherwise return key if isinstance(key, SelectableInt): key = key.value + if isinstance(key, int): + key = spr_dict[key].SPR key = special_sprs.get(key, key) if key in self: res = dict.__getitem__(self, key) @@ -220,6 +220,9 @@ class SPR(dict): def __setitem__(self, key, value): if isinstance(key, SelectableInt): key = key.value + if isinstance(key, int): + key = spr_dict[key].SPR + print ("spr key", key) key = special_sprs.get(key, key) print ("setting spr", key, value) dict.__setitem__(self, key, value)