From 8fd823547bf1369cbe26717b70bfb69aaa9cd8c5 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 4 Jun 2020 20:54:16 +0100 Subject: [PATCH] sigh. because POWER. CR index inversion --- src/soc/decoder/power_regspec_map.py | 7 ++++--- src/soc/simple/test/test_core.py | 5 ----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/soc/decoder/power_regspec_map.py b/src/soc/decoder/power_regspec_map.py index 241dc94e..31d79a87 100644 --- a/src/soc/decoder/power_regspec_map.py +++ b/src/soc/decoder/power_regspec_map.py @@ -56,14 +56,15 @@ def regspec_decode(e, regfile, name): if regfile == 'CR': # CRRegs register numbering is *unary* encoded + # *sigh*. numbering inverted on part-CRs. because POWER. if name == 'full_cr': # full CR return e.read_cr_whole, 0b11111111, 0b11111111 if name == 'cr_a': # CR A - return e.read_cr1.ok, 1<>(j*4)) & 0xf - # sigh. Because POWER - cri = int('{:04b}'.format(cri)[::-1], 2) print ("cr reg", hex(cri), i, core.regs.cr.regs[i].reg.shape()) yield core.regs.cr.regs[i].reg.eq(cri) -- 2.30.2