  #define CLINT_SIZE         0x000c0000
  #define EXT_IO_BASE        0x40000000
 -#define DRAM_BASE          0x80000000
-+#define DRAM_BASE          0x00000010
++#define DRAM_BASE          0x00000000
  
  // page table entry (PTE) fields
  #define PTE_V     0x001 // Valid

 
 #endif
diff --git a/riscv/devices.cc b/riscv/devices.cc
index 15115c8..d543912 100644
--- a/riscv/devices.cc
+++ b/riscv/devices.cc
@@ -2,6 +2,8 @@
 
 void bus_t::add_device(reg_t addr, abstract_device_t* dev)
 {
+  if (addr == 0)
+      addr = 16;
   devices[-addr] = dev;
 }
 
diff --git a/riscv/encoding.h b/riscv/encoding.h
index 8ec1345..ffeb24d 100644
--- a/riscv/encoding.h
+++ b/riscv/encoding.h
@@ -150,11 +150,11 @@

From 69109ac5c8ace59ebced58be6893717595ca5ea9 Mon Sep 17 00:00:00 2001
From: Min Chen <chenm003@163.com>
Date: Thu, 5 Oct 2017 19:32:44 -0500
Subject: [PATCH] [CHEN] fix memory address map conflict

---
 riscv/decode.h     |    4 ++--
 riscv/devices.cc   |   22 ++++++++++++++--------
 riscv/encoding.h   |    4 ++--
 riscv/processor.cc |    4 ++++
 riscv/sim.cc       |   11 ++++++++++-
 5 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/riscv/decode.h b/riscv/decode.h
index 9dcd809..d3130f1 100644
