htif: catch proper store exception (#44)
authorGarret Kelly <Garret.Kelly@gmail.com>
Sat, 21 May 2016 22:41:28 +0000 (18:41 -0400)
committerAndrew Waterman <waterman@eecs.berkeley.edu>
Sat, 21 May 2016 22:41:28 +0000 (15:41 -0700)
The sim's debug_mmu will generate a trap_load_access_fault if the load
fails, not a trap_store_access_fault.  This doesn't materially affect
exection, but results in a nicer log message.

riscv/htif.cc

index 10dd3e2e776823ccc39addabe9c74e0eb01634e0..6e8fee9e462127e07f8ff8ac8ec962b3dd067974 100644 (file)
@@ -66,7 +66,7 @@ void htif_isasim_t::tick_once()
         reg_t addr = (hdr.addr + i) * HTIF_DATA_ALIGN;
         try {
           sim->debug_mmu->store_uint64(addr, buf[i]);
-        } catch (trap_load_access_fault& e) {
+        } catch (trap_store_access_fault& e) {
           fprintf(stderr, "HTIF: attempt to write to illegal address 0x%" PRIx64 "\n", addr);
           exit(-1);
         }