From ccfab58040bcd61e1631a5f8e2a8a86613a1d70d Mon Sep 17 00:00:00 2001 From: Neil Webber Date: Fri, 29 Sep 2023 14:14:34 -0500 Subject: [PATCH] fix segcache bug with new unfolded I/D space --- mmu.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mmu.py b/mmu.py index b3625ba..73af84e 100644 --- a/mmu.py +++ b/mmu.py @@ -156,8 +156,13 @@ class MemoryMgmt: else: # dump any matching cache entries in both reading/writing form. for rw in (_CYCLE.READ, _CYCLE.WRITE): - if (aprnum, mode, space, rw) in self.segcache: - del self.segcache[(aprnum, mode, space, rw)] + # the "space" is a dilemma because it is tied up in + # the unfolding of I/D space separation. It's not hard + # to figure out what to do but its also very easy to + # just do this: nuke both I and D space cache entries. + for xspc in (self.ISPACE, self.DSPACE): + if (aprnum, mode, xspc, rw) in self.segcache: + del self.segcache[(aprnum, mode, xspc, rw)] aprfile[aprnum][parpdr] = value