From 8291fd939f60681b32607cc3d41ca46834e6926f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 2 Dec 2021 15:39:44 +0000 Subject: [PATCH] specify length in RegDecodeInfo explicitly so that the information that needs to be captured (held by the ReservationStation) is not too great. some of the info is actually expressions, hence why using len() or Signal.like() does not work, it is too long --- src/openpower/decoder/power_regspec_map.py | 106 ++++++++++++--------- 1 file changed, 61 insertions(+), 45 deletions(-) diff --git a/src/openpower/decoder/power_regspec_map.py b/src/openpower/decoder/power_regspec_map.py index 749bdb2e..0266e3f8 100644 --- a/src/openpower/decoder/power_regspec_map.py +++ b/src/openpower/decoder/power_regspec_map.py @@ -34,41 +34,46 @@ The SPR regfile on the other hand is *binary*-encoded, and, furthermore, has to be "remapped" to internal SPR Enum indices (see SPRMap in PowerDecode2) see https://libre-soc.org/3d_gpu/architecture/regfile/ section on regspecs """ -from nmigen import Const +from nmigen import Const, Signal from openpower.consts import XERRegsEnum, FastRegsEnum, StateRegsEnum from openpower.decoder.power_enums import CryIn from openpower.util import log from collections import namedtuple -RegDecodeInfo = namedtuple("RedDecodeInfo", ['okflag', 'regport']) +RegDecodeInfo = namedtuple("RedDecodeInfo", ['okflag', 'regport', 'portlen']) + +# XXX TODO: these portlen numbers *must* increase / adapt for SVP64. def regspec_decode_read(m, e, regfile, name): """regspec_decode_read """ + rd = None + # INT regfile if regfile == 'INT': # Int register numbering is *unary* encoded if name == 'ra': # RA - return RegDecodeInfo(e.read_reg1.ok, e.read_reg1.data) + rd = RegDecodeInfo(e.read_reg1.ok, e.read_reg1.data, 5) if name == 'rb': # RB - return RegDecodeInfo(e.read_reg2.ok, e.read_reg2.data) + rd = RegDecodeInfo(e.read_reg2.ok, e.read_reg2.data, 5) if name == 'rc': # RS - return RegDecodeInfo(e.read_reg3.ok, e.read_reg3.data) + rd = RegDecodeInfo(e.read_reg3.ok, e.read_reg3.data, 5) # CR regfile if regfile == 'CR': # CRRegs register numbering is *unary* encoded if name == 'full_cr': # full CR (from FXM field) - return RegDecodeInfo(e.do.read_cr_whole.ok, e.do.read_cr_whole.data) + rd = RegDecodeInfo(e.do.read_cr_whole.ok, + e.do.read_cr_whole.data, 8) if name == 'cr_a': # CR A - return RegDecodeInfo(e.read_cr1.ok, 1<<(7-e.read_cr1.data)) + rd = RegDecodeInfo(e.read_cr1.ok, 1<<(7-e.read_cr1.data), 8) if name == 'cr_b': # CR B - return RegDecodeInfo(e.read_cr2.ok, 1<<(7-e.read_cr2.data)) + rd = RegDecodeInfo(e.read_cr2.ok, 1<<(7-e.read_cr2.data), 8) if name == 'cr_c': # CR C - return RegDecodeInfo(e.read_cr3.ok, 1<<(7-e.read_cr3.data)) + rd = RegDecodeInfo(e.read_cr3.ok, 1<<(7-e.read_cr3.data), 8) # XER regfile @@ -80,15 +85,15 @@ def regspec_decode_read(m, e, regfile, name): if name == 'xer_so': # SO needs to be read for overflow *and* for creation # of CR0 and also for MFSPR - return RegDecodeInfo(((e.do.oe.oe[0] & e.do.oe.ok) | + rd = RegDecodeInfo(((e.do.oe.oe[0] & e.do.oe.ok) | (e.xer_in & SO == SO)| - (e.do.rc.rc & e.do.rc.ok)), SO) + (e.do.rc.rc & e.do.rc.ok)), SO, 3) if name == 'xer_ov': - return RegDecodeInfo(((e.do.oe.oe[0] & e.do.oe.ok) | - (e.xer_in & CA == CA)), OV) + rd = RegDecodeInfo(((e.do.oe.oe[0] & e.do.oe.ok) | + (e.xer_in & CA == CA)), OV, 3) if name == 'xer_ca': - return RegDecodeInfo(((e.do.input_carry == CryIn.CA.value) | - (e.xer_in & OV == OV)), CA) + rd = RegDecodeInfo(((e.do.input_carry == CryIn.CA.value) | + (e.xer_in & OV == OV)), CA, 3) # STATE regfile @@ -98,34 +103,42 @@ def regspec_decode_read(m, e, regfile, name): MSR = 1<