-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchi_spec.py
154 lines (143 loc) · 2.79 KB
/
chi_spec.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/usr/bin/python3
"""
Data definitions for AMBA CHI protocol.
Copyright (C) Arm Ltd. 2024. All rights reserved.
SPDX-License-Identifier: Apache 2.0
"""
# Channels in order used by CMN wp_chn_sel.
channel = ["REQ", "RSP", "SNP", "DAT"]
opcode_bits = [6, 4, 4, 3] # recent CHI has 7 bits for REQ
opcodes_REQ = [
"ReqLCrdReturn",
"ReadShared",
"ReadClean",
"ReadOnce",
"ReadNoSnp",
"PCrdReturn",
"?0x06",
"ReadUnique",
"CleanShared",
"CleanInvalid",
"MakeInvalid",
"CleanUnique",
"MakeUnique",
"Evict",
"?0x0E",
"?0x0F",
"?0x10",
"ReadNoSnpSep",
"?0x12",
"CleanSharedPersistSep",
"DVMOp",
"WriteEvictFull",
"?0x16",
"WriteCleanFull",
"WriteUniquePtl",
"WriteUniqueFull",
"WriteBackPtl",
"WriteBackFull",
"WriteNoSnpPtl",
"WriteNoSnpFull",
"?0x1E",
"?0x1F",
"WriteUniqueFullStash",
"WriteUniquePtlStash",
"StashOnceShared",
"StashOnceUnique",
"ReadOnceCleanInvalid",
"ReadOnceMakeInvalid",
"ReadNotSharedDirty",
"CleanSharedPersist",
"AtomicStoreADD",
"AtomicStoreCLR",
"AtomicStoreEOR",
"AtomicStoreSET",
"AtomicStoreSMAX",
"AtomicStoreSMIN",
"AtomicStoreUMAX",
"AtomicStoreUMIN",
"AtomicLoadADD",
"AtomicLoadCLR",
"AtomicLoadEOR",
"AtomicLoadSET",
"AtomicLoadSMAX",
"AtomicLoadSMIN",
"AtomicLoadUMAX",
"AtomicLoadUMIN",
"AtomicSwap",
"AtomicCompare",
"PrefetchTgt",
# ... a lot more, including the ones with Opcode[6] == 1
]
opcodes_RSP = [
"RespLCrdReturn",
"SnpResp",
"CompAck",
"RetryAck",
"Comp",
"CompDBIDResp",
"DBIDResp",
"PCrdGrant",
"ReadReceipt",
"SnpRespFwded",
"TagMatch",
"RespSepData",
"Persist",
"CompPersist",
"DBIDRespOrd",
"?0xF",
"StashDone",
"CompStashDone",
"?0x12",
"?0x13",
"CompCMO",
]
# CHI-F Table 13-15
opcodes_SNP = [
"SnpLCrdReturn",
"SnpShared",
"SnpClean",
"SnpOnce",
"SnpNotSharedDirty",
"SnpUniqueStash",
"SnpMakeInvalidStash",
"SnpUnique",
"SnpCleanShared",
"SnpCleanInvalid",
"SnpMakeInvalid",
"SnpStashUnique",
"SnpStashShared",
"SnpDVMOp",
"?0x0E",
"?0x0F",
"SnpQuery",
"SnpSharedFwd",
"SnpCleanFwd",
"SnpOnceFwd",
"SnpNotSharedDirtyFwd",
"SnpPreferUnique",
"SnpPreferUniqueFwd",
"SnpUniqueFwd",
]
opcodes_DAT = [
"DataLCrdReturn",
"SnpRespData",
"CopyBackWrData",
"NonCopyBackWrData",
"CompData",
"SnpRespDataPtl",
"SnpRespDataFwded",
"WriteDataCancel",
"?0x8",
"?0x9",
"?0xA",
"DataSepResp",
"NCPWrDataCompAck",
"?0xD",
"?0xE",
"?0xF",
]
opcodes = [
opcodes_REQ, opcodes_RSP, opcodes_SNP, opcodes_DAT
]
NS = ["S", "NS"]