comparison cpu_dsl.py @ 1620:a172f97d873f

Add the ability for a CPU definition to reference arbitrary C includes and use it to add a placeholder definition of svp_read_16
author Michael Pavone <pavone@retrodev.com>
date Thu, 04 Oct 2018 19:12:56 -0700
parents 0e8438a4c76f
children ca158bc091f9
comparison
equal deleted inserted replaced
1619:0e8438a4c76f 1620:a172f97d873f
891 self.prefix = info.get('prefix', [''])[0] 891 self.prefix = info.get('prefix', [''])[0]
892 self.opsize = int(info.get('opcode_size', ['8'])[0]) 892 self.opsize = int(info.get('opcode_size', ['8'])[0])
893 self.extra_tables = info.get('extra_tables', []) 893 self.extra_tables = info.get('extra_tables', [])
894 self.context_type = self.prefix + 'context' 894 self.context_type = self.prefix + 'context'
895 self.body = info.get('body', [None])[0] 895 self.body = info.get('body', [None])[0]
896 self.includes = info.get('include', [])
896 self.flags = flags 897 self.flags = flags
897 self.lastDst = None 898 self.lastDst = None
898 self.scopes = [] 899 self.scopes = []
899 self.currentScope = None 900 self.currentScope = None
900 self.lastOp = None 901 self.lastOp = None
928 hFile.write('\n') 929 hFile.write('\n')
929 hFile.close() 930 hFile.close()
930 def build(self, otype): 931 def build(self, otype):
931 body = [] 932 body = []
932 pieces = [] 933 pieces = []
934 for include in self.includes:
935 body.append('#include "{0}"\n'.format(include))
933 for table in self.instructions: 936 for table in self.instructions:
934 opmap = [None] * (1 << self.opsize) 937 opmap = [None] * (1 << self.opsize)
935 bodymap = {} 938 bodymap = {}
936 instructions = self.instructions[table] 939 instructions = self.instructions[table]
937 instructions.sort() 940 instructions.sort()