res = {}
count = 0
hdr = hdr.strip()
- print (hdr.split('|'))
for f in hdr.split("|"):
if not f:
continue
line = line.strip()
res = {}
count = 0
- print ("line", line)
prev_fieldname = None
for f in line.split("|"):
if not f:
def decode_form(form):
header = decode_form_header(form[0])
res = []
- print ("header", header)
for line in form[1:]:
dec = decode_line(header, line)
if dec:
forms = {}
reading_data = False
for l in txt:
- print ("line", l)
l = l.strip()
if len(l) == 0:
continue
#if heading.startswith('1.6.28'): # skip instr fields for now
#break
heading = heading.split(' ')[-1]
- print ("heading", heading)
reading_data = True
forms[heading] = []
inst = {}
for hdr, form in forms.items():
- print ("heading", hdr)
if heading == 'Fields':
i = decode_instructions(form)
for form, field in i.items():
dec = DecodeFields()
dec.create_specs()
forms, instrs = dec.forms, dec.instrs
- for hdr, form in forms.items():
- print ()
- print (hdr)
- for k, v in form.items():
- #print ("line", l)
- #for k, v in l.items():
- print ("%s: %d-%d" % (k, v[0], v[1]))
- for form, field in instrs.items():
- print ()
- print (form)
- for f, vals in field.items():
- print (" ", f, vals)
- print (dec.FormX)
- print (dec.FormX.A)
- print (dir(dec.FormX))
- print (dec.FormX._fields)
def __getitem__(self, subs):
# *sigh* field numberings are bit-inverted. PowerISA 3.0B section 1.3.2
- print ("SignalBitRange", subs, len(self), self.items())
if isinstance(subs, slice):
res = []
- print (subs)
start, stop, step = subs.start, subs.stop, subs.step
if step is None:
step = 1
start = len(self) + start + 1
if stop < 0:
stop = len(self) + stop + 1
- print ("range", start, stop, step)
for t in range(start, stop, step):
t = len(self) - 1 - t # invert field back
k = OrderedDict.__getitem__(self, t)
- print ("t", t, k)
res.append(self.signal[self._rev(k)]) # reverse-order here
return Cat(*res)
else:
k = OrderedDict.__getitem__(self, subs)
return self.signal[self._rev(k)] # reverse-order here
- print ("translated", subs, translated)
class SigDecode(Elaboratable):