Skip to content

Commit 28f2377

Browse files
committed
Xqci extension: adding Xqcisync extension (sync with non-memory-mapped devices and delay)
Signed-off-by: Albert Yosher <[email protected]>
1 parent d18140a commit 28f2377

File tree

12 files changed

+375
-0
lines changed

12 files changed

+375
-0
lines changed

cfgs/qc_iu/arch_overlay/ext/Xqci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ versions:
105105
changes:
106106
- Added Xqciio sub-extension
107107
- Added Xqcisim sub-extension
108+
- Added Xqcisync sub-extension
108109
- Fix description of qc.shladd instruction
109110
- Fix description and functionality of qc.c.extu instruction
110111
- Fix description and functionality of qc.wrapi instruction
@@ -129,6 +130,7 @@ versions:
129130
- [Xqcilsm, "0.3.0"]
130131
- [Xqcisim, "0.1.0"]
131132
- [Xqcisls, "0.2.0"]
133+
- [Xqcisync, "0.1.0"]
132134
requires:
133135
name: Zca
134136
version: ">= 1.0.0"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# yaml-language-server: $schema=../../../../schemas/ext_schema.json
2+
3+
$schema: ext_schema.json#
4+
kind: extension
5+
name: Xqcisync
6+
type: unprivileged
7+
long_name: Qualcomm non-memory-mapped devices synchronization and delay
8+
versions:
9+
- version: "0.1.0"
10+
state: frozen
11+
ratification_date: null
12+
contributors:
13+
- name: Albert Yosher
14+
company: Qualcomm Technologies, Inc.
15+
16+
- name: Derek Hower
17+
company: Qualcomm Technologies, Inc.
18+
19+
description: |
20+
The Xqcisync extension includes nine instructions, eight for non-memory-mapped devices synchronization and delay instruction.
21+
Synchronization instructions are kind of IO fences that work with special devices synchronization signals.
22+
23+
doc_license:
24+
name: Creative Commons Attribution 4.0 International License
25+
url: https://creativecommons.org/licenses/by/4.0/
26+
company:
27+
name: Qualcomm Technologies, Inc.
28+
url: https://qualcomm.com
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.c.delay
6+
long_name: Delay execution for immediate amount of cycles
7+
description: |
8+
Delay execution for amount of cycles provided as immediate argument
9+
Instruction encoded in CI instruction format.
10+
definedBy:
11+
anyOf:
12+
- Xqci
13+
- Xqcisync
14+
assembly: ""
15+
base: 32
16+
encoding:
17+
match: "000000000-----10"
18+
variables:
19+
- name: imm
20+
location: 6-2
21+
access:
22+
s: always
23+
u: always
24+
vs: always
25+
vu: always
26+
operation(): |
27+
delay(imm);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.c.sync
6+
long_name: Non-memory-mapped device read-after-write synchronization to completion
7+
description: |
8+
This synchronization instruction delays execution till last read (input)
9+
from non-memory-mapped device transactions are completed for specified devices.
10+
As well, instruction implies fence.tso functionality for all memory accesses.
11+
Immediate argument is 3-bit encoding of 5-bit bitmask field
12+
that specifies up to five pre-defined devices.
13+
Values of bitmask encoding supported: 0,1,2,4,8,16,15,31
14+
Instruction encoded in CB instruction format.
15+
definedBy:
16+
anyOf:
17+
- Xqci
18+
- Xqcisync
19+
assembly: " slist"
20+
base: 32
21+
encoding:
22+
match: "100000---0000001"
23+
variables:
24+
- name: slist
25+
location: 9-7
26+
access:
27+
s: always
28+
u: always
29+
vs: always
30+
vu: always
31+
operation(): |
32+
Bits<5> bitmask;
33+
if (slist == 0) {
34+
bitmask = 0;
35+
} else if (slist < 6) {
36+
XReg shift = slist - 1;
37+
bitmask = (1 << shift);
38+
} else {
39+
XReg shift = slist - 2;
40+
bitmask = (1 << shift) - 1;
41+
}
42+
fence_tso();
43+
sync_read_after_write_device(true,bitmask);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.c.syncr
6+
long_name: Non-memory-mapped device read-after-write synchronization
7+
description: |
8+
This synchronization instruction delays execution till last read (input)
9+
from non-memory-mapped device transactions are started for specified devices.
10+
As well, instruction implies fence.tso functionality for all memory accesses.
11+
Immediate argument is 3-bit encoding of 5-bit bitmask field
12+
that specifies up to five pre-defined devices.
13+
Values of bitmask encoding supported: 0,1,2,4,8,16,15,31
14+
Instruction encoded in CB instruction format.
15+
definedBy:
16+
anyOf:
17+
- Xqci
18+
- Xqcisync
19+
assembly: " slist"
20+
base: 32
21+
encoding:
22+
match: "100001---0000001"
23+
variables:
24+
- name: slist
25+
location: 9-7
26+
access:
27+
s: always
28+
u: always
29+
vs: always
30+
vu: always
31+
operation(): |
32+
Bits<5> bitmask;
33+
if (slist == 0) {
34+
bitmask = 0;
35+
} else if (slist < 6) {
36+
XReg shift = slist - 1;
37+
bitmask = (1 << shift);
38+
} else {
39+
XReg shift = slist - 2;
40+
bitmask = (1 << shift) - 1;
41+
}
42+
fence_tso();
43+
sync_read_after_write_device(false,bitmask);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.c.syncwf
6+
long_name: Non-memory-mapped device write-after-read synchronization
7+
description: |
8+
This synchronization instruction delays execution till last write (output)
9+
to non-memory-mapped device transactions are started for specified devices.
10+
As well, instruction implies fence.tso functionality for all memory accesses.
11+
Immediate argument is 3-bit encoding of 5-bit bitmask field
12+
that specifies up to five pre-defined devices.
13+
Values of bitmask encoding supported: 0,1,2,4,8,16,15,31
14+
Instruction encoded in CB instruction format.
15+
definedBy:
16+
anyOf:
17+
- Xqci
18+
- Xqcisync
19+
assembly: " slist"
20+
base: 32
21+
encoding:
22+
match: "100100---0000001"
23+
variables:
24+
- name: slist
25+
location: 9-7
26+
access:
27+
s: always
28+
u: always
29+
vs: always
30+
vu: always
31+
operation(): |
32+
Bits<5> bitmask;
33+
if (slist == 0) {
34+
bitmask = 0;
35+
} else if (slist < 6) {
36+
XReg shift = slist - 1;
37+
bitmask = (1 << shift);
38+
} else {
39+
XReg shift = slist - 2;
40+
bitmask = (1 << shift) - 1;
41+
}
42+
fence_tso();
43+
sync_write_after_read_device(false,bitmask);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.c.syncwl
6+
long_name: Non-memory-mapped device write-after-read synchronization to completion
7+
description: |
8+
This synchronization instruction delays execution till last write (output)
9+
to non-memory-mapped device transactions are completed for specified devices.
10+
As well, instruction implies fence.tso functionality for all memory accesses.
11+
Immediate argument is 3-bit encoding of 5-bit bitmask field
12+
that specifies up to five pre-defined devices.
13+
Values of bitmask encoding supported: 0,1,2,4,8,16,15,31
14+
Instruction encoded in CB instruction format.
15+
definedBy:
16+
anyOf:
17+
- Xqci
18+
- Xqcisync
19+
assembly: " slist"
20+
base: 32
21+
encoding:
22+
match: "100101---0000001"
23+
variables:
24+
- name: slist
25+
location: 9-7
26+
access:
27+
s: always
28+
u: always
29+
vs: always
30+
vu: always
31+
operation(): |
32+
Bits<5> bitmask;
33+
if (slist == 0) {
34+
bitmask = 0;
35+
} else if (slist < 6) {
36+
XReg shift = slist - 1;
37+
bitmask = (1 << shift);
38+
} else {
39+
XReg shift = slist - 2;
40+
bitmask = (1 << shift) - 1;
41+
}
42+
fence_tso();
43+
sync_write_after_read_device(true,bitmask);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.sync
6+
long_name: Non-memory-mapped device read-after-write synchronization to completion
7+
description: |
8+
This synchronization instruction delays execution till last read (input)
9+
from non-memory-mapped device transactions are completed for specified devices.
10+
As well, instruction implies fence.tso functionality for all memory accesses.
11+
Immediate argument is 5-bit bitmask field that specifies up to five pre-defined devices.
12+
Instruction encoded in I instruction format.
13+
definedBy:
14+
anyOf:
15+
- Xqci
16+
- Xqcisync
17+
assembly: " imm"
18+
base: 32
19+
encoding:
20+
match: 0001000-----00000011000000010011
21+
variables:
22+
- name: imm
23+
location: 24-20
24+
access:
25+
s: always
26+
u: always
27+
vs: always
28+
vu: always
29+
operation(): |
30+
fence_tso();
31+
sync_read_after_write_device(true,imm);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.syncr
6+
long_name: Non-memory-mapped device read-after-write synchronization
7+
description: |
8+
This synchronization instruction delays execution till last read (input)
9+
from non-memory-mapped device transactions are started for specified devices.
10+
As well, instruction implies fence.tso functionality for all memory accesses.
11+
Immediate argument is 5-bit bitmask field that specifies up to five pre-defined devices.
12+
Instruction encoded in I instruction format.
13+
definedBy:
14+
anyOf:
15+
- Xqci
16+
- Xqcisync
17+
assembly: " imm"
18+
base: 32
19+
encoding:
20+
match: 0010000-----00000011000000010011
21+
variables:
22+
- name: imm
23+
location: 24-20
24+
access:
25+
s: always
26+
u: always
27+
vs: always
28+
vu: always
29+
operation(): |
30+
fence_tso();
31+
sync_read_after_write_device(false,imm);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.syncwf
6+
long_name: Non-memory-mapped device write-after-read synchronization
7+
description: |
8+
This synchronization instruction delays execution till last write (output)
9+
to non-memory-mapped device transactions are started for specified devices.
10+
As well, instruction implies fence.tso functionality for all memory accesses.
11+
Immediate argument is 5-bit bitmask field that specifies up to five pre-defined devices.
12+
Instruction encoded in I instruction format.
13+
definedBy:
14+
anyOf:
15+
- Xqci
16+
- Xqcisync
17+
assembly: " imm"
18+
base: 32
19+
encoding:
20+
match: 0100000-----00000011000000010011
21+
variables:
22+
- name: imm
23+
location: 24-20
24+
access:
25+
s: always
26+
u: always
27+
vs: always
28+
vu: always
29+
operation(): |
30+
fence_tso();
31+
sync_write_after_read_device(false,imm);

0 commit comments

Comments
 (0)