From e1c19ba01f5e8c62873a57755d9dcb51ce631394 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Thu, 23 Apr 2020 20:57:14 -0700 Subject: Fix autogenerated temp variables in interrupt subroutine in CPU DSL --- cpu_dsl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpu_dsl.py b/cpu_dsl.py index d36b757..f58749c 100755 --- a/cpu_dsl.py +++ b/cpu_dsl.py @@ -1597,7 +1597,11 @@ class Program: 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 = {} -- cgit v1.2.3