Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding INTEL global variable extensions #205

Merged
merged 4 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Khronos SPIR-V Registry](https://www.khronos.org/registry/spir-v/).
1. [SPV_EXT_shader_tile_image ]( http://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/EXT/SPV_EXT_shader_tile_image.html)
1. [SPV_KHR_ray_tracing_position_fetch ]( http://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_ray_tracing_position_fetch.html)
1. [SPV_INTEL_arbitrary_precision_floating_point]( http://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/INTEL/SPV_INTEL_arbitrary_precision_floating_point.html)
1. [SPV_INTEL_global_variable_fpga_decorations]( http://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/INTEL/SPV_INTEL_global_variable_fpga_decorations.html)
1. [SPV_INTEL_global_variable_host_access]( http://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/INTEL/SPV_INTEL_global_variable_host_access.html)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please check that this extension is linked properly?

This all looks correct here, but the filename appears to be SPV_INTEL_global_variable_host_acces_decoration. I think the filename is incorrect and should be renamed, but this would be good to confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch - fixed


## Non-Semantic Extended Instruction Set Specifications

Expand Down
202 changes: 202 additions & 0 deletions extensions/INTEL/SPV_INTEL_global_variable_fpga_decorations.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
= SPV_INTEL_global_variable_fpga_decorations
:source-highlighter: coderay
:coderay-linenums-mode: table

// This section needs to be after the document title.
:doctype: book
:toc2:
:toc: left
:encoding: utf-8
:lang: en

== Name Strings

SPV_INTEL_global_variable_fpga_decorations

== Contact

To report problems with this extension, please open a new issue at:

https://github.com/KhronosGroup/SPIRV-Registry

== Contributors

- Artem Radzikhovskyy, Intel
- Michael Kinsner, Intel
- Joe Garvey, Intel
- Mohammad Fawaz, Intel
- Gregory Lueck, Intel

== Notice

Copyright (c) 2021-2023 Intel Corporation. All rights reserved.

== Status

* Complete

== Version

[width="40%",cols="25,25"]
|========================================
| Last Modified Date | {docdate}
| Revision | 1
|========================================

== Dependencies

This extension is written against the SPIR-V Specification,
Version 1.6 Revision 2.

This extension requires SPIR-V 1.0.

== Overview

This extension adds decorations that can be applied to global (module scope)
variables. These decorations are intended to help code generation for
FPGA devices, they can be ignored by all other consumers of this extension.

== Extension Name
To use this extension within a SPIR-V module, the following *OpExtension* must
be present in the module:

----
OpExtension "SPV_INTEL_global_variable_fpga_decorations"
----

== New Capabilities
This extension introduces a new capability:

----
GlobalVariableFPGADecorationsINTEL
----

== Token Number Assignments

--
[width="40%"]
[cols="70%,30%"]
[grid="rows"]
|====
|GlobalVariableFPGADecorationsINTEL | 6146
|InitModeINTEL | 6147
|ImplementInRegisterMapINTEL | 6148
|====
--

== Modifications to the SPIR-V Specification, Version 1.6

=== Initialization Mode Qualifier

After Section 3.18, add a new section "3.18a Initialization Mode Qualifier" as follows

Defines how the initialization should be triggered.

Used by InitModeINTEL.

--
[options="header"]
|====
2+^| Initialization Mode Qualifier ^| Enabling Capabilities
// --- ROW BREAK ---
| 0
| *InitOnDeviceReprogramINTEL*

Initialization is performed by reprogramming
the device. This may require more frequent reprogramming but may reduce
area.

| *GlobalVariableFPGADecorationsINTEL*

// --- ROW BREAK ---
| 1
| *InitOnDeviceResetINTEL*

Initialization is performed by sending a reset
signal to the device. This may increase area but may reduce reprogramming
frequency.
| *GlobalVariableFPGADecorationsINTEL*

|====
--

=== Decoration

Modify Section 3.20, Decoration, adding these rows to the Decoration table:

--
[cols="^4,20,2*5,22",options="header"]
|====
2+^.^| Decoration 2+<.^| Extra Operands | Enabling Capabilities

// --- ROW BREAK ---
| 6147
a|
*InitModeINTEL* +
Only valid on global (module scope) *OpVariable* which has an _Initializer_
operand.

This decoration only has an effect when the consumer is an FPGA or similar
device. The _Trigger_ value tells how the global variable should be
initialized.

If a global *OpVariable* with an _Initializer_ operand is not decorated with
*InitModeINTEL*, the method by which the variable's value is initialized is
implementation defined.

2+| Initialization Mode Qualifier +
_Trigger_
| *GlobalVariableFPGADecorationsINTEL*

// --- ROW BREAK ---
| 6148
a|
*ImplementInRegisterMapINTEL* +
Only valid on global (module scope) *OpVariable*.

This decoration only has an effect when the consumer is an FPGA or similar
device. The _Value_ value controls the interface of this global variable with
hardware outside the boundary of the SPIR-V module.

Legal values of _Value_:

* 0 [False] - Access to this memory is through a dedicated interface.
* 1 [True] - Access to this memory is through a common register map interface that may be shared by other control or data inputs and outputs.

If a global *OpVariable* is not decorated with *ImplementInRegisterMapINTEL*, the
interface for the variable is implementation defined.

2+| Literal Number +
_Value_
| *GlobalVariableFPGADecorationsINTEL*

|====
--

=== Capability

Modify Section 3.31, Capability, adding a row to the Capability table:
--
[options="header"]
|====
2+^| Capability ^| Implicitly Declares
| 6146
| GlobalVariableFPGADecorationsINTEL
|
|====
--

== Issues

None.

== Revision History

[cols="5,15,15,70"]
[grid="rows"]
[options="header"]
|========================================
|Rev|Date|Author|Changes
|1|2022-11-1|Gregory Lueck|Initial revision
|2|2023-04-25|Artem Radzikhovskyy| Seperated the FPGA specific decorations from the generic ones
|========================================
Loading