Added console out to csmith spike
This commit is contained in:
parent
6c69b3812e
commit
f4e42de247
|
@ -21,6 +21,7 @@ riscv-isa-sim/build.ok: riscv-fesvr/build.ok
|
|||
git clone https://github.com/riscv/riscv-isa-sim.git riscv-isa-sim
|
||||
cd riscv-isa-sim && git checkout 10ae74e
|
||||
cd riscv-isa-sim && patch -p1 < ../riscv-isa-sim-exit.diff
|
||||
cd riscv-isa-sim && patch -p1 < ../riscv-isa-sim-console.diff
|
||||
cd riscv-isa-sim && LDFLAGS="-L../riscv-fesvr" ./configure --with-isa=RV32IMC
|
||||
+cd riscv-isa-sim && ln -s ../riscv-fesvr/fesvr . && make && touch build.ok
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
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); \
|
Loading…
Reference in New Issue