-from collections import OrderedDict, namedtuple
-from openpower.decoder.power_enums import find_wiki_file
+from collections import namedtuple
-
-class BitRange(OrderedDict):
- """BitRange: remaps from straight indices (0,1,2..) to bit numbers
- """
-
- def __getitem__(self, subscript):
- if isinstance(subscript, slice):
- return list(self.values())[subscript]
- else:
- return OrderedDict.__getitem__(self, subscript)
+from openpower.decoder.power_enums import find_wiki_file as _find_wiki_file
+from openpower.decoder.selectable_int import BitRange as _BitRange
def decode_instructions(form):
assert name_on_wiki is None
fname = "fields.txt"
name_on_wiki = "fields.text"
- self.fname = find_wiki_file(name_on_wiki)
+ self.fname = _find_wiki_file(name_on_wiki)
@property
def form_names(self):
from collections import OrderedDict
-from openpower.decoder.power_fields import DecodeFields, BitRange
+from openpower.decoder.power_fields import DecodeFields
from nmigen import Module, Elaboratable, Signal, Cat
from nmigen.cli import rtlil
from copy import deepcopy
+from openpower.decoder.selectable_int import BitRange
+
class SignalBitRange(BitRange):
def __init__(self, signal):
import struct
from copy import copy
import functools
-from openpower.decoder.power_fields import BitRange
+from collections import OrderedDict
from operator import (add, sub, mul, floordiv, truediv, mod, or_, and_, xor,
neg, inv, lshift, rshift, lt, eq)
from openpower.util import log
return SelectableInt(b.value, a.bits)
+class BitRange(OrderedDict):
+ """BitRange: remaps from straight indices (0,1,2..) to bit numbers
+ """
+
+ def __getitem__(self, subscript):
+ if isinstance(subscript, slice):
+ return list(self.values())[subscript]
+ else:
+ return OrderedDict.__getitem__(self, subscript)
+
+
@functools.total_ordering
class FieldSelectableInt:
"""FieldSelectableInt: allows bit-range selection onto another target