From 8c7a41702faf6760c74382ae269f0bf4603a0abe Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Mon, 4 Feb 2019 22:03:38 +0100 Subject: Define uncached region in range from 0xf0000000 to 0xffffffff. Signed-off-by: Pavel Pisa --- qtmips_machine/cache.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'qtmips_machine/cache.cpp') 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); -- cgit v1.2.3