From: Luke Kenneth Casson Leighton Date: Fri, 21 Apr 2023 13:00:30 +0000 (+0100) Subject: add Levels table to ls012 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=390199d60a37fc9c7880c68718d4db7b48fa0093;p=libreriscv.git add Levels table to ls012 --- diff --git a/openpower/sv/rfc/ls012.mdwn b/openpower/sv/rfc/ls012.mdwn index 01b9dbe36..66b43f570 100644 --- a/openpower/sv/rfc/ls012.mdwn +++ b/openpower/sv/rfc/ls012.mdwn @@ -680,5 +680,6 @@ The key to headings and sections are as follows: [[!inline pages="openpower/sv/rfc/ls012/areas.mdwn" raw=yes ]] [[!inline pages="openpower/sv/rfc/ls012/xo_cost.mdwn" raw=yes ]] +[[!inline pages="openpower/sv/rfc/ls012/level.mdwn" raw=yes ]] [[!tag opf_rfc]] diff --git a/openpower/sv/rfc/ls012/optable.csv b/openpower/sv/rfc/ls012/optable.csv index 148a8bc28..e0fd62608 100644 --- a/openpower/sv/rfc/ls012/optable.csv +++ b/openpower/sv/rfc/ls012/optable.csv @@ -1,4 +1,4 @@ -op, rfc, priority, cost, SVP64, group, PO1, page, regs, Level +op, rfc, priority, cost, SVP64, group, PO1, page, regs, level # LD/ST-Postincrement lbzup, ls011, high, PO, yes, EXT2xx, no, isa/pifixedload, 1R2W, SFFS lbzupx, ls011, high, 10, yes, EXT2xx, no, isa/pifixedload, 2R2W, SFFS @@ -94,9 +94,9 @@ crbinlut, ls007, high, 5, yes, TBD, no, sv/bitmanip, 3r1w, SV/D fmvis, ls002, high, 5, yes, TBD, no, sv/bitmanip, 1W, SFFS fishmv, ls002, high, 5, yes, TBD, no, sv/bitmanip, 1R1W, SFFS # Shift-and-Add (mitigates LD-ST-Shift; Cryptography e.g. twofish) -shadd, ls003, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS -shadduw, ls003, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS -shaddw, ls003, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS +shadd, ls004, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS +shadduw, ls004, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS +shaddw, ls004, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS # Audio-Video absdu, TBD, TBD, 10, yes, TBD, no, sv/av_opcodes, 2R1W1w, SV/D avgadd, TBD, TBD, 10, yes, TBD, no, sv/av_opcodes, 2R1W1w, SV/D diff --git a/openpower/sv/rfc/ls012_optable.py b/openpower/sv/rfc/ls012_optable.py index 1847addee..50fc50ae5 100644 --- a/openpower/sv/rfc/ls012_optable.py +++ b/openpower/sv/rfc/ls012_optable.py @@ -32,6 +32,15 @@ def sort_by_page(p1, p2): return 1 return 0 +levels = ['SFFS', 'SV/E', 'SV/D', 'SV/S', 'opt'] + +def sort_by_level(p1, p2): + p1 = levels.index(p1['level']) + p2 = levels.index(p2['level']) + if p1 < p2: return -1 + if p1 > p2: return 1 + return 0 + priorities = ['high', 'med', 'low', 'TBD'] def sort_by_priority(p1, p2): @@ -52,6 +61,15 @@ def sort_by_cost(p1, p2): if p1 > p2: return 1 return 0 +def sort_by_level_priority_cost(p1, p2): + v = sort_by_level(p1, p2) + if v == 0: + v = sort_by_priority(p1, p2) + if v == 0: + v = sort_by_cost(p1, p2) + return v + + def sort_by_cost_priority_page(p1, p2): v = sort_by_cost(p1, p2) if v == 0: @@ -61,6 +79,23 @@ def sort_by_cost_priority_page(p1, p2): return v +def by_levelpriority_then_cost(areas): + # first blat all columns together (drop area-dict) + res = [] + for row in areas.values(): + res += row + # now sort them + res = sorted(res, key=functools.cmp_to_key(sort_by_level_priority_cost)) + # now split out into a dict again this time by cost-priority + levels = {} + for row in res: + key = row['level']+row['priority'] + if key not in levels: + levels[key] = [] + levels[key].append(row) + return levels + + def by_cost_then_priority_then_page(areas): # first blat all columns together (drop area-dict) res = [] @@ -190,3 +225,6 @@ if __name__ == '__main__': # now sort by cost and then by page print_table("XO cost", header, areas, by_cost_then_priority_then_page) + # now sort by level combined with priority, then cost + print_table("Level", header, areas, by_levelpriority_then_cost) +