Allow the formal engine to perform a same-cycle result in the ALU
[soc.git] / src / soc / experiment / mem_types.py
1 """mem_types
2
3 based on Anton Blanchard microwatt common.vhdl
4
5 """
6 from nmutil.iocontrol import RecordObject
7 from nmigen import Signal
8
9 from openpower.exceptions import LDSTException
10
11
12 class DCacheToLoadStore1Type(RecordObject):
13 def __init__(self, name=None):
14 super().__init__(name=name)
15 self.valid = Signal()
16 self.data = Signal(64)
17 self.store_done = Signal()
18 self.error = Signal()
19 self.cache_paradox = Signal()
20
21
22 class DCacheToMMUType(RecordObject):
23 def __init__(self, name=None):
24 super().__init__(name=name)
25 self.stall = Signal()
26 self.done = Signal()
27 self.err = Signal()
28 self.data = Signal(64)
29
30
31 class Fetch1ToICacheType(RecordObject):
32 def __init__(self, name=None):
33 super().__init__(name=name)
34 self.req = Signal()
35 self.virt_mode = Signal()
36 self.priv_mode = Signal()
37 self.stop_mark = Signal()
38 self.sequential = Signal()
39 self.nia = Signal(64)
40
41
42 class ICacheToDecode1Type(RecordObject):
43 def __init__(self, name=None):
44 super().__init__(name=name)
45 self.valid = Signal()
46 self.stop_mark = Signal()
47 self.fetch_failed = Signal()
48 self.nia = Signal(64)
49 self.insn = Signal(32)
50
51
52 class LoadStore1ToDCacheType(RecordObject):
53 def __init__(self, name=None):
54 super().__init__(name=name)
55 self.valid = Signal()
56 self.hold = Signal()
57 self.load = Signal() # this is a load
58 self.dcbz = Signal()
59 self.nc = Signal()
60 self.reserve = Signal()
61 self.atomic = Signal() # part of a multi-transfer atomic op
62 self.atomic_last = Signal()
63 self.virt_mode = Signal()
64 self.priv_mode = Signal()
65 self.addr = Signal(64)
66 self.data = Signal(64) # valid the cycle after valid=1
67 self.byte_sel = Signal(8)
68
69
70 class LoadStore1ToMMUType(RecordObject):
71 def __init__(self, name=None):
72 super().__init__(name=name)
73 self.valid = Signal()
74 self.tlbie = Signal()
75 self.slbia = Signal()
76 self.mtspr = Signal()
77 self.iside = Signal()
78 self.load = Signal()
79 self.priv = Signal()
80 self.sprn = Signal(10)
81 self.addr = Signal(64)
82 self.rs = Signal(64)
83
84
85 class MMUToLoadStore1Type(RecordObject):
86 def __init__(self, name=None):
87 super().__init__(name=name)
88 self.done = Signal()
89 self.err = Signal()
90 self.invalid = Signal()
91 self.badtree = Signal()
92 self.segerr = Signal()
93 self.perm_error = Signal()
94 self.rc_error = Signal()
95 self.sprval = Signal(64)
96
97
98 class MMUToDCacheType(RecordObject):
99 def __init__(self, name=None):
100 super().__init__(name=name)
101 self.valid = Signal()
102 self.tlbie = Signal()
103 self.doall = Signal()
104 self.tlbld = Signal()
105 self.addr = Signal(64)
106 self.pte = Signal(64)
107
108
109 class MMUToICacheType(RecordObject):
110 def __init__(self, name=None):
111 super().__init__(name=name)
112 self.tlbld = Signal()
113 self.tlbie = Signal()
114 self.doall = Signal()
115 self.addr = Signal(64)
116 self.pte = Signal(64)
117