diff --git a/vendor/google_riscv-dv.vendor.hjson b/vendor/google_riscv-dv.vendor.hjson new file mode 100644 index 00000000..ffe91b82 --- /dev/null +++ b/vendor/google_riscv-dv.vendor.hjson @@ -0,0 +1,14 @@ +// Copyright lowRISC contributors. +// Licensed under the Apache License, Version 2.0, see LICENSE for details. +// SPDX-License-Identifier: Apache-2.0 +{ + name: "google_riscv-dv", + target_dir: "google_riscv-dv", + patch_dir: "patches/google_riscv-dv", + + upstream: { + url: "https://github.com/google/riscv-dv", + rev: "master", + }, + +} diff --git a/vendor/patches/google_riscv-dv/0000-ibex-customization.patch b/vendor/patches/google_riscv-dv/0000-ibex-customization.patch new file mode 100644 index 00000000..6b85024c --- /dev/null +++ b/vendor/patches/google_riscv-dv/0000-ibex-customization.patch @@ -0,0 +1,183 @@ +diff --git a/scripts/ibex_log_to_trace_csv.py b/scripts/ibex_log_to_trace_csv.py +new file mode 100644 +index 0000000..34036bb +--- /dev/null ++++ b/scripts/ibex_log_to_trace_csv.py +@@ -0,0 +1,53 @@ ++""" ++Copyright lowRISC contributors. ++Licensed under the Apache License, Version 2.0, see LICENSE for details. ++SPDX-License-Identifier: Apache-2.0 ++ ++Convert ibex log to the standard trace CSV format ++""" ++ ++import re ++import argparse ++ ++from riscv_trace_csv import * ++ ++def process_ibex_sim_log(ibex_log, csv): ++ """Process ibex simulation log. ++ ++ Extract instruction and affected register information from ibex simulation ++ log and save to a standard CSV format. ++ """ ++ print("Processing ibex log : %s" % ibex_log) ++ instr_cnt = 0 ++ ibex_instr = "" ++ ++ with open(ibex_log, "r") as f, open(csv, "w") as csv_fd: ++ trace_csv = RiscvInstructiontTraceCsv(csv_fd) ++ trace_csv.start_new_trace() ++ for line in f: ++ # Extract instruction infromation ++ m = re.search(r"^\s*(?P