X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fsoc%2Fdecoder%2Fpower_regspec_map.py;h=0f5bce328248a18bd6f15b011f7f02d1e4d11ba2;hb=HEAD;hp=241dc94e7a3f0b54d02241e2d0b73a16f48a68b7;hpb=4250c7e26c9056f86da1338add6cdc7f9a57a128;p=soc.git diff --git a/src/soc/decoder/power_regspec_map.py b/src/soc/decoder/power_regspec_map.py index 241dc94e..0f5bce32 100644 --- a/src/soc/decoder/power_regspec_map.py +++ b/src/soc/decoder/power_regspec_map.py @@ -1,69 +1,73 @@ """regspec_decode -function for the relationship between regspecs and Decode2Execute1Type - -see https://libre-soc.org/3d_gpu/architecture/regfile/ section on regspecs -""" -from nmigen import Const -from soc.regfile.regfiles import XERRegs, FastRegs -from soc.decoder.power_enums import CryIn +functions for the relationship between regspecs and Decode2Execute1Type +these functions encodes the understanding (relationship) between +Regfiles, Computation Units, and the Power ISA Decoder (PowerDecoder2). -def regspec_decode(e, regfile, name): - """regspec_decode +based on the regspec, which contains the register file name and register +name, return a tuple of: - this function encodes the understanding (relationship) between - Regfiles, Computation Units, and the Power ISA Decoder (PowerDecoder2). +* how the decoder should determine whether the Function Unit needs + access to a given Regport or not +* which Regfile number on that port should be read to get that data +* when it comes to writing: likewise, which Regfile num should be written - based on the regspec, which contains the register file name and register - name, return a tuple of: +Note that some of the port numbering encoding is *unary*. in the case +of "Full Condition Register", it's a full 8-bit mask of read/write-enables. +This actually matches directly with the XFX field in MTCR, and at +some point that 8-bit mask from the instruction could actually be passed +directly through to full_cr (TODO). - * how the decoder should determine whether the Function Unit needs - access to a given Regport or not - * which Regfile number on that port should be read to get that data - * when it comes to writing: likewise, which Regfile num should be written +For the INT and CR numbering, these are expressed in binary in the +instruction and need to be converted to unary (1<