Add a RISC-V target.

Flesh out the directory structure for defining target instruction set
architectures. Use RISC-V as a startgin point because it is so simple.
This commit is contained in:
Jakob Stoklund Olesen
2016-04-06 11:32:43 -07:00
parent 5388f68437
commit 6e2e7bfb73
6 changed files with 83 additions and 3 deletions

View File

@@ -267,3 +267,21 @@ class Instruction(object):
for op in x:
assert isinstance(op, Operand)
return x
#
# Defining targets
#
class Target(object):
"""
A target instruction set architecture.
The `Target` class collects everything known about a target ISA.
:param name: Short mnemonic name for the ISA.
:param instruction_groups: List of `InstructionGroup` instances that are
relevant for this ISA.
"""
def __init__(self, name, instrution_groups):
self.name = name
self.instruction_groups = instrution_groups