From 6bc83434d34236245fceb4ff22dc9269ce634f2a Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 4 Dec 2023 00:18:10 -0800 Subject: [PATCH] ISACaller: implement real_addr pseudo-code helper --- openpower/isa/fixedsync.mdwn | 2 +- src/openpower/decoder/isa/caller.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/openpower/isa/fixedsync.mdwn b/openpower/isa/fixedsync.mdwn index 44a6b022..979a6074 100644 --- a/openpower/isa/fixedsync.mdwn +++ b/openpower/isa/fixedsync.mdwn @@ -58,7 +58,7 @@ Pseudo-code: EA <- (RA|0) + (RB) RESERVE <- 1 RESERVE_LENGTH <- 4 - RESERVE_ADDR <- EA # real_addr(EA) + RESERVE_ADDR <- real_addr(EA) RT <- [0]*32 || MEM(EA, 4) Special Registers Altered: diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index 1b042381..e500f8a3 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -1514,6 +1514,14 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop): def REAL_PAGE_SIZE(self): return self.real_page_size + def real_addr(self, EA): + """ get the "real address to which `EA` maps" + + Specified in PowerISA v3.1B Book II Section 1.7.2.1 page 1049 (1075) + """ + # FIXME: translate EA to a physical address + return EA + @property def FPSCR(self): return self.fpscr -- 2.30.2