From eceedc547f605302b1a0ef55feb3adacda221218 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 21 Sep 2019 10:48:10 -0700 Subject: Implement interrupts in call dispatch mode in CPU DSL --- cpu_dsl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cpu_dsl.py') diff --git a/cpu_dsl.py b/cpu_dsl.py index d8bd7a8..d36b757 100755 --- a/cpu_dsl.py +++ b/cpu_dsl.py @@ -1593,7 +1593,12 @@ class Program: pieces.append('\n\t{sync}(context, target_cycle);'.format(sync=self.sync_cycle)) pieces.append('\n\twhile (context->cycles < target_cycle)') pieces.append('\n\t{') - #TODO: Handle interrupts in call dispatch mode + if self.interrupt in self.subroutines: + pieces.append('\n\t\tif (context->cycles >= context->sync_cycle) {') + self.meta = {} + self.temp = {} + self.subroutines[self.interrupt].inline(self, [], pieces, otype, None) + pieces.append('\n\t\t}') self.meta = {} self.temp = {} self.subroutines[self.body].inline(self, [], pieces, otype, None) -- cgit v1.2.3