comparison cpu_dsl.py @ 2580:939b818df589

Get 68K interrupts working in new CPU core
author Michael Pavone <pavone@retrodev.com>
date Sat, 08 Feb 2025 11:40:42 -0800
parents 9b01541cbd60
children 9e10149c9e10
comparison
equal deleted inserted replaced
2579:bd8d1babbfb5 2580:939b818df589
1965 pieces.append('\n\t{sync}(context, target_cycle);'.format(sync=self.sync_cycle)) 1965 pieces.append('\n\t{sync}(context, target_cycle);'.format(sync=self.sync_cycle))
1966 pieces.append('\n\twhile (context->cycles < target_cycle)') 1966 pieces.append('\n\twhile (context->cycles < target_cycle)')
1967 pieces.append('\n\t{') 1967 pieces.append('\n\t{')
1968 if self.interrupt in self.subroutines: 1968 if self.interrupt in self.subroutines:
1969 pieces.append('\n\t\tif (context->cycles >= context->sync_cycle) {') 1969 pieces.append('\n\t\tif (context->cycles >= context->sync_cycle) {')
1970 pieces.append(f'\n\t\t\t{self.sync_cycle}(context, target_cycle);')
1971 pieces.append('\n\t\t}')
1970 self.meta = {} 1972 self.meta = {}
1971 self.temp = {} 1973 self.temp = {}
1972 intpieces = [] 1974 intpieces = []
1973 self.subroutines[self.interrupt].inline(self, [], intpieces, otype, None) 1975 self.subroutines[self.interrupt].inline(self, [], intpieces, otype, None)
1974 for size in self.temp: 1976 for size in self.temp:
1975 pieces.append('\n\tuint{sz}_t gen_tmp{sz}__;'.format(sz=size)) 1977 pieces.append('\n\tuint{sz}_t gen_tmp{sz}__;'.format(sz=size))
1976 pieces += intpieces 1978 pieces += intpieces
1977 pieces.append('\n\t\t}')
1978 self.meta = {} 1979 self.meta = {}
1979 self.temp = {} 1980 self.temp = {}
1980 self.subroutines[self.body].inline(self, [], pieces, otype, None) 1981 self.subroutines[self.body].inline(self, [], pieces, otype, None)
1981 pieces.append('\n\t}') 1982 pieces.append('\n\t}')
1982 pieces.append('\n}') 1983 pieces.append('\n}')