diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-01-26 19:14:40 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-01-26 19:31:12 +0100 |
commit | eee4bc8dd953afc4fb92f81c35c684245e628ce4 (patch) | |
tree | 6ca1cb68f4284c5bb46742dd779a7a582250016b /tools | |
parent | 27f6235e8020c511c5cfa931370e7ad8d02c7058 (diff) |
collect feature bits to compare the various GPUs
Diffstat (limited to 'tools')
-rw-r--r-- | tools/data/gpus.json | 96 | ||||
-rwxr-xr-x | tools/dump_cmdstream.py | 4 | ||||
-rwxr-xr-x | tools/make_feature_comparison.py | 184 | ||||
-rwxr-xr-x | tools/show_egl2_log.sh | 2 |
4 files changed, 281 insertions, 5 deletions
diff --git a/tools/data/gpus.json b/tools/data/gpus.json new file mode 100644 index 0000000..bfd43bf --- /dev/null +++ b/tools/data/gpus.json @@ -0,0 +1,96 @@ +[ + { + "platform": "Rockchip 2918", + "chips": [{ + "type": "GC800", + "chipModel": "0x0800", + "chipRevision": "0x4604", + "chipFeatures": "0xa02c6eed", + "chipMinorFeatures": "0xe1399fff", + "chipMinorFeatures1": "0x19", + "chipMinorFeatures2": "0x0", + "chipMinorFeatures3": "0x0", + "streamCount": "0x1", + "registerMax": "0x40", + "threadCount": "0x100", + "shaderCoreCount": "0x1", + "vertexCacheSize": "0x8", + "vertexOutputBufferSize": "0x200" + }] + }, + { + "platform": "Marvell Armada 510 (88AP510)", + "chips": [{ + "type": "GC600", + "chipModel": "0x0600", + "chipRevision": "0x19", + "chipFeatures": "0x87ecd", + "chipMinorFeatures": "0x7", + "chipMinorFeatures1": "0x0", + "chipMinorFeatures2": "0x0", + "chipMinorFeatures3": "0x0", + "streamCount": "0x1", + "registerMax": "0x40", + "threadCount": "0x100", + "shaderCoreCount": "0x1", + "vertexCacheSize": "0x8", + "vertexOutputBufferSize": "0x200" + }] + }, + { + "platform": "Marvell Armada 620 (88AP2128-B0)", + "chips": [{ + "type": "GC2000", + "chipModel": "0x00002000", + "chipRevision": "0x00005026", + "chipFeatures": "0xE0286CAD", + "chipMinorFeatures": "0xC3799EFF", + "chipMinorFeatures1": "0x2E13B2D9", + "chipMinorFeatures2": "0x02000000", + "chipMinorFeatures3": "0x00000000" + }, { + "type": "GC300", + "chipModel": "0x00000300", + "chipRevision": "0x00004634", + "chipFeatures": "0xE02C7ECA", + "chipMinorFeatures": "0xE1399FFF", + "chipMinorFeatures1": "0x2E13B219", + "chipMinorFeatures2": "0x00010000", + "chipMinorFeatures3": "0x00000000" + }] + }, + { + "platform": "Marvell Armada XXX (OLPC XO-1.75, model: 1C2)", + "chips": [{ + "type": "GC860", + "chipModel": "0x860", + "chipRevision": "0x4603", + "chipFeatures": "0xe02c6eed", + "chipMinorFeatures": "0xcbf99fff", + "streamCount": "1", + "registerMax": "64", + "threadCount": "256", + "shaderCoreCount": "1", + "vertexCacheSize": "8", + "vertexOutputBufferSize": "512" + }] + }, + { + "platform": "Marvell 88SV331x", + "chips": [{ + "type": "GC530", + "chipModel": "0x530", + "chipRevision": "0x4303", + "chipFeatures": "0x212c66ed", + "chipMinorFeatures": "0x17f", + "streamCount": "1", + "registerMax": "64", + "threadCount": "128", + "shaderCoreCount": "1", + "vertexCacheSize": "8", + "vertexOutputBufferSize": "128" + }] + } +] + + diff --git a/tools/dump_cmdstream.py b/tools/dump_cmdstream.py index 5fe15e0..84fdb79 100755 --- a/tools/dump_cmdstream.py +++ b/tools/dump_cmdstream.py @@ -335,8 +335,6 @@ def parse_arguments(): help='Structures definition file') parser.add_argument('rules_file', metavar='RULESFILE', type=str, help='State map definition file (rules-ng-ng)') - parser.add_argument('isa_file', metavar='ISAFILE', type=str, - help='Shader ISA definition file (rules-ng-ng)') parser.add_argument('-l', '--hide-load-state', dest='hide_load_state', default=False, action='store_const', const=True, help='Hide "LOAD_STATE" entries, this can make command stream a bit easier to read') @@ -384,8 +382,6 @@ def main(): fdr = FDRLoader(args.input) global options options = args - global isa - isa = parse_rng_file(args.isa_file) def handle_comment(f, val, depth): '''Annotate value with a comment''' diff --git a/tools/make_feature_comparison.py b/tools/make_feature_comparison.py new file mode 100755 index 0000000..073ecac --- /dev/null +++ b/tools/make_feature_comparison.py @@ -0,0 +1,184 @@ +#!/usr/bin/python +''' +Create overview comparison table beween different GCxxx chips on different platforms. + +The input data is specified in JSON format, the output is in HTML. +''' +# Copyright (c) 2012-2013 Wladimir J. van der Laan +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sub license, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the +# next paragraph) shall be included in all copies or substantial portions +# of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +from __future__ import print_function, division, unicode_literals +import argparse +import json, cgi +from etnaviv.parse_rng import parse_rng_file, format_path, BitSet, Domain +import sys + +GPUS_FILE = 'data/gpus.json' +STATE_MAP = '../rnndb/state.xml' + +class Cell(object): + def __init__(self, row, column, value, rowspan=1, colspan=1, cls=None): + self.row = row + self.column = column + self.rowspan = rowspan + self.colspan = colspan + self.value = value + self.cls = cls + +def main(): + parser = argparse.ArgumentParser(description='Compare GCxxx chips.') + parser.add_argument('-i', dest='gpus_file', metavar='GPUSFILE', type=str, + help='gpus.json file', default=GPUS_FILE) + parser.add_argument('-s', dest='state_xml_file', metavar='STATEXML', type=str, + help='State map definition file (rules-ng-ng)', default=STATE_MAP) + args = parser.parse_args() + + with open(args.gpus_file, 'r') as f: + gpus = json.load(f) + state_xml = parse_rng_file(args.state_xml_file) + state_map = state_xml.lookup_domain('VIVS') + + feature_fields = ["chipFeatures", "chipMinorFeatures", "chipMinorFeatures1", "chipMinorFeatures2", "chipMinorFeatures3"] + all_features = [] + for field in feature_fields: + if field == 'chipMinorFeatures': + set_desc = state_xml.types['chipMinorFeatures0'] + else: + set_desc = state_xml.types[field] + all_features.extend([(field,bit) for bit in set_desc.bitfields]) + + table = [] + + cur_row = 0 + table.append(Cell(cur_row, 0, 'Platform', cls='header')) + cur_col = 1 + for platform in gpus: + table.append(Cell(cur_row, cur_col, platform['platform'], colspan=len(platform['chips']))) + cur_col += len(platform['chips']) + full_width = cur_col + + cur_row += 1 + table.append(Cell(cur_row, 0, 'Type', cls='header')) + cur_col = 1 + for platform in gpus: + for idx,chip in enumerate(platform['chips']): + table.append(Cell(cur_row, cur_col, chip['type'])) + cur_col += 1 + + cur_row += 1 + table.append(Cell(cur_row, 0, 'Revision', cls='header')) + cur_col = 1 + for platform in gpus: + for idx,chip in enumerate(platform['chips']): + if 'chipRevision' in chip: + revision_str = '0x%04x' % int(chip['chipRevision'],0) + else: + revision_str = '?' + table.append(Cell(cur_row, cur_col, revision_str)) + cur_col += 1 + + cur_row += 1 + table.append(Cell(cur_row, 0, 'Specs', colspan=full_width, cls='category')) + spec_fields = ["streamCount", "registerMax", "threadCount", "shaderCoreCount", "vertexCacheSize", "vertexOutputBufferSize"] + for (field) in spec_fields: + cur_row += 1 + table.append(Cell(cur_row, 0, field, cls='subheader')) + cur_col = 1 + for platform in gpus: + for chip in platform['chips']: + if field in chip: + value = int(chip[field], 0) + else: + value = '?' + table.append(Cell(cur_row, cur_col, value)) + cur_col += 1 + + cur_row += 1 + table.append(Cell(cur_row, 0, 'Features', colspan=full_width, cls='category')) + for (field, bit) in all_features: + cur_row += 1 + table.append(Cell(cur_row, 0, bit.name, cls='subheader')) + cur_col = 1 + for platform in gpus: + for chip in platform['chips']: + value = int(chip.get(field,'0'), 0) + active_feat = bit.extract(value) + if active_feat: + active_feat = '+' + cls = 'plus' + else: + active_feat = '-' + cls = 'minus' + table.append(Cell(cur_row, cur_col, active_feat, cls=cls)) + cur_col += 1 + + layout = {} + rows = 0 + columns = 0 + for cell in table: + layout[cell.row,cell.column] = cell + rows = max(cell.row+1, rows) + columns = max(cell.column+1, columns) + + out = sys.stdout + out.write('<html>\n') + out.write('<head><!-- Auto-generated by make_feature_comparison.py from gpus.json -->\n') + out.write('<title>Vivante GPU feature bits comparison</title>\n') + out.write("""<style> +body { background-color: white; } +table.gpu-comparison { table-layout: fixed; word-wrap:break-all; } +table.gpu-comparison td { width: 80px; text-align: center; fixed; word-wrap:break-word; word-break:break-all; } +table.gpu-comparison tr:nth-child(odd) td { + background-color: #e0e0ff; +} +table.gpu-comparison tr:nth-child(even) td { + background-color: #d0d0ff; +} +table.gpu-comparison td.header { text-align: left; width: 15em; } +table.gpu-comparison td.subheader { text-align: left; padding-left: 20px; } +table.gpu-comparison td.category { text-align: left; font-style: italic; } +table.gpu-comparison td.minus { color: #808080; } +table.gpu-comparison td.plus { } +</style> +""") + out.write('</head>\n') + out.write('<body>\n') + out.write('<table class="gpu-comparison">\n') + for row in xrange(rows): + out.write('<tr>') + for column in xrange(columns): + try: + cell = layout[row, column] + except KeyError: + pass #out.write('<td></td>') + else: + args = '' + if cell.colspan != 1: + args += ' colspan="%i"' % cell.colspan + if cell.cls is not None: + args += ' class="%s"' % cell.cls + out.write('<td%s>%s</td>' %(args,cgi.escape(str(cell.value)))) + out.write('</tr>\n') + out.write('</table>\n') + out.write('</body>\n') + out.write('</html>\n') + +if __name__ == '__main__': + main() diff --git a/tools/show_egl2_log.sh b/tools/show_egl2_log.sh index e7008f4..9dc11a8 100755 --- a/tools/show_egl2_log.sh +++ b/tools/show_egl2_log.sh @@ -20,4 +20,4 @@ if [ -z "$1" ]; then echo "Usage: show_egl2_log.sh ../native/egl2/cube.fdr <flags>" echo fi -python dump_cmdstream.py $* ${DIR}/data/gcs_hal_interface_v2.json ${DIR}/../rnndb/state.xml ${DIR}/../rnndb/isa.xml +python dump_cmdstream.py $* ${DIR}/data/gcs_hal_interface_v2.json ${DIR}/../rnndb/state.xml |