caller.py: Fix ISACaller modifying test state
authorklehman <klehman9@comcast.net>
Thu, 4 Nov 2021 13:45:34 +0000 (09:45 -0400)
committerklehman <klehman9@comcast.net>
Thu, 4 Nov 2021 13:45:34 +0000 (09:45 -0400)
src/openpower/decoder/isa/caller.py

index 36e3c732d55c7c705b40d4456a299af3807eb789..275136e9c3642c4fe2d6405d3f8e69c247110ade 100644 (file)
@@ -15,7 +15,7 @@ related bugs:
 
 from nmigen.back.pysim import Settle
 from functools import wraps
-from copy import copy
+from copy import copy, deepcopy
 from openpower.decoder.orderedset import OrderedSet
 from openpower.decoder.selectable_int import (FieldSelectableInt, SelectableInt,
                                         selectconcat)
@@ -621,7 +621,7 @@ class ISACaller(ISACallerHelper, ISAFPHelpers):
         self.msr = SelectableInt(initial_msr, 64)  # underlying reg
         self.pc = PC()
         # GPR FPR SPR registers
-        initial_sprs = copy(initial_sprs) # so as not to get modified
+        initial_sprs = deepcopy(initial_sprs) # so as not to get modified
         self.gpr = GPR(decoder2, self, self.svstate, regfile)
         self.fpr = GPR(decoder2, self, self.svstate, fpregfile)
         self.spr = SPR(decoder2, initial_sprs) # initialise SPRs before MMU