From: Luke Kenneth Casson Leighton Date: Thu, 4 Jun 2020 19:54:16 +0000 (+0100) Subject: sigh. because POWER. CR index inversion X-Git-Tag: div_pipeline~577 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8fd823547bf1369cbe26717b70bfb69aaa9cd8c5;p=soc.git sigh. because POWER. CR index inversion --- 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)