Skip to content

Commit e78114f

Browse files
committed
Xqci extension: add Xqciio and Xqcisim sub-extensions, initial spec addition
Signed-off-by: Albert Yosher <[email protected]>
1 parent 11ace6f commit e78114f

File tree

16 files changed

+453
-0
lines changed

16 files changed

+453
-0
lines changed

cfgs/qc_iu/arch_overlay/ext/Xqci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ versions:
103103
company: Qualcomm Technologies, Inc.
104104
105105
changes:
106+
- Added Xqciio sub-extension
107+
- Added Xqcisim sub-extension
106108
- Fix description of qc.shladd instruction
107109
- Fix description and functionality of qc.c.extu instruction
108110
- Fix description and functionality of qc.wrapi instruction
@@ -119,11 +121,13 @@ versions:
119121
- [Xqcics, "0.2.0"]
120122
- [Xqcicsr, "0.2.0"]
121123
- [Xqciint, "0.3.0"]
124+
- [Xqciio, "0.1.0"]
122125
- [Xqcilb, "0.2.0"]
123126
- [Xqcili, "0.2.0"]
124127
- [Xqcilia, "0.2.0"]
125128
- [Xqcilo, "0.2.0"]
126129
- [Xqcilsm, "0.3.0"]
130+
- [Xqcisim, "0.1.0"]
127131
- [Xqcisls, "0.2.0"]
128132
requires:
129133
name: Zca
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# yaml-language-server: $schema=../../../../schemas/ext_schema.json
2+
3+
$schema: ext_schema.json#
4+
kind: extension
5+
name: Xqciio
6+
type: privileged
7+
long_name: Qualcomm Input/Output device support
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 Xqciio extension includes two instructions to access external non-memory-mapped devices for input and output
21+
22+
doc_license:
23+
name: Creative Commons Attribution 4.0 International License
24+
url: https://creativecommons.org/licenses/by/4.0/
25+
company:
26+
name: Qualcomm Technologies, Inc.
27+
url: https://qualcomm.com
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: Xqcisim
6+
type: unprivileged
7+
long_name: Qualcomm simulator support hints
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 Xqcisim extension includes ten hint instructions to interface simulation environment.
21+
On real target any instruction from this extension executed as "no-operation" and have no effect.
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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.c.ptrace
6+
long_name: Tracing pseudo-instruction (hint) working only in simulation environment
7+
description: |
8+
The tracing instruction have no explicit arguments.
9+
Implicit arguments defined by simulation environment implementation.
10+
Instruction is used to signal simulator to collect some tracing information.
11+
Instruction encoded in CI instruction format.
12+
definedBy:
13+
anyOf:
14+
- Xqci
15+
- Xqcisim
16+
assembly: ""
17+
base: 32
18+
encoding:
19+
match: "0000000000000010"
20+
access:
21+
s: always
22+
u: always
23+
vs: always
24+
vu: always
25+
operation(): |
26+
XReg func = 9;
27+
XReg arg = 0;
28+
iss_syscall(func,arg);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.inw
6+
long_name: Input word from non-memory-mapped device
7+
description: |
8+
Input 32 bits of data into register `rd` from a non-memory-mapped device.
9+
Such devices have own address space, unrelated to memory map.
10+
Device space address formed by adding `rs1` to to a unsigned offset `imm`.
11+
Instruction encoded in I instruction format.
12+
definedBy:
13+
anyOf:
14+
- Xqci
15+
- Xqciio
16+
assembly: xd, imm(xs1)
17+
base: 32
18+
encoding:
19+
match: -----------------101-----0001011
20+
variables:
21+
- name: imm
22+
location: 31-20
23+
left_shift: 2
24+
- name: rs1
25+
location: 19-15
26+
- name: rd
27+
location: 11-7
28+
access:
29+
s: always
30+
u: always
31+
vs: always
32+
vu: always
33+
operation(): |
34+
XReg device_address = X[rs1] + imm;
35+
X[rd] = read_device<32>(device_address);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.outw
6+
long_name: Output word to non-memory-mapped device
7+
description: |
8+
Output 32 bits of data from register `rs2` to a non-memory-mapped device.
9+
Such devices have own address space, unrelated to memory map.
10+
Device space address formed by adding `rs1` to to a unsigned offset `imm`.
11+
Instruction encoded in I instruction format.
12+
definedBy:
13+
anyOf:
14+
- Xqci
15+
- Xqciio
16+
assembly: xs2, imm(xs1)
17+
base: 32
18+
encoding:
19+
match: -----------------100-----0001011
20+
variables:
21+
- name: imm
22+
location: 31-20
23+
left_shift: 2
24+
- name: rs1
25+
location: 19-15
26+
- name: rs2
27+
location: 11-7
28+
access:
29+
s: always
30+
u: always
31+
vs: always
32+
vu: always
33+
operation(): |
34+
XReg device_address = X[rs1] + imm;
35+
write_device<32>(device_address, X[rs2]);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.pcoredump
6+
long_name: Print core dump pseudo-instruction (hint) working only in simulation environment
7+
description: |
8+
The print core dump instruction calls simulation environment with no explicit arguments.
9+
Implicit arguments are all general purpose registers and CSRs.
10+
Simulation environment expected to print the core dump on its console or standard output.
11+
The core dump format and content are defined by simulation environment.
12+
Instruction encoded in I instruction format.
13+
definedBy:
14+
anyOf:
15+
- Xqci
16+
- Xqcisim
17+
assembly: ""
18+
base: 32
19+
encoding:
20+
match: "01100000000000000010000000010011"
21+
access:
22+
s: always
23+
u: always
24+
vs: always
25+
vu: always
26+
operation(): |
27+
XReg func = 8;
28+
XReg arg = 0;
29+
iss_syscall(func,arg);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.pexit
6+
long_name: Exit call with register argument pseudo-instruction (hint) working only in simulation environment
7+
description: |
8+
The Exit call instruction calls simulation environment with unsigned `rs1` explicit argument.
9+
Simulation environment is expected to complete its execution and return to the system with exit code provided in `rs1`.
10+
Instruction encoded in I instruction format.
11+
definedBy:
12+
anyOf:
13+
- Xqci
14+
- Xqcisim
15+
assembly: " xs1"
16+
base: 32
17+
encoding:
18+
match: 101100000000-----010000000010011
19+
variables:
20+
- name: rs1
21+
location: 19-15
22+
access:
23+
s: always
24+
u: always
25+
vs: always
26+
vu: always
27+
operation(): |
28+
XReg func = 12;
29+
XReg arg = X[rs1];
30+
iss_syscall(func,arg);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.ppreg
6+
long_name: Print register pseudo-instruction (hint) working only in simulation environment
7+
description: |
8+
The print register instruction calls simulation environment with `rs1` explicit argument.
9+
Simulation environment expected to print the register value on its console or standard output.
10+
Instruction encoded in I instruction format.
11+
definedBy:
12+
anyOf:
13+
- Xqci
14+
- Xqcisim
15+
assembly: " xs1"
16+
base: 32
17+
encoding:
18+
match: 100000000000-----010000000010011
19+
variables:
20+
- name: rs1
21+
location: 19-15
22+
access:
23+
s: always
24+
u: always
25+
vs: always
26+
vu: always
27+
operation(): |
28+
XReg func = 2;
29+
XReg arg = X[rs1];
30+
iss_syscall(func,arg);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: qc.ppregs
6+
long_name: Print all registers pseudo-instruction (hint) working only in simulation environment
7+
description: |
8+
The print registers instruction calls simulation environment with no explicit arguments.
9+
Implicit arguments are all general purpose registers.
10+
Simulation environment expected to print the all registers value on its console or standard output.
11+
Instruction encoded in I instruction format.
12+
definedBy:
13+
anyOf:
14+
- Xqci
15+
- Xqcisim
16+
assembly: ""
17+
base: 32
18+
encoding:
19+
match: "01110000000000000010000000010011"
20+
access:
21+
s: always
22+
u: always
23+
vs: always
24+
vu: always
25+
operation(): |
26+
XReg func = 3;
27+
XReg arg = 0;
28+
iss_syscall(func,arg);

0 commit comments

Comments
 (0)