diff 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
line wrap: on
line diff
--- a/cpu_dsl.py	Mon Oct 01 19:16:54 2018 -0700
+++ b/cpu_dsl.py	Thu Oct 04 19:12:56 2018 -0700
@@ -893,6 +893,7 @@
 		self.extra_tables = info.get('extra_tables', [])
 		self.context_type = self.prefix + 'context'
 		self.body = info.get('body', [None])[0]
+		self.includes = info.get('include', [])
 		self.flags = flags
 		self.lastDst = None
 		self.scopes = []
@@ -930,6 +931,8 @@
 	def build(self, otype):
 		body = []
 		pieces = []
+		for include in self.includes:
+			body.append('#include "{0}"\n'.format(include))
 		for table in self.instructions:
 			opmap = [None] * (1 << self.opsize)
 			bodymap = {}