From: Dmitry Selyutin Date: Sat, 10 Jun 2023 17:00:09 +0000 (+0300) Subject: insndb/core: rename Section.path to Section.csv X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b9b5e67b8b04c74c559ec9da2ac1ecc123faa2f;p=openpower-isa.git insndb/core: rename Section.path to Section.csv --- diff --git a/src/openpower/insndb/core.py b/src/openpower/insndb/core.py index d235b70d..2c7abe79 100644 --- a/src/openpower/insndb/core.py +++ b/src/openpower/insndb/core.py @@ -682,7 +682,7 @@ class Section(Dataclass): def __repr__(self): return (bin(self) if self else "None") - path: _pathlib.Path + csv: _pathlib.Path bitsel: BitSel suffix: Suffix mode: Mode @@ -696,11 +696,12 @@ class Section(Dataclass): @classmethod def CSV(cls, record): + keymap = {"path": "csv"} typemap = {field.name:field.type for field in _dataclasses.fields(cls)} if record["opcode"] == "NONE": typemap["opcode"] = lambda _: None - return dataclass(cls, record, typemap=typemap) + return dataclass(cls, record, typemap=typemap, keymap=keymap) class Fields: @@ -3664,7 +3665,7 @@ class PPCDatabase: path = (root / "insndb.csv") with open(path, "r", encoding="UTF-8") as stream: for section in sorted(parse(stream, Section.CSV)): - path = (root / section.path) + path = (root / section.csv) opcode_cls = { section.Mode.INTEGER: IntegerOpcode, section.Mode.PATTERN: PatternOpcode,