Skip to content

Commit 75711e8

Browse files
committed
Move ast
1 parent 0aae602 commit 75711e8

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

instrs-sys.sail

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
$ifdef SYSTEM_TINY_ARM
22
/* TLBI */
3+
union clause ast = TLBInvalidation : (TLBIOp, reg_index)
4+
35
val decodeTLBI : (bits(3), bits(4), bits(4), bits(3), bits(5)) -> option(ast)
46
function clause decode (0b1101010100001@(op1:bits(3))@(CRn:bits(4))@(CRm:bits(4))@(op2:bits(3))@(Rt:bits(5))) = {
57
decodeTLBI(op1, CRn, CRm, op2, Rt)

instrs-user.sail

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/* LoadStoreRegister: LDR and STR */
2+
union clause ast = LoadRegister : (reg_index, reg_index, reg_index)
3+
union clause ast = StoreRegister : (reg_index, reg_index, reg_index)
4+
25
val decodeLoadStoreRegister : (bits(2), bits(5), bits(3), bit, bits(5), bits(5)) -> option(ast)
36

47
function clause decode (0b11@0b111@0b0@0b00@(opc:bits(2))@0b1@(Rm:bits(5))@(option_v:bits(3))@[S]@0b10@(Rn:bits(5))@(Rt:bits(5))) = {
@@ -77,6 +80,8 @@ function clause execute StoreRegister(t, n, m) = {
7780
}
7881

7982
/* Exclusive OR: EOR */
83+
union clause ast = ExclusiveOr : (reg_index, reg_index, reg_index)
84+
8085
val decodeExclusiveOr : (bit, bits(2), bit, bits(5), bits(6), bits(5), bits(5)) -> option(ast)
8186

8287
function clause decode ([sf]@0b10@0b01010@(shift:bits(2))@[N]@(Rm:bits(5))@(imm6:bits(6))@(Rn:bits(5))@(Rd:bits(5))) = {
@@ -109,6 +114,10 @@ function clause execute ExclusiveOr(d, n, m) = {
109114
}
110115

111116
/* Data Barrier */
117+
union clause ast = DataMemoryBarrier : MBReqTypes
118+
union clause ast = DataSynchronizationBarrier : MBReqTypes
119+
union clause ast = InstructionSynchronizationBarrier : unit
120+
112121
val decodeDataBarrier : (bits(4), bool) -> option(ast)
113122

114123
function decodeDataBarrier(CRm, is_sync) = {
@@ -163,6 +172,8 @@ function clause execute InstructionSynchronizationBarrier() = {
163172
}
164173

165174
/* CompareAndBranch: CBZ */
175+
union clause ast = CompareAndBranch : (reg_index, bits(64))
176+
166177
val decodeCompareAndBranch : (bits(19), bits(5)) -> option(ast)
167178

168179
function clause decode (0b1@0b011010@0b0@(imm19:bits(19))@(Rt:bits(5))) = {

tiny-arm.sail

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
scattered union ast
22

3-
union clause ast = LoadRegister : (reg_index, reg_index, reg_index)
4-
union clause ast = StoreRegister : (reg_index, reg_index, reg_index)
5-
union clause ast = ExclusiveOr : (reg_index, reg_index, reg_index)
6-
union clause ast = DataMemoryBarrier : MBReqTypes
7-
union clause ast = DataSynchronizationBarrier : MBReqTypes
8-
union clause ast = InstructionSynchronizationBarrier : unit
9-
union clause ast = CompareAndBranch : (reg_index, bits(64))
10-
11-
$ifdef SYSTEM_TINY_ARM
12-
union clause ast = TLBInvalidation : (TLBIOp, reg_index)
13-
$endif
14-
153
val decode : bits(32) -> option(ast)
164
scattered function decode
175

0 commit comments

Comments
 (0)