forked from tubs-eis/PATARA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstants.py
155 lines (115 loc) · 3.32 KB
/
Constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
from enum import Enum
class OPERAND_TYPE(Enum):
Immediate = "immediate"
Register = "register"
Flag = "flag"
Address = "address"
Address2 = "address2"
Address3 = "address3"
Address4 = "address4"
BRANCH_INDEX = "BRANCH_INDEX"
successAddress = "0xff00"
# Processor XML Constants
DELIMITER = ";"
DELIMITER_REVERSE_INSTRUCTION = "//"
DELIMITER_INSTRUCTION = '/'
# todo: should come from processor.xml and Processor.py
# v64 = 'v64'
# v32 = 'v32'
# v16 = 'v16'
# v8 = 'v8'
vMutable = "all"
TARGET_REGISTER = "TargetReg"
RAND_VALUE = "randValue"
FOCUS_REGISTER = "FocusReg"
class OPERANDS(Enum):
TARGET_REGISTER = "TargetReg"
RAND_VALUE = "randValue"
FOCUS_REGISTER = "FocusReg"
ADDRESS = 'ADDRESS'
ADDRESS2 = 'ADDRESS2'
ADDRESS3 = 'ADDRESS3'
ADDRESS4 = 'ADDRESS4'
BRANCH_INDEX = "BRANCH_INDEX"
RAND_IMMEDIATE = "randImmediate"
INIT = 'init'
POST_INIT = "init-post"
DEFAULT = "default"
IMMEDIATE_ASSEMBLY = "immediate_ASSEMBLY"
REGISTER_FILE = "register-file"
REGISTER = "register"
VALUE_STRUCTURE = "value-structure"
VALUE_MAX = "value-max"
NUM_REG_FILES = "num-reg-files"
REG_FILE_SIZE = "reg-file-size"
BLOCKED_REGISTER = "blocked"
FORMAT = "format"
ISSUE_SLOT = 'issue-slots'
SPACE = "space"
MAX_SIZE = "max_size"
ASSEMBLY_STRUCTURE = "assembly-structure"
IMMEDIATE = 'immediate'
IMMEDIATE_OPERAND = 'immediate-operand'
SIGNAGE = "signage"
SIMD = "simd"
FLAGS = "flags"
INSTRUCTION = "instruction"
CONDITIONAL_DELIMITER = "conditional_delimiter"
CONDITIONAL = "conditional"
CONDITIONAL_VALUES = "conditional-values"
CONDITIONAL_READ = "conditional-read"
SATURATION = "saturation"
MANDATORY_FEATURE = "enable"
PROCESSOR_MEMORY_KEYWORD = "address"
class MEMORY_DESCRIPTION(Enum):
startAddress = "start"
endAddress = "end"
DEFAULT_MAX_MEMORY_ADDRESS = 2 ** 12 -1
class FORMAT_DESCRIPTION(Enum):
default = "default"
bin = "bin"
hex = "hex"
dec = "dec"
BIN = 'bin'
HEX = 'hex'
DEC = 'dec'
IMMEDIATE_LONG = 'IL'
IMMEDIATE_SHORT = "I"
class PROCESSOR_DESCRIPTION_SATURATION(Enum):
overflow = "overflow"
saturation = "saturation"
class PROCESSOR_DESCRIPTION_IMMEDIATE(Enum):
short = "short"
long = "long"
SIGNED = 'signed'
UNSIGNED = 'unsigned'
COND_SET = 'conditional-set'
COND_READ = 'conditional-read'
COND_READ_SET = 'conditional-read-set'
INST_LIST = 'instructions-list'
INSTR = 'instr'
REVERSE = 'reverse'
PROCESSOR = "processor"
SPECIALIZATION = "specialization"
ADDRESS = 'ADDRESS'
ERROR = 'ERROR'
COMPARISON = 'comparison'
# todo: should come from processor.xml and Processor.py
instructionFeatureList = [ISSUE_SLOT, IMMEDIATE, FLAGS]
instructionSpecialFeature = [SIGNAGE, SIMD, CONDITIONAL, CONDITIONAL_READ,SATURATION]
CONDITION_ELEMENTS = ["zero", "carry", "overflow", "negative"]
FOLDER_EXPORT_ASSEMBLY = "reversiAssembly"
PATH_PROCESSOR = 'sources/processor.xml'
PATH_INSTRUCTION = 'sources/instructions.xml'
PATH_INIT_REGISTER = 'sources/init_register.csv'
INSTRUCTION_DEFAULT_MODES = "default"
DELIMITER_FEATURE = '/'
class ASSEMBLY_PRAGMAS(Enum):
define = "#define"
class ASSEMBLY_PARTIAL(Enum):
branchIndex = "BRANCH_INDEX"
TEMPORARY_CONDSEL_ENABLED = ["add", "or"]
CONDITION_PRE_INSTRUCTION = "pre-instruction"
CONDITION_POST_INSTRUCTION = "post-instruction"
CONDITION_PRE_REVERSE = "pre-reverse"
CONDITION_POST_REVERSE = "post-reverse"