interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / tools / sm121dis / oracle_pairs.sh

16 lines · 874 bytes Raw Blame History
1#!/bin/sh
2# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3# oracle_pairs.sh <nvdisasm -hex output>: one line per instruction, "<addr> <low 64 bits> <high 64 bits> <text> ;",
4# text with spacing collapsed but the space before the semicolon kept (nvdisasm leaves it out on padding words).
5# The C6 oracle side (docs/OMEGA.md): nvdisasm decodes, nothing it prints enters a kernel.
6awk '
7/^[[:space:]]*\/\*[0-9a-f]+\*\// {
8 line = $0
9 addr = line; sub(/^[[:space:]]*\/\*/, "", addr); sub(/\*\/.*/, "", addr)
10 txt = line; sub(/^[[:space:]]*\/\*[0-9a-f]+\*\/[[:space:]]*/, "", txt); sub(/;.*$/, ";", txt)
11 lo = line; sub(/.*\/\* 0x/, "", lo); sub(/ \*\/.*/, "", lo)
12 gsub(/[[:space:]]+/, " ", txt)
13 pend = 1; next
14}
15pend && /\/\* 0x[0-9a-f]+ \*\// { hi = $0; sub(/.*\/\* 0x/, "", hi); sub(/ \*\/.*/, "", hi); print addr, lo, hi, txt; pend = 0 }
16' "$1"