@@ -114,13 +114,22 @@ function clause execute ExclusiveOr(d, n, m) = {
114114}
115115
116116/* Data Barrier */
117- union clause ast = DataMemoryBarrier : MBReqTypes
118- union clause ast = DataSynchronizationBarrier : MBReqTypes
117+ union clause ast = DataMemoryBarrier : ( MBReqDomain , MBReqTypes )
118+ union clause ast = DataSynchronizationBarrier : ( MBReqDomain , MBReqTypes )
119119union clause ast = InstructionSynchronizationBarrier : unit
120120
121121val decodeDataBarrier : (bits (4 ), bool ) -> option (ast )
122122
123123function decodeDataBarrier (CRm , is_sync ) = {
124+ let domain : MBReqDomain =
125+ match CRm [3 .. 2 ] {
126+ 0b11 => MBReqDomain_FullSystem ,
127+ 0b10 => MBReqDomain_InnerShareable ,
128+ 0b01 => MBReqDomain_Nonshareable ,
129+ 0b00 => MBReqDomain_OuterShareable ,
130+ _ => return None ()
131+ };
132+
124133 let types : MBReqTypes =
125134 match CRm [1 .. 0 ] {
126135 0b01 => MBReqTypes_Reads ,
@@ -130,33 +139,33 @@ function decodeDataBarrier(CRm, is_sync) = {
130139 };
131140
132141 if is_sync then
133- Some (DataSynchronizationBarrier (types ))
142+ Some (DataSynchronizationBarrier (domain , types ))
134143 else
135- Some (DataMemoryBarrier (types ))
144+ Some (DataMemoryBarrier (domain , types ))
136145}
137146
138147/* DMB */
139148function clause decode (0b1101010100 @ 0b0 @ 0b00 @ 0b011 @ 0b0011 @ (CRm : bits (4 ))@ 0b1 @ 0b01 @ 0b11111 ) = {
140149 decodeDataBarrier (CRm , false )
141150}
142151
143- function clause execute DataMemoryBarrier (types ) = {
152+ function clause execute DataMemoryBarrier (domain , types ) = {
144153 // Update the PC
145154 _PC = _PC + 4 ;
146155 // Then perform the barrier
147- dataMemoryBarrier (types );
156+ dataMemoryBarrier (domain , types );
148157}
149158
150159/* DSB */
151160function clause decode (0b11010101000000110011 @ (CRm : bits (4 ))@ 0b100 @ 0b11111 ) = {
152161 decodeDataBarrier (CRm , true )
153162}
154163
155- function clause execute DataSynchronizationBarrier (types ) = {
164+ function clause execute DataSynchronizationBarrier (domain , types ) = {
156165 // Update the PC
157166 _PC = _PC + 4 ;
158167 // Then perform the barrier
159- dataSynchronizationBarrer (types )
168+ dataSynchronizationBarrer (domain , types )
160169}
161170
162171/* ISB */
@@ -205,6 +214,3 @@ function clause execute CompareAndBranch(t, offset) = {
205214 }
206215 else _PC = _PC + 4 ;
207216}
208-
209- // This catch-all clause MUST be the last clause for the `decode` function.
210- function clause decode (_ ) = { None () }
0 commit comments