add skip of instruction if SVSTATE.VL=0 in ISACaller
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Feb 2021 15:07:09 +0000 (15:07 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Feb 2021 15:07:09 +0000 (15:07 +0000)
src/soc/decoder/isa/caller.py

index 4a38a1ede376a61c3402c20b46715dabfe4b92ce..03bf16d2ed98d6746fb6bdbfca2a312db8c9e424 100644 (file)
@@ -869,6 +869,14 @@ class ISACaller:
 
         # get SVSTATE srcstep.  TODO: dststep (twin predication)
         srcstep = self.svstate.srcstep.asint(msb0=True)
 
         # get SVSTATE srcstep.  TODO: dststep (twin predication)
         srcstep = self.svstate.srcstep.asint(msb0=True)
+        vl = self.svstate.vl.asint(msb0=True)
+        mvl = self.svstate.maxvl.asint(msb0=True)
+
+        # VL=0 in SVP64 mode means "do nothing: skip instruction"
+        if self.is_svp64_mode and vl == 0:
+            self.pc.update(self.namespace, self.is_svp64_mode)
+            print("end of call", self.namespace['CIA'], self.namespace['NIA'])
+            return
 
         # main input registers (RT, RA ...)
         inputs = []
 
         # main input registers (RT, RA ...)
         inputs = []