aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_machine')
-rw-r--r--qtmips_machine/cache.cpp10
-rw-r--r--qtmips_machine/cache.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/qtmips_machine/cache.cpp b/qtmips_machine/cache.cpp
index 3fbfc3f..7925dc0 100644
--- a/qtmips_machine/cache.cpp
+++ b/qtmips_machine/cache.cpp
@@ -41,6 +41,8 @@ Cache::Cache(Memory *m, const MachineConfigCache *cc, unsigned memory_access_pen
mem = m;
access_pen_r = memory_access_penalty_r;
access_pen_w = memory_access_penalty_w;
+ uncached_start = 0xf0000000;
+ uncached_last = 0xffffffff;
// Zero hit and miss rate
hit_read = 0;
hit_write = 0;
@@ -77,7 +79,9 @@ Cache::Cache(Memory *m, const MachineConfigCache *cc, unsigned memory_access_pen
bool Cache::wword(std::uint32_t address, std::uint32_t value) {
bool changed;
- if (!cnf.enabled()) {
+
+ if (!cnf.enabled() ||
+ (address >= uncached_start && address <= uncached_last)) {
return mem->write_word(address, value);
}
@@ -90,8 +94,10 @@ bool Cache::wword(std::uint32_t address, std::uint32_t value) {
}
std::uint32_t Cache::rword(std::uint32_t address) const {
- if (!cnf.enabled())
+ if (!cnf.enabled() ||
+ (address >= uncached_start && address <= uncached_last)) {
return mem->read_word(address);
+ }
std::uint32_t data;
access(address, &data, false);
diff --git a/qtmips_machine/cache.h b/qtmips_machine/cache.h
index 0859bd4..5e19e10 100644
--- a/qtmips_machine/cache.h
+++ b/qtmips_machine/cache.h
@@ -74,6 +74,8 @@ private:
MachineConfigCache cnf;
Memory *mem;
unsigned access_pen_r, access_pen_w;
+ std::uint32_t uncached_start;
+ std::uint32_t uncached_last;
struct cache_data {
bool valid, dirty;