optional read of "Description" in pagereader.py
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 3 Oct 2023 14:34:35 +0000 (15:34 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 3 Oct 2023 14:35:03 +0000 (15:35 +0100)
src/openpower/decoder/pseudo/pagereader.py

index d3f51cd5f3a2520c2b7fb5fdec51bfab4cbd26a3..be70f32eb3787e8b44951671cddbcae3526b2449 100644 (file)
@@ -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)