Skip to content

Commit e0bbe92

Browse files
committed
update isa spec docs
1 parent 0855416 commit e0bbe92

3 files changed

Lines changed: 142 additions & 3 deletions

File tree

specification/aie2ps/isa-spec.html

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,8 @@ <h2 id="wait_tcts-0x06">WAIT_TCTS (0x06)</h2>
792792
the current job will be blocked until all the TCT arrive. The runtime will proceed with
793793
execution of other (non-blocked) jobs during that time.
794794
Use this operation only for tasks which have TCTs enabled and where the TCTs are
795-
routed to arrive at the uC executing this operation.
796-
Note that tasks can be enqueued from any jobs, but only one job can call <code>WAIT_TCTS</code>. And
795+
routed to arrive at the uC executing this operation.</p>
796+
<p>Note that tasks can be enqueued from any jobs, but only one job can call <code>WAIT_TCTS</code>. And
797797
waiting for more tcts than enqueued will hang the job forever</p>
798798
<h2 id="end_job-0x07">END_JOB (0x07)</h2>
799799
<p>Indicates the end of the current job.</p>
@@ -1179,6 +1179,7 @@ <h2 id="remote_barrier-0x12">REMOTE_BARRIER (0x12)</h2>
11791179
remote barrier, only one job in a column can participate in. Example:</p>
11801180
<pre><code>REMOTE_BARRIER $rb0, 0xC
11811181
</code></pre>
1182+
<p>Note that it is not necessary all prior jobs have to complete before the barrier matures.</p>
11821183
<h2 id="eof-0xff">EOF (0xff)</h2>
11831184
<p>Indicates the end of the operation sequence.</p>
11841185
<table>
@@ -1378,6 +1379,16 @@ <h2 id="preempt-0x19">PREEMPT (0x19)</h2>
13781379
for each preemption point id, the control code of each uc should have this opcode with same <code>id</code>.
13791380
This opcode should take one whole job but the job can share page with other jobs. All following jobs in same page don't start
13801381
before this preemption job is done</p>
1382+
<p>Note:</p>
1383+
<ol>
1384+
<li>
1385+
<p>Just like REMOTE_BARRIER, the barrier sync done by CERT doesn't require completion of prior jobs</p>
1386+
</li>
1387+
<li>
1388+
<p><code>SAVE</code> and <code>RESTORE</code> control code have self-contained stream switch routing for themselves. The routing information
1389+
will be cleared after <code>SAVE</code> and <code>RESTORE</code> are done</p>
1390+
</li>
1391+
</ol>
13811392
<h2 id="load_pdi-0x1a">LOAD_PDI (0x1a)</h2>
13821393
<p>load pdi</p>
13831394
<table>
@@ -1412,6 +1423,18 @@ <h2 id="load_pdi-0x1a">LOAD_PDI (0x1a)</h2>
14121423
This opcode should take one whole job but the job can share page with other jobs. All jobs following the load pdi job
14131424
don't start before the load pdi job is done.
14141425
In multi-uc case, cert will do barrier sync after the load_pdi job, so each uc needs to have same number of load pdi jobs</p>
1426+
<p>According to AIE spec,</p>
1427+
<pre><code>For full reconfiguration of the cores program memory, the following steps may be taken.
1428+
1429+
Wait for core to reach a known synchronization point (lock, or Core done)
1430+
1431+
Reset, disable core (Section 5.12.2)
1432+
1433+
Write PM
1434+
1435+
Unreset, enable core
1436+
</code></pre>
1437+
<p>Note that if core elf is part of pdi, reset/unreset, enable/disable core required. This should be part of the generated control code</p>
14151438
<h2 id="load_cores-0x04">LOAD_CORES (0x04)</h2>
14161439
<p>load cores</p>
14171440
<table>
@@ -1439,6 +1462,7 @@ <h2 id="load_cores-0x04">LOAD_CORES (0x04)</h2>
14391462
</tbody>
14401463
</table>
14411464
<p>This essentially is same to LOAD_PDI except that CERT will save the elf info for aie cores to different location than the pdi so that cert can do recovery of both during preemption</p>
1465+
<p>Note that same to LOAD_PDI, reset/unreset, enable/disable core is required to load new core elf. This should be part of generated control code</p>
14421466
<h2 id="load_cores_cp-0x20">LOAD_CORES_CP (0x20)</h2>
14431467
<p>load cores_cp</p>
14441468
<table>
@@ -1462,6 +1486,18 @@ <h2 id="load_cores_cp-0x20">LOAD_CORES_CP (0x20)</h2>
14621486
</tbody>
14631487
</table>
14641488
<p>This is to load control packet format core elfs. Compared to the LOAD_CORES, this opcode assumes the control code to load the control packet through shimdma will not take more than a page so that the current page that holds this opcode will not be overwritten. As a result, we can put this control packet loading part right after this opcode and hold everything in one job. The <code>core_elf_id</code> in this opcode and the one in LOAD_CORES are in same id space so that if there are LOAD_CORES and LOAD_CORES_CP, cert can only save the id for the last of these opcodes.</p>
1489+
<p>Notes:</p>
1490+
<ol>
1491+
<li>
1492+
<p>Same to LOAD_PDI, reset/unreset, enable/disable core is required to load new core elf. This should be part of generated control code</p>
1493+
</li>
1494+
<li>
1495+
<p>Completion of control packet blob shimDMA doesn't mean the completion of the control packet loading. Control code itself should be responsible for checking completion of control packet loading. There are 2 ways doing this, one is to enable the write response of last control packet and the other is to add one extra control packet write to a known register. For former way, routing for response packet should be configured, and WAIT_TCTS is used to check the response. For latter way, POLL_32/MASK_POLL_32 is used to check the register of the extra control packet.</p>
1496+
</li>
1497+
<li>
1498+
<p>In broadcast case, completion check should be performed on all destination cores.</p>
1499+
</li>
1500+
</ol>
14651501
<h2 id="load_last_pdi-0x1b">LOAD_LAST_PDI (0x1b)</h2>
14661502
<p>load last loaded pdi</p>
14671503
<table>
@@ -1484,6 +1520,18 @@ <h2 id="load_last_pdi-0x1b">LOAD_LAST_PDI (0x1b)</h2>
14841520
</table>
14851521
<p>Used in preemption restore case. The info (pdi id and location in host ddr) of the pdi last time loaded is saved
14861522
in firmware. During restore (after a context switch), the last loaded pdi will be loaded with this opcode</p>
1523+
<p>Notes:</p>
1524+
<ol>
1525+
<li>
1526+
<p>CERT saves information of one last pdi and one last core elf</p>
1527+
</li>
1528+
<li>
1529+
<p>The last core elf can be either from LOAD_CORES or LOAD_CORES_CP, whichever is the last.</p>
1530+
</li>
1531+
<li>
1532+
<p>In preemption support, LOAD_PDI is mandatory, that is to say, there is at least one LOAD_PDI before preemption point is inserted. LOAD_CORES/LOAD_CORES_CP are optional. </p>
1533+
</li>
1534+
</ol>
14871535
<h2 id="save_timestamps-0x1c">SAVE_TIMESTAMPS (0x1c)</h2>
14881536
<p>save the timestamps</p>
14891537
<table>
@@ -1534,6 +1582,7 @@ <h2 id="sleep-0x1d">SLEEP (0x1d)</h2>
15341582
</table>
15351583
<p>Sleep instruction makes the current job busy waiting <code>target</code> microseconds. This opcode is for test purpose
15361584
only. Calling this operation doesn't yield control to another job.</p>
1585+
<p>Note that this opcode is not supported in release CERT. Dtrace action sleep() is recommended for this test purpose.</p>
15371586
<h2 id="save_register-0x1e">SAVE_REGISTER (0x1e)</h2>
15381587
<p>Reads value from specified register address and saves it in Shared Data Memory.</p>
15391588
<table>

specification/aie2ps/isa-spec.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ the current job will be blocked until all the TCT arrive. The runtime will proce
325325
execution of other (non-blocked) jobs during that time.
326326
Use this operation only for tasks which have TCTs enabled and where the TCTs are
327327
routed to arrive at the uC executing this operation.
328+
328329
Note that tasks can be enqueued from any jobs, but only one job can call `WAIT_TCTS`. And
329330
waiting for more tcts than enqueued will hang the job forever
330331

@@ -574,6 +575,8 @@ remote barrier, only one job in a column can participate in. Example:
574575
REMOTE_BARRIER $rb0, 0xC
575576
```
576577

578+
Note that it is not necessary all prior jobs have to complete before the barrier matures.
579+
577580

578581
## EOF (0xff)
579582

@@ -701,6 +704,13 @@ for each preemption point id, the control code of each uc should have this opcod
701704
This opcode should take one whole job but the job can share page with other jobs. All following jobs in same page don't start
702705
before this preemption job is done
703706

707+
Note:
708+
709+
1. Just like REMOTE_BARRIER, the barrier sync done by CERT doesn't require completion of prior jobs
710+
711+
2. `SAVE` and `RESTORE` control code have self-contained stream switch routing for themselves. The routing information
712+
will be cleared after `SAVE` and `RESTORE` are done
713+
704714

705715
## LOAD_PDI (0x1a)
706716

@@ -719,6 +729,21 @@ This opcode should take one whole job but the job can share page with other jobs
719729
don't start before the load pdi job is done.
720730
In multi-uc case, cert will do barrier sync after the load_pdi job, so each uc needs to have same number of load pdi jobs
721731

732+
According to AIE spec,
733+
```
734+
For full reconfiguration of the cores program memory, the following steps may be taken.
735+
736+
Wait for core to reach a known synchronization point (lock, or Core done)
737+
738+
Reset, disable core (Section 5.12.2)
739+
740+
Write PM
741+
742+
Unreset, enable core
743+
```
744+
745+
Note that if core elf is part of pdi, reset/unreset, enable/disable core required. This should be part of the generated control code
746+
722747

723748
## LOAD_CORES (0x04)
724749

@@ -730,6 +755,8 @@ load cores
730755

731756
This essentially is same to LOAD_PDI except that CERT will save the elf info for aie cores to different location than the pdi so that cert can do recovery of both during preemption
732757

758+
Note that same to LOAD_PDI, reset/unreset, enable/disable core is required to load new core elf. This should be part of generated control code
759+
733760

734761
## LOAD_CORES_CP (0x20)
735762

@@ -741,6 +768,14 @@ load cores_cp
741768

742769
This is to load control packet format core elfs. Compared to the LOAD_CORES, this opcode assumes the control code to load the control packet through shimdma will not take more than a page so that the current page that holds this opcode will not be overwritten. As a result, we can put this control packet loading part right after this opcode and hold everything in one job. The `core_elf_id` in this opcode and the one in LOAD_CORES are in same id space so that if there are LOAD_CORES and LOAD_CORES_CP, cert can only save the id for the last of these opcodes.
743770

771+
Notes:
772+
773+
1. Same to LOAD_PDI, reset/unreset, enable/disable core is required to load new core elf. This should be part of generated control code
774+
775+
2. Completion of control packet blob shimDMA doesn't mean the completion of the control packet loading. Control code itself should be responsible for checking completion of control packet loading. There are 2 ways doing this, one is to enable the write response of last control packet and the other is to add one extra control packet write to a known register. For former way, routing for response packet should be configured, and WAIT_TCTS is used to check the response. For latter way, POLL_32/MASK_POLL_32 is used to check the register of the extra control packet.
776+
777+
3. In broadcast case, completion check should be performed on all destination cores.
778+
744779

745780
## LOAD_LAST_PDI (0x1b)
746781

@@ -753,6 +788,14 @@ load last loaded pdi
753788
Used in preemption restore case. The info (pdi id and location in host ddr) of the pdi last time loaded is saved
754789
in firmware. During restore (after a context switch), the last loaded pdi will be loaded with this opcode
755790

791+
Notes:
792+
793+
1. CERT saves information of one last pdi and one last core elf
794+
795+
2. The last core elf can be either from LOAD_CORES or LOAD_CORES_CP, whichever is the last.
796+
797+
3. In preemption support, LOAD_PDI is mandatory, that is to say, there is at least one LOAD_PDI before preemption point is inserted. LOAD_CORES/LOAD_CORES_CP are optional.
798+
756799

757800
## SAVE_TIMESTAMPS (0x1c)
758801

@@ -779,6 +822,8 @@ sleep instruction.
779822
Sleep instruction makes the current job busy waiting `target` microseconds. This opcode is for test purpose
780823
only. Calling this operation doesn't yield control to another job.
781824

825+
Note that this opcode is not supported in release CERT. Dtrace action sleep() is recommended for this test purpose.
826+
782827

783828
## SAVE_REGISTER (0x1e)
784829

specification/aie2ps/isa-spec.yaml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: MIT
2-
# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
2+
# Copyright (C) 2023-2026 Advanced Micro Devices, Inc. All rights reserved.
33
---
44
platform:
55
architecture: aie2ps
@@ -225,6 +225,7 @@ operations:
225225
execution of other (non-blocked) jobs during that time.
226226
Use this operation only for tasks which have TCTs enabled and where the TCTs are
227227
routed to arrive at the uC executing this operation.
228+
228229
Note that tasks can be enqueued from any jobs, but only one job can call `WAIT_TCTS`. And
229230
waiting for more tcts than enqueued will hang the job forever
230231
- mnemonic: END_JOB
@@ -495,6 +496,8 @@ operations:
495496
```
496497
REMOTE_BARRIER $rb0, 0xC
497498
```
499+
500+
Note that it is not necessary all prior jobs have to complete before the barrier matures.
498501
- mnemonic: EOF
499502
opcode: 0xff
500503
regular: False
@@ -633,6 +636,13 @@ operations:
633636
for each preemption point id, the control code of each uc should have this opcode with same `id`.
634637
This opcode should take one whole job but the job can share page with other jobs. All following jobs in same page don't start
635638
before this preemption job is done
639+
640+
Note:
641+
642+
1. Just like REMOTE_BARRIER, the barrier sync done by CERT doesn't require completion of prior jobs
643+
644+
2. `SAVE` and `RESTORE` control code have self-contained stream switch routing for themselves. The routing information
645+
will be cleared after `SAVE` and `RESTORE` are done
636646
- mnemonic: LOAD_PDI
637647
opcode: 0x1a
638648
regular: True
@@ -657,6 +667,21 @@ operations:
657667
This opcode should take one whole job but the job can share page with other jobs. All jobs following the load pdi job
658668
don't start before the load pdi job is done.
659669
In multi-uc case, cert will do barrier sync after the load_pdi job, so each uc needs to have same number of load pdi jobs
670+
671+
According to AIE spec,
672+
```
673+
For full reconfiguration of the cores program memory, the following steps may be taken.
674+
675+
Wait for core to reach a known synchronization point (lock, or Core done)
676+
677+
Reset, disable core (Section 5.12.2)
678+
679+
Write PM
680+
681+
Unreset, enable core
682+
```
683+
684+
Note that if core elf is part of pdi, reset/unreset, enable/disable core is required. This should be part of the generated control code
660685
- mnemonic: LOAD_CORES
661686
opcode: 0x04
662687
regular: True
@@ -674,6 +699,8 @@ operations:
674699
brief: load cores
675700
description: |
676701
This essentially is same to LOAD_PDI except that CERT will save the elf info for aie cores to different location than the pdi so that cert can do recovery of both during preemption
702+
703+
Note that same to LOAD_PDI, reset/unreset, enable/disable core is required to load new core elf. This should be part of generated control code
677704
- mnemonic: LOAD_CORES_CP
678705
opcode: 0x20
679706
regular: True
@@ -686,6 +713,14 @@ operations:
686713
brief: load cores_cp
687714
description: |
688715
This is to load control packet format core elfs. Compared to the LOAD_CORES, this opcode assumes the control code to load the control packet through shimdma will not take more than a page so that the current page that holds this opcode will not be overwritten. As a result, we can put this control packet loading part right after this opcode and hold everything in one job. The `core_elf_id` in this opcode and the one in LOAD_CORES are in same id space so that if there are LOAD_CORES and LOAD_CORES_CP, cert can only save the id for the last of these opcodes.
716+
717+
Notes:
718+
719+
1. Same to LOAD_PDI, reset/unreset, enable/disable core is required to load new core elf. This should be part of generated control code
720+
721+
2. Completion of control packet blob shimDMA doesn't mean the completion of the control packet loading. Control code itself should be responsible for checking completion of control packet loading. There are 2 ways doing this, one is to enable the write response of last control packet and the other is to add one extra control packet write to a known register. For former way, routing for response packet should be configured, and WAIT_TCTS is used to check the response. For latter way, POLL_32/MASK_POLL_32 is used to check the register of the extra control packet.
722+
723+
3. In broadcast case, completion check should be performed on all destination cores.
689724
- mnemonic: LOAD_LAST_PDI
690725
opcode: 0x1b
691726
regular: True
@@ -696,6 +731,14 @@ operations:
696731
description: |
697732
Used in preemption restore case. The info (pdi id and location in host ddr) of the pdi last time loaded is saved
698733
in firmware. During restore (after a context switch), the last loaded pdi will be loaded with this opcode
734+
735+
Notes:
736+
737+
1. CERT saves information of one last pdi and one last core elf
738+
739+
2. The last core elf can be either from LOAD_CORES or LOAD_CORES_CP, whichever is the last.
740+
741+
3. In preemption support, LOAD_PDI is mandatory, that is to say, there is at least one LOAD_PDI before preemption point is inserted. LOAD_CORES/LOAD_CORES_CP are optional.
699742
- mnemonic: SAVE_TIMESTAMPS
700743
opcode: 0x1c
701744
regular: True
@@ -724,6 +767,8 @@ operations:
724767
description: |
725768
Sleep instruction makes the current job busy waiting `target` microseconds. This opcode is for test purpose
726769
only. Calling this operation doesn't yield control to another job.
770+
771+
Note that this opcode is not supported in release CERT. Dtrace action sleep() is recommended for this test purpose.
727772
- mnemonic: SAVE_REGISTER
728773
opcode: 0x1e
729774
regular: True

0 commit comments

Comments
 (0)