You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@ A set of tools for parsing and using AMD's machine-readable GPU ISA specificatio
3
3
4
4
The `IsaDecoder` API makes it easy to parse the specification XML files, decode instructions and even decode whole shaders.
5
5
6
+
The `explorer::Spec` experimental API lets you iterate over the elements of a given specification file.
7
+
6
8
For usage examples, see the [examples subfolder](https://github.com/GPUOpen-Tools/isa_spec_manager/tree/main/source/examples).
7
9
8
10
## Building isa_spec_manager
@@ -26,10 +28,25 @@ cd ./isa_spec_manager/build
26
28
27
29
The above script will create a windows directory and generate a solution for Visual Studio.
28
30
31
+
By default, a solution is generated for VS 2022. To generate a solution for a different VS version or to use a different MSVC toolchain use the `--vs` argument.
32
+
For example, to generate the solution for VS 2019 with the VS 2019 toolchain, run:
33
+
34
+
``
35
+
./prebuild_windows.bat --vs 2019
36
+
``
37
+
29
38
## Using the API
39
+
For the API and specification documentation, please see the [documentation subfolder](https://github.com/GPUOpen-Tools/isa_spec_manager/tree/main/documentation).
40
+
30
41
The following example files can give you a quick overview of how to start using the XML ISA spec in your project:
* Usage example with multiple architectures in flight: [./source/examples/multi_arch_decoder.cpp](./source/examples/multi_arch_decoder.cpp)
42
+
43
+
### IsaDecoder
44
+
* Basic usage example: [./source/examples/basic_decoder.cpp](./source/examples/basic_decoder.cpp). This sample requires a single command line argument which is a full path to the XML specification file.
45
+
* Usage example with multiple architectures in flight: [./source/examples/multi_arch_decoder.cpp](./source/examples/multi_arch_decoder.cpp). This sample requires one or more command line arguments which are the full paths to the XML specification files.
46
+
47
+
### explorer::Spec
48
+
* Basic usage example: [./source/examples/basic_explorer.cpp](./source/examples/basic_explorer.cpp). This sample requires a single command line argument which is a full path to the XML specification file.
49
+
33
50
34
51
## Getting the ISA specification files
35
-
The Machine-Readable GPU ISA specification files can be downloaded from [AMD's Machine-Readable GPU ISA Specification page on GPUOpen.com](https://gpuopen.com/machine-readable-isa/).
52
+
The Machine-Readable GPU ISA specification files can be downloaded from [AMD's Machine-Readable GPU ISA Specification page on GPUOpen.com](https://gpuopen.com/machine-readable-isa).
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,12 +23,22 @@ For usage examples and instructions on how to build the project, please see [sou
23
23
24
24
**Note:** while the `IsaDecoder` API is a good way to get started with parsing the XML files, nothing prevents you from parsing the files yourself and building your own custom workflow. To do that please refer to the XML schema documentation [XML schema documentation](https://github.com/GPUOpen-Tools/isa_spec_manager/blob/main/documentation/spec_documentation.md).
25
25
26
+
New in this release:
27
+
* Added support for operand subtypes (requires XML schema version `v1.1.0`).
28
+
* Introducing the experimental `explorer::Spec` API for iterating over the elements of a given specification file. See the [documentation](https://github.com/GPUOpen-Tools/isa_spec_manager/tree/main/documentation) and [examples](https://github.com/GPUOpen-Tools/isa_spec_manager/tree/main/source/examples) subfolders for more details.
29
+
* On Windows, the solution is now generated for the VS2022 toolchain by default.
30
+
* Unit tests are now part of the repository.
31
+
* Bug fixes and performance improvements.
32
+
26
33
## Known issues ##
27
34
28
35
### Specification ###
29
36
* Information about encoding modifiers is not provided in the specification.
37
+
*`S_ATOMIC_*` instructions have a `VMEM` functional group (instead of `SMEM`).
30
38
31
39
### API and tools ###
32
40
33
-
* Decoding of MIMG instructions (such as IMAGE_STORE and IMAGE_LOAD) may produce the wrong register indices for source vector register operands.
41
+
* Decoding of `MIMG` instructions (such as `IMAGE_STORE` and `IMAGE_LOAD`) may produce the wrong register indices for source vector register operands.
42
+
* Decoding binary representation of certain RDNA™2 `MIMG`, `MUBUF` and `MTBUF` instructions may produce the wrong results.
43
+
* Decoding `DS` instructions may return the wrong operands when decoded via `IsaDecoder::DecodeInstruction()` with an `uint64_t` argument.
As can be seen from the command, `-x` flag should be followed by the path to the machine-readable XML specification. Next, `-d` flag should be followed by the instruction in the binary form. Note that the provided instruction should be encoded in the specified architecture. After running the command, the CLI outputs the following:
12
12
@@ -33,8 +33,8 @@ If decoded successfully, CLI outputs the instruction in an assembly form, descri
33
33
To retrieve information about a specific instruction from the spec, the name of the instruction could be provided to the CLI. Refer to the commands below.
As can be seen from the command, `-x` flag should be followed by the path to the machine-readable XML specification. Next, `-i` flag should be followed by the name of the instruction which we are interested in. Note, that the requested instruction should be present in the specified architecture. After running the command, CLI outputs the following:
Copy file name to clipboardExpand all lines: documentation/isa_decoder/api_documentation.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,8 +225,38 @@ int main ()
225
225
226
226
return (is_init && is_decoded) ? 0 : -1;
227
227
}
228
+
```
229
+
230
+
## `amdisa::IsaDecoder::GetDebugLog`
231
+
```c++
232
+
std::vector<std::string> GetDebugLog() const;
233
+
```
234
+
Retrieves a log of error and warning messages generated by the `IsaDecoder` instance. It can be used for debugging purposes to review any issues encountered during the lifetime of the instance.
235
+
236
+
### Return value
237
+
A `std::vector` of `std::string` containing error and warning messages. If no messages are logged, the vector will be empty.
238
+
239
+
### Example
240
+
```c++
241
+
#include"isa_decoder.h"
242
+
#include<iostream>
228
243
244
+
intmain ()
245
+
{
246
+
amdisa::IsaDecoder spec_api;
247
+
// Assume `Initialize` or other operations have been performed.
248
+
249
+
// Retrieve and print internal messages or warnings if present.
250
+
for (const std::string& message : spec_api.GetDebugLog())
0 commit comments