Mercurial > repos > blastem
diff cpu_dsl.py @ 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 | 9ab5184811ea |
children | 7d4df6b74263 |
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 = {}