diff --git a/nemu/src/memory/paddr.c b/nemu/src/memory/paddr.c index 98c5ffd..ea1cd87 100644 --- a/nemu/src/memory/paddr.c +++ b/nemu/src/memory/paddr.c @@ -51,16 +51,16 @@ void init_mem() { } word_t paddr_read(paddr_t addr, int len) { + IFDEF(CONFIG_MTRACE, Log("R " FMT_WORD "%d\n", addr, len)); if (likely(in_pmem(addr))) return pmem_read(addr, len); IFDEF(CONFIG_DEVICE, return mmio_read(addr, len)); - IFDEF(CONFIG_MTRACE, Log("R " FMT_WORD "%d\n", addr, len)); out_of_bound(addr); return 0; } void paddr_write(paddr_t addr, int len, word_t data) { + IFDEF(CONFIG_MTRACE, Log("W " FMT_WORD "%d D" FMT_WORD "\n", addr, len, data)); if (likely(in_pmem(addr))) { pmem_write(addr, len, data); return; } IFDEF(CONFIG_DEVICE, mmio_write(addr, len, data); return); - IFDEF(CONFIG_MTRACE, Log("W " FMT_WORD "%d D" FMT_WORD "\n", addr, len, data)); out_of_bound(addr); }