Skip to content

Commit

Permalink
added a couple of attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesouza committed Oct 23, 2023
1 parent e0a2ea9 commit 4186edb
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
20 changes: 20 additions & 0 deletions osaca/parser/immediate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ def __init__(
TYPE_ID=None,
VALUE_ID=None,
SHIFT_ID=None,
SOURCE=False,
DESTINATION=False
):
super().__init__(str(VALUE_ID))
self._IDENTIFIER_ID = IDENTIFIER_ID
self._TYPE_ID = TYPE_ID
self._VALUE_ID = VALUE_ID
self._SHIFT_ID = SHIFT_ID
self._SOURCE = SOURCE
self._DESTINATION = DESTINATION

@property
def identifier(self):
Expand All @@ -33,6 +37,22 @@ def value(self):
def shift(self):
return self._TYPE_ID

@property
def source(self):
return self._SOURCE

@source.setter
def source(self, source):
self._SOURCE = source

@property
def destination(self):
return self._DESTINATION

@destination.setter
def destination(self, destination):
self._DESTINATION = destination

@identifier.setter
def identifier(self, identifier):
self._IDENTIFIER_ID = identifier
Expand Down
42 changes: 37 additions & 5 deletions osaca/parser/instruction_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,38 @@ def __init__(
self,
INSTRUCTION_ID=None,
OPERANDS_ID=[],
HIDDEN_OPERANDS=[],
DIRECTIVE_ID=None,
COMMENT_ID=None,
LABEL_ID=None,
LINE=None,
LINE_NUMBER=None,
SEMANTIC_OPERANDS=None,
SEMANTIC_OPERANDS={"source": [], "destination": [], "src_dst": []},
THROUGHPUT = None,
LATENCY = None,
UOPS = None,
PORT_PRESSURE = None,
BREAKS_DEP = False
):
self._INSTRUCTION_ID = INSTRUCTION_ID
self._OPERANDS_ID = OPERANDS_ID
self._HIDDEN_OPERANDS = HIDDEN_OPERANDS
self._DIRECTIVE_ID = DIRECTIVE_ID
self._COMMENT_ID = COMMENT_ID
self._LABEL_ID = LABEL_ID
self._LINE = LINE
self._LINE_NUMBER = LINE_NUMBER

self._SEMANTIC_OPERANDS = SEMANTIC_OPERANDS
self._UOPS = None
self._UOPS = UOPS
self._BREAKS_DEP = BREAKS_DEP
# self.semantic_operands = {"source": [], "destination": [], "src_dst": []}
self._LATENCY = None
self._THROUGHPUT = None
self._LATENCY = LATENCY
self._THROUGHPUT = THROUGHPUT
self._LATENCY_CP = []
self._LATENCY_LCD = []
self._LATENCY_WO_LOAD = None
self._PORT_PRESSURE = []
self._PORT_PRESSURE = PORT_PRESSURE
self._PORT_UOPS = []
self._FLAGS = []

Expand Down Expand Up @@ -67,6 +75,10 @@ def line(self):
def operands(self):
return self._OPERANDS_ID

@property
def hidden_operands(self):
return self._HIDDEN_OPERANDS

@property
def port_pressure(self):
return self._PORT_PRESSURE
Expand All @@ -79,6 +91,10 @@ def port_uops(self):
def flags(self):
return self._FLAGS

@property
def uops(self):
return self._UOPS

@property
def throughput(self):
return self._THROUGHPUT
Expand All @@ -91,6 +107,10 @@ def latency(self):
def latency_wo_load(self):
return self._LATENCY_WO_LOAD

@property
def breaks_dep(self):
return self._BREAKS_DEP

@semantic_operands.setter
def semantic_operands(self, semantic_operands):
self._SEMANTIC_OPERANDS = semantic_operands
Expand All @@ -111,6 +131,14 @@ def line(self, line):
def operands(self, operands):
self._OPERANDS_ID = operands

@hidden_operands.setter
def hidden_operands(self, hidden_operands):
self._HIDDEN_OPERANDS = hidden_operands

@breaks_dep.setter
def breaks_dep(self, boolean):
self._BREAKS_DEP = boolean

@instruction.setter
def instruction(self, instruction):
self._INSTRUCTION_ID = instruction
Expand All @@ -135,6 +163,10 @@ def port_uops(self, port_uops):
def flags(self, flags):
self._FLAGS = flags

@uops.setter
def uops(self, uops):
self._UOPS = uops

@throughput.setter
def throughput(self, throughput):
self._THROUGHPUT = throughput
Expand Down

0 comments on commit 4186edb

Please sign in to comment.