mirror of
https://github.com/lowRISC/ibex.git
synced 2025-04-22 04:47:25 -04:00
[dv] Record failure on log processing error
Previous to this change the entire process would die on an issue with processing a single log. This alters it so this will just add to the failure count with the error logged and the log processing continued to its end.
This commit is contained in:
parent
75148da58c
commit
1d2959e00a
2 changed files with 14 additions and 6 deletions
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue