changeset 1938:1dae90605199

Fix autogenerated temp variables in interrupt subroutine in CPU DSL
author Michael Pavone <pavone@retrodev.com>
date Thu, 23 Apr 2020 20:57:14 -0700
parents f23e70fb6607
children 84b32010ef8d
files cpu_dsl.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cpu_dsl.py	Sat Apr 18 23:14:43 2020 -0700
+++ b/cpu_dsl.py	Thu Apr 23 20:57:14 2020 -0700
@@ -1597,7 +1597,11 @@
 				pieces.append('\n\t\tif (context->cycles >= context->sync_cycle) {')
 				self.meta = {}
 				self.temp = {}
-				self.subroutines[self.interrupt].inline(self, [], pieces, otype, None)
+				intpieces = []
+				self.subroutines[self.interrupt].inline(self, [], intpieces, otype, None)
+				for size in self.temp:
+					pieces.append('\n\tuint{sz}_t gen_tmp{sz}__;'.format(sz=size))
+				pieces += intpieces
 				pieces.append('\n\t\t}')
 			self.meta = {}
 			self.temp = {}