debugging decoding of SPRs (fast)
[soc.git] / src / soc / regfile / util.py
1 from soc.regfile.regfiles import FastRegs
2 from soc.decoder.power_enums import SPR
3
4 def fast_reg_to_spr(spr_num):
5 if spr_num == FastRegs.CTR:
6 return SPR.CTR.value
7 elif spr_num == FastRegs.LR:
8 return SPR.LR.value
9 elif spr_num == FastRegs.TAR:
10 return SPR.TAR.value
11 elif spr_num == FastRegs.SRR0:
12 return SPR.SRR0.value
13 elif spr_num == FastRegs.SRR1:
14 return SPR.SRR1.value