include SVSTATE in namespace, passing to ISACaller
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 13 Mar 2021 11:33:53 +0000 (11:33 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 13 Mar 2021 11:33:53 +0000 (11:33 +0000)
src/soc/decoder/isa/caller.py
src/soc/litex/florent

index 22fe7526deee75a30549c9d219e98283f1f33a07..d103183a5621a58afdeaaa0796491841529e4353 100644 (file)
@@ -441,6 +441,7 @@ class ISACaller:
                                'memassign': self.memassign,
                                'NIA': self.pc.NIA,
                                'CIA': self.pc.CIA,
+                               'SVSTATE': self.svstate,
                                'CR': self.cr,
                                'MSR': self.msr,
                                'undefined': undefined,
@@ -673,6 +674,7 @@ class ISACaller:
                               pfx.insn[9].value == 0b1)
         self.pc.update_nia(self.is_svp64_mode)
         self.namespace['NIA'] = self.pc.NIA
+        self.namespace['SVSTATE'] = self.svstate
         if not self.is_svp64_mode:
             return
 
@@ -1000,6 +1002,7 @@ class ISACaller:
                 self.svstate.srcstep += SelectableInt(1, 7)
                 self.pc.NIA.value = self.pc.CIA.value
                 self.namespace['NIA'] = self.pc.NIA
+                self.namespace['SVSTATE'] = self.svstate
                 print("end of sub-pc call", self.namespace['CIA'],
                                      self.namespace['NIA'])
                 return # DO NOT allow PC to update whilst Sub-PC loop running
@@ -1008,10 +1011,14 @@ class ISACaller:
             print ("    svstate.srcstep loop end (PC to update)")
             self.pc.update_nia(self.is_svp64_mode)
             self.namespace['NIA'] = self.pc.NIA
+            self.namespace['SVSTATE'] = self.svstate
 
         # UPDATE program counter
         self.pc.update(self.namespace, self.is_svp64_mode)
-        print("end of call", self.namespace['CIA'], self.namespace['NIA'])
+        self.svstate = self.namespace['SVSTATE']
+        print("end of call", self.namespace['CIA'],
+                             self.namespace['NIA'],
+                             self.namespace['SVSTATE'])
 
 
 def inject():
index c2808c908523d44211057913b68c3e24b8bf74bf..9485f4c64e46754082d921f2c8b251f1dab20338 160000 (submodule)
@@ -1 +1 @@
-Subproject commit c2808c908523d44211057913b68c3e24b8bf74bf
+Subproject commit 9485f4c64e46754082d921f2c8b251f1dab20338