diff options
author | Michael Pavone <pavone@retrodev.com> | 2019-09-21 10:48:10 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2019-09-21 10:48:10 -0700 |
commit | eceedc547f605302b1a0ef55feb3adacda221218 (patch) | |
tree | f35425e42bdcc9d8041d7d9838ae008936b032ce | |
parent | a7efa3e5b2ede35ecda29e6601b90768aafe6bc4 (diff) |
Implement interrupts in call dispatch mode in CPU DSL
-rwxr-xr-x | cpu_dsl.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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) |