picorv32/scripts/csmith/riscv-isa-sim-console.diff

15 lines
612 B
Diff

diff --git a/riscv/mmu.h b/riscv/mmu.h
index b9948c5..bee1f8b 100644
--- a/riscv/mmu.h
+++ b/riscv/mmu.h
@@ -67,7 +67,8 @@ public:
if (addr & (sizeof(type##_t)-1)) \
throw trap_store_address_misaligned(addr); \
reg_t vpn = addr >> PGSHIFT; \
- if (likely(tlb_store_tag[vpn % TLB_ENTRIES] == vpn)) \
+ if (addr == 0x10000000) putchar(val), fflush(stdout); \
+ else if (likely(tlb_store_tag[vpn % TLB_ENTRIES] == vpn)) \
*(type##_t*)(tlb_data[vpn % TLB_ENTRIES] + addr) = val; \
else \
store_slow_path(addr, sizeof(type##_t), (const uint8_t*)&val); \