Defines the following register files:
- * INT regfile
- * SPR regfile
- * CR regfile
- * XER regfile
- * FAST regfile
+ * INT regfile - 32x 64-bit
+ * SPR regfile - 110x 64-bit
+ * CR regfile - CR0-7
+ * XER regfile - XER.so, XER.ca/ca32, XER.ov/ov32
+ * FAST regfile - PC, MSR, CTR, LR, TAR, SRR1, SRR2
Links:
* https://bugs.libre-soc.org/show_bug.cgi?id=345
+* https://bugs.libre-soc.org/show_bug.cgi?id=351
* https://libre-soc.org/3d_gpu/architecture/regfile/
* https://libre-soc.org/openpower/isatables/sprs.csv
"""
# TODO
from soc.regfile import RegFile, RegFileArray
+from soc.regfile.virtual_port import VirtualRegPort
from soc.decoder.power_enums import SPR
# CR Regfile
-class CRRegs(RegFileArray):
+class CRRegs(VirtualRegPort):
"""Condition Code Registers (CR0-7)
* QTY 8of 8-bit registers
- * 8R8W (!) with additional 1R1W for the "full" width
+ * 3R1W 4-bit-wide with additional 1R1W for the "full" 32-bit width
* Array-based unary-indexed (not binary-indexed)
* write-through capability (read on same cycle as write)
"""
def __init__(self):
- super().__init__(4, 8)
- self.w_ports = [self.write_port("dest")]
- self.r_ports = [self.write_port("src1"),
+ super().__init__(32, 8)
+ self.w_ports = [self.full_wr, # 32-bit wide (masked, 8-en lines)
+ self.write_port("dest")] # 4-bit wide, unary-indexed
+ self.r_ports = [self.full_rd, # 32-bit wide (masked, 8-en lines)
+ self.write_port("src1"),
+ self.write_port("src2"),
+ self.write_port("src3")]
+
+
+# XER Regfile
+class XERRegs(VirtualRegPort):
+ """XER Registers (SO, CA/CA32, OV/OV32)
+
+ * QTY 3of 2-bit registers
+ * 3R3W 2-bit-wide with additional 1R1W for the "full" 6-bit width
+ * Array-based unary-indexed (not binary-indexed)
+ * write-through capability (read on same cycle as write)
+ """
+ def __init__(self):
+ super().__init__(6, 2)
+ self.w_ports = [self.full_wr, # 6-bit wide (masked, 3-en lines)
+ self.write_port("dest1"),
+ self.write_port("dest2",
+ self.write_port("dest3")]
+ self.r_ports = [self.full_rd, # 6-bit wide (masked, 3-en lines)
+ self.write_port("src1"),
self.write_port("src2"),
self.write_port("src3")]