spelling fix
[libreriscv.git] / openpower / sv / rfc / ls012_optable.py
index f7ac4defd990e784e4a895fbf07eff712004efd9..ef5cf9e6a81f15feb422dd7bb9535f1a57ff5e33 100644 (file)
@@ -78,6 +78,18 @@ def by_cost_then_priority_then_page(areas):
     return costs
 
 
+# For prettier printing, replace short column heading
+# names with full, consistent names.
+# Expected input is a list of column strings
+def column_header_replacement(header):
+    replacement_col = {'cost': 'XO Cost'}
+    new_header = deepcopy(header)
+    for index, shortname in enumerate(replacement_col.keys()):
+        # update with replacement if any otherwise leave alone
+        new_header[index] = replacement_col.get(shortname, shortname)
+    return new_header
+
+
 def print_table(title, header, areas, sortby):
     fname = title.lower().replace(" ", "_")
     with open("ls012/%s.mdwn" % fname, "w") as f:
@@ -171,7 +183,7 @@ if __name__ == '__main__':
         # store line in area
         areas[area].append(linedict)
 
-    # exccellent - now have a dictionary of list of dictionaries:
+    # excellent - now have a dictionary of list of dictionaries:
     # area - list-of-instructions - dictionary-by-heading
     print_table("Areas", header, areas, None)