1 from soc
.regfile
.regfiles
import FastRegs
2 from soc
.decoder
.power_enums
import SPR
, spr_dict
4 def fast_reg_to_spr(spr_num
):
5 if spr_num
== FastRegs
.CTR
:
7 elif spr_num
== FastRegs
.LR
:
9 elif spr_num
== FastRegs
.TAR
:
11 elif spr_num
== FastRegs
.SRR0
:
13 elif spr_num
== FastRegs
.SRR1
:
17 def spr_to_fast_reg(spr_num
):
18 if not isinstance(spr_num
, str):
19 spr_num
= spr_dict
[spr_num
].SPR
24 elif spr_num
== 'TAR':
26 elif spr_num
== 'SRR0':
28 elif spr_num
== 'SRR1':