freedreno/decode: Add a simple util to dump csv reg list

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35803>
This commit is contained in:
Rob Clark
2025-06-20 09:31:05 -07:00
committed by Marge Bot
parent f6bdb8cd06
commit 029270f9c1
2 changed files with 59 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
/*
* Copyright (c) Qualcomm Technologies, Inc. and/or its susidiaries.
* SPDX-License-Identifier: MIT
*/
#include <stdbool.h>
#include <stdio.h>
#include "rnndec.h"
#include "rnnutil.h"
/**
* A simple utility to dump a list off offset,name pairs for registers of
* the specificied generation.
*/
int
main(int argc, char **argv)
{
struct rnn *rnn;
if (argc != 2) {
printf("usage: dumpregs GEN\n");
return -1;
}
rnn = rnn_new(true);
rnn_load(rnn, argv[1]);
for (unsigned i = 0; i < rnn->dom[0]->subelemsnum; i++) {
struct rnndelem *e = rnn->dom[0]->subelems[i];
if (!rnndec_varmatch(rnn->vc, &e->varinfo))
continue;
printf("0x%05X,%s\n", (uint32_t)e->offset, e->name);
}
return 0;
}
+18
View File
@@ -233,6 +233,24 @@ crashdec = executable(
install: install_fd_decode_tools,
)
dumpregs = executable(
'dumpregs',
[ 'dumpregs.c' ],
include_directories: [
inc_freedreno,
inc_freedreno_rnn,
inc_include,
inc_src,
],
gnu_symbol_visibility: 'hidden',
dependencies: [],
link_with: [
libfreedreno_cffdec,
],
build_by_default: with_tools.contains('freedreno'),
install: false,
)
if with_tests
crashdec_tests = [
['crash', ['-sf']],