whoops typo, 63-start not 3-start (doh)
[soc.git] / src / soc / fu / trap / pipe_data.py
1 from soc.fu.pipe_data import IntegerData, CommonPipeSpec
2 from soc.fu.trap.trap_input_record import CompTrapOpSubset
3
4
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
10 ]
11 def __init__(self, pspec):
12 super().__init__(pspec, False)
13 # convenience
14 self.srr0, self.srr1 = self.fast1, self.fast2
15 self.a, self.b = self.ra, self.rb
16
17
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)
26 # convenience
27 self.srr0, self.srr1 = self.fast1, self.fast2
28
29
30
31 class TrapPipeSpec(CommonPipeSpec):
32 regspec = (TrapInputData.regspec, TrapOutputData.regspec)
33 opsubsetkls = CompTrapOpSubset