From: Luke Kenneth Casson Leighton Date: Tue, 3 Oct 2023 14:34:35 +0000 (+0100) Subject: optional read of "Description" in pagereader.py X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4541e494b980f6a9e857a0aa90c4a21ebdaa787;p=openpower-isa.git optional read of "Description" in pagereader.py --- diff --git a/src/openpower/decoder/pseudo/pagereader.py b/src/openpower/decoder/pseudo/pagereader.py index d3f51cd5..be70f32e 100644 --- a/src/openpower/decoder/pseudo/pagereader.py +++ b/src/openpower/decoder/pseudo/pagereader.py @@ -86,6 +86,8 @@ def operands(opcode, desc): yield operand def get_indented_lines(lines): + """gets a set of indented lines, plus a blank line as termination + """ li = [] while lines: l = lines.pop(0).rstrip() @@ -330,6 +332,11 @@ class ISA: d['pcode'] = li d['extra_uninit_regs'] = extra_uninit_regs + # check if (temporarily) optional "Description" exists + if lines[0].startswith("Description:"): + l = lines.pop(0).rstrip() # skip "Description" + d['description'] = get_indented_lines(lines) + # "Special Registers Altered" expected l = lines.pop(0).rstrip() assert l.startswith("Special"), ("special not found %s" % l)