Files
rocm-systems/plugin/att/att_to_csv.py
T
Giovanni LB 5384050b01 Solving Benjamin and Ammar comments. Enabling ATT tests with new API.
Change-Id: I96525cf4ebbe475435bf631abcdc18ab3e2f9a66
2023-08-24 02:10:59 -04:00

18 rader
486 B
Python
Executable File

#!/usr/bin/env python3
import numpy as np
import csv
import os
def dump_csv(code):
outpath = os.getenv("OUT_FILE_NAME")
if outpath is None:
outpath = "att_output.csv"
if ".csv" not in outpath:
outpath += ".csv"
with open(outpath, 'w') as f:
writer = csv.writer(f)
writer.writerow(['Line', 'Instruction', 'Hitcount', 'Cycles', 'Addr', 'C++ Reference'])
[writer.writerow([m[5], m[0], m[7], m[8], hex(m[6]), m[3]]) for m in code]