diff --git a/dv/uvm/core_ibex/riscv_dv_extension/ibex_log_to_trace_csv.py b/dv/uvm/core_ibex/riscv_dv_extension/ibex_log_to_trace_csv.py index 3ab90bc9..c4cc5c70 100644 --- a/dv/uvm/core_ibex/riscv_dv_extension/ibex_log_to_trace_csv.py +++ b/dv/uvm/core_ibex/riscv_dv_extension/ibex_log_to_trace_csv.py @@ -89,9 +89,12 @@ def process_ibex_sim_log(ibex_log, csv, full_trace=1): log and save to a standard CSV format. """ logging.info("Processing ibex log : %s" % ibex_log) - with open(ibex_log, "r") as log_fd, open(csv, "w") as csv_fd: - count = _process_ibex_sim_log_fd(log_fd, csv_fd, - True if full_trace else False) + try: + with open(ibex_log, "r") as log_fd, open(csv, "w") as csv_fd: + count = _process_ibex_sim_log_fd(log_fd, csv_fd, + True if full_trace else False) + except FileNotFoundError: + raise RuntimeError("Logfile %s not found" % ibex_log) logging.info("Processed instruction count : %d" % count) if not count: diff --git a/dv/uvm/core_ibex/sim.py b/dv/uvm/core_ibex/sim.py index ed1d7620..19915a4b 100755 --- a/dv/uvm/core_ibex/sim.py +++ b/dv/uvm/core_ibex/sim.py @@ -351,9 +351,14 @@ def compare_test_run(test, idx, iss, output_dir, report): rtl_csv = os.path.join(rtl_dir, 'trace_core_00000000.csv') uvm_log = os.path.join(rtl_dir, 'sim.log') - # Convert the RTL log file to a trace CSV. On failure, this will raise an - # exception, so we can assume this passed. - process_ibex_sim_log(rtl_log, rtl_csv, 1) + try: + # Convert the RTL log file to a trace CSV. + process_ibex_sim_log(rtl_log, rtl_csv, 1) + except RuntimeError as e: + with open(report, 'a') as report_fd: + report_fd.write('Log processing failed: {}\n'.format(e)) + + return False # Have a look at the UVM log. We should write out a message on failure or # if we are stopping at this point.