1 from soc
.fu
.pipe_data
import IntegerData
, CommonPipeSpec
2 from soc
.fu
.trap
.trap_input_record
import CompTrapOpSubset
5 class TrapInputData(IntegerData
):
6 regspec
= [('INT', 'ra', '0:63'), # RA
7 ('INT', 'rb', '0:63'), # RB/immediate
8 ('FAST', 'fast1', '0:63'), # SRR0
9 ('FAST', 'fast2', '0:63'), # SRR1
11 def __init__(self
, pspec
):
12 super().__init
__(pspec
, False)
14 self
.srr0
, self
.srr1
= self
.fast1
, self
.fast2
15 self
.a
, self
.b
= self
.ra
, self
.rb
18 class TrapOutputData(IntegerData
):
19 regspec
= [('INT', 'o', '0:63'), # RA
20 ('FAST', 'fast1', '0:63'), # SRR0 SPR
21 ('FAST', 'fast2', '0:63'), # SRR1 SPR
22 ('FAST', 'nia', '0:63'), # NIA (Next PC)
23 ('FAST', 'msr', '0:63')] # MSR
24 def __init__(self
, pspec
):
25 super().__init
__(pspec
, True)
27 self
.srr0
, self
.srr1
= self
.fast1
, self
.fast2
31 class TrapPipeSpec(CommonPipeSpec
):
32 regspec
= (TrapInputData
.regspec
, TrapOutputData
.regspec
)
33 opsubsetkls
= CompTrapOpSubset