Compare commits

...

2 Commits

Author SHA1 Message Date
Stef
143503aa0c Merge 9766756c45 into a2b40b9d2c 2024-03-25 19:26:31 +00:00
stefandesouza
9766756c45 Linting 2024-03-25 20:23:07 +01:00
8 changed files with 7 additions and 14 deletions

View File

@@ -10,9 +10,7 @@ from collections import OrderedDict
import ruamel.yaml
from osaca.semantics import MachineModel
from osaca.parser.memory import MemoryOperand
from osaca.parser.register import RegisterOperand
from osaca.parser.immediate import ImmediateOperand
from osaca.parser.instruction_form import InstructionForm

View File

@@ -36,7 +36,7 @@ class ImmediateOperand(Operand):
return self._imd_type
@imd_type.setter
def imd_type(self, type):
def imd_type(self, imd_type):
self._imd_type = imd_type
@identifier.setter

View File

@@ -12,7 +12,6 @@ from osaca.parser.register import RegisterOperand
from osaca.parser.identifier import IdentifierOperand
from osaca.parser.immediate import ImmediateOperand
from osaca.parser.condition import ConditionOperand
from osaca.parser.flag import FlagOperand
from osaca.parser.prefetch import PrefetchOperand

View File

@@ -7,14 +7,12 @@ import pyparsing as pp
from osaca.parser import BaseParser
from osaca.parser.instruction_form import InstructionForm
from osaca.parser.operand import Operand
from osaca.parser.directive import DirectiveOperand
from osaca.parser.memory import MemoryOperand
from osaca.parser.label import LabelOperand
from osaca.parser.register import RegisterOperand
from osaca.parser.identifier import IdentifierOperand
from osaca.parser.immediate import ImmediateOperand
from osaca.parser.flag import FlagOperand
class ParserX86ATT(BaseParser):

View File

@@ -11,7 +11,6 @@ from pathlib import Path
import ruamel.yaml
from osaca import __version__, utils
from copy import deepcopy
from osaca.parser import ParserX86ATT
from osaca.parser.instruction_form import InstructionForm
from osaca.parser.operand import Operand
@@ -261,10 +260,10 @@ class MachineModel(object):
elif o["class"] == "prfop":
new_operands.append(
PrefetchOperand(
type_id=o["type"] if "type" in o else None,
target=o["target"] if "target" in o else None,
policy=o["policy"] if "policy" in o else None,
)
type_id=o["type"] if "type" in o else None,
target=o["target"] if "target" in o else None,
policy=o["policy"] if "policy" in o else None,
)
)
else:
new_operands.append(o)

View File

@@ -12,7 +12,6 @@ from osaca.semantics import INSTR_FLAGS, ArchSemantics, MachineModel
from osaca.parser.memory import MemoryOperand
from osaca.parser.register import RegisterOperand
from osaca.parser.immediate import ImmediateOperand
from osaca.parser.operand import Operand
from osaca.parser.flag import FlagOperand

View File

@@ -7,7 +7,7 @@ import unittest
from io import StringIO
import osaca.db_interface as dbi
from osaca.db_interface import sanity_check, _get_full_instruction_name
from osaca.db_interface import sanity_check
from osaca.semantics import MachineModel
from osaca.parser import InstructionForm
from osaca.parser.memory import MemoryOperand

View File

@@ -234,7 +234,7 @@ class TestParserAArch64(unittest.TestCase):
instruction_form_5 = InstructionForm(
mnemonic="prfm",
operands=[
PrefetchOperand(type_id=["PLD"],target=["L1"],policy=["KEEP"]),
PrefetchOperand(type_id=["PLD"], target=["L1"], policy=["KEEP"]),
MemoryOperand(
offset=ImmediateOperand(value=2048),
base=RegisterOperand(prefix="x", name="26"),