return e.read_fast2.ok, 1<<e.read_fast2.data
if regfile == 'SPR':
- assert False, "regfile TODO %s %s" % (regfile, name)
+ # Int register numbering is *binary* encoded
+ if name == 'spr1':
+ return e.read_spr1.ok, e.read_spr1.data
+
assert False, "regspec not found %s %s" % (regfile, name)
return e.write_fast2, 1<<e.write_fast2.data
if regfile == 'SPR':
- assert False, "regfile TODO %s %s" % (regfile, name)
+ # Int register numbering is *binary* encoded
+ if name == 'spr1': # SPR1
+ return e.write_spr, e.write_spr.data
+
assert False, "regspec not found %s %s" % (regfile, name)
def __init__(self):
n_sprs = len(SPR)
super().__init__(64, n_sprs)
- self.w_ports = {'spr': self.write_port(name="dest")}
- self.r_ports = {'spr': self.read_port("src")}
+ self.w_ports = {'spr1': self.write_port(name="dest")}
+ self.r_ports = {'spr1': self.read_port("src")}
# class containing all regfiles: int, cr, xer, fast, spr
if __name__ == '__main__':
units = {'alu': 1, 'cr': 1, 'branch': 1, 'trap': 1, 'logical': 1,
+ 'spr': 1,
'shiftrot': 1}
pspec = TestMemPspec(ldst_ifacetype='bare_wb',
imem_ifacetype='bare_wb',